Package Summary  Overview Summary

class:DefaultBoundedRangeModel [NONE]

  • All Implemented Interfaces:
    Serializable, BoundedRangeModel

    public class DefaultBoundedRangeModel
    extends Object
    implements BoundedRangeModel, Serializable
    
    A generic implementation of BoundedRangeModel.

    Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.

    Since:
    1.2
    See Also:
    BoundedRangeModel, Serialized Form

field:changeEvent [NONE]

  • changeEvent

    protected transient 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".

field:listenerList [NONE]

  • listenerList

    protected EventListenerList listenerList
    The listeners waiting for model changes.

constructor:<init>() [NONE]

  • DefaultBoundedRangeModel

    public DefaultBoundedRangeModel()
    Initializes all of the properties with default values. Those values are:
    • value = 0
    • extent = 0
    • minimum = 0
    • maximum = 100
    • adjusting = false

constructor:<init>(int,int,int,int) [NONE]

  • 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
     
    Parameters:
    value - an int giving the current value
    extent - the length of the inner range that begins at the model's value
    min - an int giving the minimum value
    max - an int giving the maximum value

method:getValue() [NONE]

method:getExtent() [NONE]

method:getMinimum() [NONE]

method:getMaximum() [NONE]

method:setValue(int) [NONE]

  • 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
    Parameters:
    n - the model's new value
    See Also:
    BoundedRangeModel.setValue(int)

method:setExtent(int) [NONE]

  • 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
    Parameters:
    n - the model's new extent
    See Also:
    BoundedRangeModel.setExtent(int)

method:setMinimum(int) [NONE]

method:setMaximum(int) [NONE]

  • 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
    Parameters:
    n - the model's new maximum
    See Also:
    BoundedRangeModel.setMaximum(int)

method:setValueIsAdjusting(boolean) [NONE]

method:getValueIsAdjusting() [NONE]

method:setRangeProperties(int,int,int,int,boolean) [NONE]

method:addChangeListener(javax.swing.event.ChangeListener) [NONE]

method:removeChangeListener(javax.swing.event.ChangeListener) [NONE]

method:getChangeListeners() [NONE]

method:fireStateChanged() [NONE]

method:toString() [NONE]

  • toString

    public String toString()
    Returns a string that displays all of the BoundedRangeModel properties.
    Overrides:
    toString in class Object
    Returns:
    a string representation of the object.

method:getListeners(java.lang.Class) [NONE]

  • getListeners

    public <T extends EventListener> T[] getListeners​(Class<T> listenerType)
    Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

    You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultBoundedRangeModel instance m for its change listeners with the following code:

    ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));
    If no such listeners exist, this method returns an empty array.

    Type Parameters:
    T - the type of EventListener class being requested
    Parameters:
    listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
    Returns:
    an array of all objects registered as FooListeners on this model, or an empty array if no such listeners have been added
    Throws:
    ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
    Since:
    1.3
    See Also:
    getChangeListeners()

© 2018 Oracle Corporation and/or its affiliates