EchoPoint
1.0

echopoint.progressbar
Class DefaultBoundedRangeModel

java.lang.Object
  extended byechopoint.progressbar.DefaultBoundedRangeModel
All Implemented Interfaces:
BoundedRangeModel, java.io.Serializable

public class DefaultBoundedRangeModel
extends java.lang.Object
implements BoundedRangeModel, java.io.Serializable

A generic implementation of BoundedRangeModel.

See Also:
Serialized Form

Field Summary
protected  nextapp.echo.event.ChangeEvent changeEvent
          Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property.
protected  nextapp.echo.event.EventListenerList listenerList
          The listeners waiting for model changes.
 
Constructor Summary
DefaultBoundedRangeModel()
          Initializes all of the properties with default values.
DefaultBoundedRangeModel(int value, int extent, int min, int max)
          Initializes value, extent, minimum and maximum.
 
Method Summary
 void addChangeListener(nextapp.echo.event.ChangeListener l)
          Adds a ChangeListener to the button.
 void fireStateChanged()
          Notifies all listeners that have registered for this event type.
 int getExtent()
          Return the model's extent.
 int getMaximum()
          Return the model's maximum.
 int getMinimum()
          Return the model's minimum.
 int getValue()
          Return the model's current value.
 boolean getValueIsAdjusting()
          Returns true if the value is in the process of changing as a result of actions being taken by the user.
 void removeChangeListener(nextapp.echo.event.ChangeListener l)
          Removes a ChangeListener from the button.
 void setExtent(int n)
          Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints: minimum <= value <= value+extent <= maximum
 void setMaximum(int n)
          Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints: minimum <= value <= value+extent <= maximum
 void setMinimum(int n)
          Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints: minimum <= value <= value+extent <= maximum
 void setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting)
          Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints: minimum <= value <= value+extent <= maximum At most, one ChangeEvent is generated.
 void setValue(int n)
          Sets the current value of the model.
 void setValueIsAdjusting(boolean b)
          Sets the valueIsAdjusting property.
 java.lang.String toString()
          Returns a string that displays all of the BoundedRangeModel properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

changeEvent

protected transient nextapp.echo.event.ChangeEvent changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".


listenerList

protected nextapp.echo.event.EventListenerList listenerList
The listeners waiting for model changes.

Constructor Detail

DefaultBoundedRangeModel

public DefaultBoundedRangeModel()
Initializes all of the properties with default values. Those values are:


DefaultBoundedRangeModel

public DefaultBoundedRangeModel(int value,
                                int extent,
                                int min,
                                int max)
Initializes value, extent, minimum and maximum. Adjusting is false. Throws an IllegalArgumentException if the following constraints aren't satisfied:
 min <= value <= value+extent <= max
 

Method Detail

addChangeListener

public void addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the button.

Specified by:
addChangeListener in interface BoundedRangeModel
Parameters:
l - The ChangeListener to be added.

fireStateChanged

public void fireStateChanged()
Notifies all listeners that have registered for this event type.


getExtent

public int getExtent()
Return the model's extent.

Specified by:
getExtent in interface BoundedRangeModel
Returns:
the model's extent

getMaximum

public int getMaximum()
Return the model's maximum.

Specified by:
getMaximum in interface BoundedRangeModel
Returns:
the model's maximum

getMinimum

public int getMinimum()
Return the model's minimum.

Specified by:
getMinimum in interface BoundedRangeModel
Returns:
the value of the minimum property

getValue

public int getValue()
Return the model's current value.

Specified by:
getValue in interface BoundedRangeModel

getValueIsAdjusting

public boolean getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user.

Specified by:
getValueIsAdjusting in interface BoundedRangeModel

removeChangeListener

public void removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from the button.

Specified by:
removeChangeListener in interface BoundedRangeModel
Parameters:
l - The ChangeListener to be removed.

setExtent

public void setExtent(int n)
Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints:
     minimum <= value <= value+extent <= maximum
 

Specified by:
setExtent in interface BoundedRangeModel

setMaximum

public void setMaximum(int n)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
     minimum <= value <= value+extent <= maximum
 

Specified by:
setMaximum in interface BoundedRangeModel

setMinimum

public void setMinimum(int n)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
     minimum <= value <= value+extent <= maximum
 

Specified by:
setMinimum in interface BoundedRangeModel

setRangeProperties

public void setRangeProperties(int newValue,
                               int newExtent,
                               int newMin,
                               int newMax,
                               boolean adjusting)
Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
     minimum <= value <= value+extent <= maximum
 

At most, one ChangeEvent is generated.

Specified by:
setRangeProperties in interface BoundedRangeModel

setValue

public void setValue(int n)
Sets the current value of the model. For a slider, that determines where the knob appears. Ensures that the new value, n falls within the model's constraints:
     minimum <= value <= value+extent <= maximum
 

Specified by:
setValue in interface BoundedRangeModel

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
Sets the valueIsAdjusting property.

Specified by:
setValueIsAdjusting in interface BoundedRangeModel
Parameters:
b - true if the upcoming changes to the value property are part of a series

toString

public java.lang.String toString()
Returns a string that displays all of the BoundedRangeModel properties.


EchoPoint
1.0