com.sas.visuals
Class ScrollSlider

com.sas.visuals.ScrollSlider
All Implemented Interfaces:
com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.models.IncrementInterface, com.sas.models.RangeInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, SliderInterface, java.awt.Adjustable, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener

public class ScrollSlider
implements SliderInterface, com.sas.models.RangeInterface, com.sas.models.IncrementInterface, java.awt.event.ActionListener, java.awt.Adjustable

ScrollSlider creates an object that functions as the track area on a Scrollbar. The ScrollSlider has three main areas: an increment portion, a decrement portion and a draggable thumb portion separating the other two portions. There are individual ButtonModelInterface objects used for each of the three areas. One single ButtonListenerInterface object listens for user events and modifies the ButtonModelInterface objects accordingly. The increment and decrement areas button models are AlarmButtonModel to implement power scrolling while the mouse button is held down. The thumb uses a DefaultButtonModel. The listener is a SliderListener.

Notes:


See Also:
Scrollbar, AlarmButtonModel, SliderListener, Serialized Form

Field Summary
protected  java.awt.event.AdjustmentListener adjustmentListener
           
protected  boolean allowIncrements
           
protected  java.awt.Rectangle decrementBounds
           
protected  ButtonModelInterface decrModel
           
protected  com.sas.models.BoundedNumberInterface defaultModel
           
protected  java.awt.Rectangle incrementBounds
           
protected  ButtonModelInterface incrModel
           
protected  boolean maximumReachable
           
protected  int minThumbHeight
           
protected  boolean modelSet
           
protected  int orientation
           
protected  com.sas.util.transforms.TransformInterface roundNumberTransform
           
protected  ButtonListenerInterface sliderListener
           
protected  java.awt.Rectangle thumbBounds
           
protected  boolean thumbMove
           
protected  boolean thumbVisible
           
protected  boolean trackEnabled
           
protected  ButtonModelInterface trackModel
           
protected  boolean validBounds
           
protected  java.lang.Number visibleAmt
           
 
Fields inherited from class com.sas.awt.Component
RB_KEY
 
Constructor Summary
ScrollSlider()
          Default constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          java.awt.event.ActionListener method to handle ActionEvents that the ScrollSlider listens for.
 void addAdjustmentListener(java.awt.event.AdjustmentListener l)
          Add a listener to receive adjustment events when the value of the ScrollSlider changes.
protected  void checkTrackEnabled(int thumbHeight, int sizeHeight)
          Check the height of the thumb to determine if the track should be disabled.
 java.awt.Dimension computePreferredSize()
          Compute the preferredSize of the ScrollSlider.
 void detachModel(com.sas.ModelInterface model)
          Detach the specified model from the ScrollSlider.
 int getBlockIncrement()
          Get the integer value of the blockIncrement property.
 java.lang.Number getBlockIncrementNumber()
          Get the blockIncrement number based on the model.
 java.awt.Rectangle getDecrementBounds()
          Get the bounds of the decrement area for the sliderListener to determine which area the mouse was pressed on.
 ButtonModelInterface getDecrementModel()
          Get the ButtonModelInterface object used by the decrement portion of the ScrollSlider.
static int getDefaultHeight()
          Return the default height
static int getDefaultWidth()
          Return the default width
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 java.awt.Rectangle getIncrementBounds()
          Get the bounds of the increment area for the sliderListener to determine which area the mouse was pressed on.
 ButtonModelInterface getIncrementModel()
          Get the ButtonModelInterface object used by the increment portion of the ScrollSlider.
 int getMaximum()
          Get the value of the maximum property.
 java.lang.Number getMaximumNumber()
          Get the maximum bounds number based on the model.
 int getMinimum()
          Get the value of the minimum property.
 java.lang.Number getMinimumNumber()
          Get the minimum bounds number based on the model.
 java.awt.Dimension getMinimumSize()
          Get the minimumSize of the ScrollSlider.
 int getMinimumThumbHeight()
          Get the minimum pixel height of the thumb area.
 java.lang.Number getNumberValue()
          Get the value number based on the model.
 int getOrientation()
          Get the orientation of the ScrollSlider.
 java.util.Vector getRequiredInterfaces()
          Returns the required interfaces Vector for this component.
 com.sas.util.transforms.TransformInterface getRoundNumberTransform()
          Get the transform used to round the numberValue set when the thumb area of the slider is dragged.
protected  java.awt.Rectangle getThumbBounds()
          Get the bounds of the thumb area for the sliderListener to determine which area the mouse was pressed on.
 java.awt.Point getThumbPosition()
          Get the top, left position of the thumb area.
 ButtonModelInterface getTrackModel()
          Get the ButtonModelInterface object used by the thumb portion of the ScrollSlider.
 int getUnitIncrement()
          Get the value of the unitIncrement property.
 java.lang.Number getUnitIncrementNumber()
          Get the unitIncrement number based on the model.
 int getValue()
          Get the integer value of the value property.
 int getVisibleAmount()
          Get the integer value of the visible amount of the thumb.
 java.lang.Number getVisibleAmountNumber()
          Get the Number value of the visible amount of the thumb.
 java.lang.Number incrementBy(int increment, int incrementType)
          Increment, by unit or block increment amount, the current value by the specified number of increments.
 boolean isMaximumReachable()
          Returns if the thumb area can drag the value to the maximum.
 boolean isThumbVisible()
          Get if the thumb area is visible.
 boolean isTrackEnabled()
          Determine if Track is enabled.
protected  java.awt.Rectangle layoutActionAreas()
          Determine the bounds of the decrement, increment, and thumb areas.
 void paint(java.awt.Graphics g)
          Paint the ScrollSlider.
protected  void paintBackground(java.awt.Graphics g)
          Paint the background of the ScrollSlider.
protected  void paintDecrementArea(java.awt.Graphics g, java.awt.Rectangle decrBounds)
          Paint the decrement area of the ScrollSlider.
protected  void paintIncrementArea(java.awt.Graphics g, java.awt.Rectangle incrBounds)
          Paint the increment area of the ScrollSlider.
protected  void paintThumbArea(java.awt.Graphics g, java.awt.Rectangle tRect)
          Paint the thumb area of the ScrollSlider.
protected  void processAdjustmentEvent(java.awt.event.AdjustmentEvent e)
          Process adjustment events.
protected  void processEvent(java.awt.AWTEvent e)
          Process events.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Invoked when a bound property is changed.
 void refresh(com.sas.ModelInterface model)
          Refresh the spinButton based on its model.
 void removeAdjustmentListener(java.awt.event.AdjustmentListener l)
          Remove the adjustment listener.
 void setBlockIncrement(int block)
          Set the integer value of the blockIncrement property.
 void setBlockIncrementNumber(java.lang.Number block)
          Set the blockIncrement number.
 void setBounds(int x, int y, int width, int height)
          Set the bounds of the ScrollSlider.
static void setDefaultHeight(int newDefaultHeight)
          Set the default height
 void setDefaultValues()
          Set the default values of the properties of the ScrollSlider
static void setDefaultWidth(int newDefaultWidth)
          Set the default width
 void setEnabled(boolean enabled)
          Set the enabled state of the ScrollSlider.
 void setMaximum(int max)
          Set the integer value of the maximum bounds.
 void setMaximumNumber(java.lang.Number max)
          Set the maximum bounds number.
 void setMaximumReachable(boolean reachable)
          Set whether the thumb area can drag the value to the maximum.
 void setMinimum(int min)
          Set the integer value of the minimum property.
 void setMinimumNumber(java.lang.Number min)
          Set the minimum bounds number.
 void setMinimumThumbHeight(int minThumb)
          Set the minimum pixel height of the thumb area.
 void setModelInterface(com.sas.ModelInterface model)
          Set the connected model.
 void setNumberValue(java.lang.Number newValue)
          Set the number value.
 void setOrientation(int orient)
          Set the orientation of the ScrollSlider.
 void setRoundNumberTransform(com.sas.util.transforms.TransformInterface transform)
          Set the transform used to round the numberValue set when the thumb area of the slider is dragged.
 void setThumbPosition(java.awt.Point pt)
          Set the new top, left position of the thumb area.
 void setThumbVisible(boolean vis)
          Set the thumb area visible state.
 void setTrackEnabled(boolean te)
          Set the track enabled property.
 void setUnitIncrement(int unit)
          Set the integer value of the unitIncrement for the SpinButton.
 void setUnitIncrementNumber(java.lang.Number unit)
          Set the unitIncrement number.
 void setValue(int newValue)
          Set the integer value of the value property.
 void setVisibleAmount(int visAmount)
          Set the integer value of the visible amount of the thumb.
 void setVisibleAmountNumber(java.lang.Number visAmount)
          Set the Number value of the visible amount of the thumb.
 
Methods inherited from class com.sas.awt.ComponentVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, clone, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 

Field Detail

trackEnabled

protected boolean trackEnabled

thumbVisible

protected boolean thumbVisible

allowIncrements

protected boolean allowIncrements

maximumReachable

protected boolean maximumReachable

orientation

protected int orientation

visibleAmt

protected java.lang.Number visibleAmt

minThumbHeight

protected int minThumbHeight

modelSet

protected transient boolean modelSet

validBounds

protected transient boolean validBounds

incrementBounds

protected transient java.awt.Rectangle incrementBounds

decrementBounds

protected transient java.awt.Rectangle decrementBounds

thumbBounds

protected transient java.awt.Rectangle thumbBounds

thumbMove

protected transient boolean thumbMove

adjustmentListener

protected transient java.awt.event.AdjustmentListener adjustmentListener

roundNumberTransform

protected com.sas.util.transforms.TransformInterface roundNumberTransform

incrModel

protected ButtonModelInterface incrModel

decrModel

protected ButtonModelInterface decrModel

trackModel

protected ButtonModelInterface trackModel

sliderListener

protected ButtonListenerInterface sliderListener

defaultModel

protected com.sas.models.BoundedNumberInterface defaultModel
Constructor Detail

ScrollSlider

public ScrollSlider()
Default constructor.

Method Detail

getDefaultWidth

public static int getDefaultWidth()
Return the default width

Returns:
default width

setDefaultWidth

public static void setDefaultWidth(int newDefaultWidth)
Set the default width

Parameters:
newDefaultWidth - the new default width

getDefaultHeight

public static int getDefaultHeight()
Return the default height

Returns:
default height

setDefaultHeight

public static void setDefaultHeight(int newDefaultHeight)
Set the default height

Parameters:
newDefaultHeight - the new default height

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
java.awt.event.ActionListener method to handle ActionEvents that the ScrollSlider listens for.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent to handle

addAdjustmentListener

public void addAdjustmentListener(java.awt.event.AdjustmentListener l)
Add a listener to receive adjustment events when the value of the ScrollSlider changes.

Specified by:
addAdjustmentListener in interface java.awt.Adjustable
Parameters:
l - the adjustment listener
See Also:
Adjustable.addAdjustmentListener(java.awt.event.AdjustmentListener), AdjustmentEvent

setModelInterface

public void setModelInterface(com.sas.ModelInterface model)
Set the connected model. This will detach the old model and attach the new model.

Specified by:
setModelInterface in interface com.sas.ViewInterface
Overrides:
setModelInterface in class ComponentVisualComponent
Parameters:
model - the new model for the ScrollSlider
See Also:
ViewInterface.setModelInterface(com.sas.ModelInterface)

detachModel

public void detachModel(com.sas.ModelInterface model)
Detach the specified model from the ScrollSlider. The defaultModel will be attached if the model is set to null.

Specified by:
detachModel in interface com.sas.ViewInterface
Overrides:
detachModel in class ComponentVisualComponent
Parameters:
model - Model to detach
See Also:
ViewInterface.detachModel(com.sas.ModelInterface)

computePreferredSize

public java.awt.Dimension computePreferredSize()
Compute the preferredSize of the ScrollSlider.

Specified by:
computePreferredSize in interface VisualInterface
Overrides:
computePreferredSize in class ComponentVisualComponent
Returns:
the minimumSize if no resizing has been done, otherwise the current size.
See Also:
VisualInterface.computePreferredSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()
Get the minimumSize of the ScrollSlider.

Specified by:
getMinimumSize in interface VisualInterface
Overrides:
getMinimumSize in class Component
Returns:
the minimumSize
See Also:
VisualInterface.getMinimumSize()

getBlockIncrement

public final int getBlockIncrement()
Get the integer value of the blockIncrement property. This method calls getBlockIncrementNumber() and returns the intValue().

Specified by:
getBlockIncrement in interface java.awt.Adjustable
Returns:
the value of the blockIncrement property.
See Also:
setBlockIncrement(int)

getDecrementModel

public ButtonModelInterface getDecrementModel()
Get the ButtonModelInterface object used by the decrement portion of the ScrollSlider. By default this is an AlarmButtonModel. When this model fires an ActionEvent, the ScrollSlider decrements its value property.

Returns:
the decrement ButtonModelInterface object

getIncrementModel

public ButtonModelInterface getIncrementModel()
Get the ButtonModelInterface object used by the increment portion of the ScrollSlider. By default this is an AlarmButtonModel. When this model fires an ActionEvent, the ScrollSlider increments its value property.

Returns:
the increment ButtonModelInterface object

getMaximum

public final int getMaximum()
Get the value of the maximum property. This method calls getMaximumNumber() and returns intValue().

Specified by:
getMaximum in interface java.awt.Adjustable
Returns:
the value of the maximum property.
See Also:
setMaximum(int)

getMinimum

public final int getMinimum()
Get the value of the minimum property. This method calls getMinimumNumber() and returns intValue().

Specified by:
getMinimum in interface java.awt.Adjustable
Returns:
the value of the minimum property.
See Also:
setMinimum(int)

getMinimumThumbHeight

public int getMinimumThumbHeight()
Get the minimum pixel height of the thumb area.

Returns:
the minimum pixel height of the thumb area.

getOrientation

public int getOrientation()
Get the orientation of the ScrollSlider.

Specified by:
getOrientation in interface java.awt.Adjustable
Returns:
the value of the orientation property.
See Also:
Adjustable, setOrientation(int)

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Returns the required interfaces Vector for this component.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Overrides:
getRequiredInterfaces in class ComponentVisualComponent
Returns:
the required interfaces Vector for this component.
See Also:
ViewInterface.getRequiredInterfaces()

getTrackModel

public ButtonModelInterface getTrackModel()
Get the ButtonModelInterface object used by the thumb portion of the ScrollSlider. By default this is a DefaultButtonModel.

Returns:
the track ButtonModelInterface object

getUnitIncrement

public final int getUnitIncrement()
Get the value of the unitIncrement property. This method calls getUnitIncrementNumber() and returns intValue().

Specified by:
getUnitIncrement in interface java.awt.Adjustable
Returns:
the value of the unitIncrement property.
See Also:
setUnitIncrement(int)

getValue

public final int getValue()
Get the integer value of the value property. This method calls getNumberValue() and returns intValue().

Specified by:
getValue in interface java.awt.Adjustable
Returns:
the value of the value property.
See Also:
setValue(int)

getVisibleAmountNumber

public java.lang.Number getVisibleAmountNumber()
Get the Number value of the visible amount of the thumb. This value is used to determine the size of the thumb in relation to the rest of the ScrollSlider.

Returns:
the value of the visible amount of the Scrollbar thumb.

getVisibleAmount

public int getVisibleAmount()
Get the integer value of the visible amount of the thumb. This value is used to determine the size of the thumb in relation to the rest of the ScrollSlider.

Specified by:
getVisibleAmount in interface java.awt.Adjustable
Returns:
the value of the visible amount of the Scrollbar thumb.

incrementBy

public java.lang.Number incrementBy(int increment,
                                    int incrementType)
Increment, by unit or block increment amount, the current value by the specified number of increments. The current value will be incremented( or decremented ) within the bounds of the maximum and minimum values.

Specified by:
incrementBy in interface com.sas.models.IncrementInterface
Parameters:
increment - The number of incrementType(unit or block) amounts to increment the current value(can be negative to decrement value).
incrementType - UNIT to increment by the unit amount; BLOCK to increment by the block amount

isMaximumReachable

public boolean isMaximumReachable()
Returns if the thumb area can drag the value to the maximum. The default is false. Causing the reachable maximum to be adjusted based on the visibleAmountNumber.

Returns:
true if the thumb can be dragged to cause the value to be set to the maximum.

paint

public void paint(java.awt.Graphics g)
Paint the ScrollSlider.

Overrides:
paint in class ComponentVisualComponent
Parameters:
g - the Graphics context
See Also:
VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

paintBackground

protected void paintBackground(java.awt.Graphics g)
Paint the background of the ScrollSlider.


paintIncrementArea

protected void paintIncrementArea(java.awt.Graphics g,
                                  java.awt.Rectangle incrBounds)
Paint the increment area of the ScrollSlider.

Parameters:
g - the Graphics context.
incrBounds - the bounds of the increment area.

paintDecrementArea

protected void paintDecrementArea(java.awt.Graphics g,
                                  java.awt.Rectangle decrBounds)
Paint the decrement area of the ScrollSlider.

Parameters:
g - the Graphics context.
decrBounds - the bounds of the decrement area.

paintThumbArea

protected void paintThumbArea(java.awt.Graphics g,
                              java.awt.Rectangle tRect)
Paint the thumb area of the ScrollSlider.

Parameters:
g - the Graphics context.
tBounds - the bounds of the thumb area.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Invoked when a bound property is changed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class ComponentVisualComponent
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

processEvent

protected void processEvent(java.awt.AWTEvent e)
Process events.

Overrides:
processEvent in class java.awt.Component

processAdjustmentEvent

protected void processAdjustmentEvent(java.awt.event.AdjustmentEvent e)
Process adjustment events.


refresh

public void refresh(com.sas.ModelInterface model)
Refresh the spinButton based on its model.

Specified by:
refresh in interface com.sas.ViewInterface
Overrides:
refresh in class ComponentVisualComponent
Parameters:
model - Model that has just been updated
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

removeAdjustmentListener

public void removeAdjustmentListener(java.awt.event.AdjustmentListener l)
Remove the adjustment listener.

Specified by:
removeAdjustmentListener in interface java.awt.Adjustable
Parameters:
l - the adjustment listener
See Also:
addAdjustmentListener(java.awt.event.AdjustmentListener), AdjustmentEvent

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Set the bounds of the ScrollSlider.

Specified by:
setBounds in interface VisualInterface
Overrides:
setBounds in class ComponentVisualComponent
See Also:
VisualInterface.setBounds(int, int, int, int)

setBlockIncrement

public final void setBlockIncrement(int block)
Set the integer value of the blockIncrement property. This method calls getBlockIncrementNumber() and returns intValue().

Specified by:
setBlockIncrement in interface java.awt.Adjustable
Parameters:
blockIncrement - the new value of the blockIncrement property.
See Also:
getBlockIncrement()

setDefaultValues

public void setDefaultValues()
Set the default values of the properties of the ScrollSlider

Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class Component
See Also:
ComponentInterface.setDefaultValues()

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state of the ScrollSlider.

Specified by:
setEnabled in interface VisualInterface
Overrides:
setEnabled in class ComponentVisualComponent
Parameters:
enabled - the enabled state of the ScrollSlider.
See Also:
VisualInterface.setEnabled(boolean)

setMaximumReachable

public void setMaximumReachable(boolean reachable)
Set whether the thumb area can drag the value to the maximum. The default is false. Causing the reachable maximum to be adjusted based on the visibleAmountNumber.

Parameters:
reachable - set whether the thumb value can reach the maximum.

setMaximum

public final void setMaximum(int max)
Set the integer value of the maximum bounds. This method calls setMaximumNumber() passing it a java.lang.Long created from max.

Specified by:
setMaximum in interface java.awt.Adjustable
Parameters:
max - the new value of the maximum bounds.
See Also:
getMaximum()

setMinimum

public final void setMinimum(int min)
Set the integer value of the minimum property. This method calls setMinimumNumber() passing it a java.lang.Long created from min.

Specified by:
setMinimum in interface java.awt.Adjustable
Parameters:
min - the new value of the minimum bounds.
See Also:
getMinimum()

setMinimumThumbHeight

public void setMinimumThumbHeight(int minThumb)
Set the minimum pixel height of the thumb area.

Parameters:
minThumb - the minimum pixel height of the thumb area.

isTrackEnabled

public boolean isTrackEnabled()
Determine if Track is enabled.

Returns:
true if the track is enabled; false otherwise.

setTrackEnabled

public void setTrackEnabled(boolean te)
Set the track enabled property. The track can be disabled even if the ScrollSlider is enabled if the size of the thumb is greater than the area to display it in.


isThumbVisible

public boolean isThumbVisible()
Get if the thumb area is visible.

Returns:
true if the thumb is visible, false otherwise

setThumbVisible

public void setThumbVisible(boolean vis)
Set the thumb area visible state.

Parameters:
vis - true if the thumb is visible, false otherwise

getRoundNumberTransform

public com.sas.util.transforms.TransformInterface getRoundNumberTransform()
Get the transform used to round the numberValue set when the thumb area of the slider is dragged. The number passed to the transform will be a Double.

Returns:
the transform used to round the numberValue set when the slider is dragged

setRoundNumberTransform

public void setRoundNumberTransform(com.sas.util.transforms.TransformInterface transform)
Set the transform used to round the numberValue set when the thumb area of the slider is dragged. The number passed to the transform will be a Double.

Parameters:
transform - the transform used to round the numberValue set when the slider is dragged

setUnitIncrement

public final void setUnitIncrement(int unit)
Set the integer value of the unitIncrement for the SpinButton. This method calls setUnitIncrementNumber() passing it a java.lang.Long created from unit.

Specified by:
setUnitIncrement in interface java.awt.Adjustable
Parameters:
unit - the amount the value is incremented/decremented when the ScrollSlider is triggered.
See Also:
getUnitIncrement()

setValue

public final void setValue(int newValue)
Set the integer value of the value property. This method calls setNumberValue() passing it a java.lang.Long created from newValue.

Specified by:
setValue in interface java.awt.Adjustable
Parameters:
newValue - the new value of the ScrollSlider.
See Also:
getValue()

setVisibleAmount

public void setVisibleAmount(int visAmount)
Set the integer value of the visible amount of the thumb. This value is used to determine the size of the thumb in relation to the rest of the ScrollSlider.

Specified by:
setVisibleAmount in interface java.awt.Adjustable
Parameters:
visAmount - the value of the visible amount of the Scrollbar thumb.

setVisibleAmountNumber

public void setVisibleAmountNumber(java.lang.Number visAmount)
Set the Number value of the visible amount of the thumb. This value is used to determine the size of the thumb in relation to the rest of the ScrollSlider.

Parameters:
visAmount - the value of the visible amount of the Scrollbar thumb.

setOrientation

public void setOrientation(int orient)
Set the orientation of the ScrollSlider. Possible values are java.awt.Adjustable.HORIZONTAL and VERTICAL.

Parameters:
orient - the value of the orientation property.
See Also:
Adjustable

getUnitIncrementNumber

public java.lang.Number getUnitIncrementNumber()
Get the unitIncrement number based on the model.

Specified by:
getUnitIncrementNumber in interface com.sas.models.IncrementInterface
Returns:
the model unitIncrement number or null if no model is set.
See Also:
setUnitIncrementNumber(java.lang.Number)

getBlockIncrementNumber

public java.lang.Number getBlockIncrementNumber()
Get the blockIncrement number based on the model.

Specified by:
getBlockIncrementNumber in interface com.sas.models.IncrementInterface
Returns:
the model blockIncrement number or null if no model is set.
See Also:
setBlockIncrementNumber(java.lang.Number)

getMaximumNumber

public java.lang.Number getMaximumNumber()
Get the maximum bounds number based on the model.

Specified by:
getMaximumNumber in interface com.sas.models.RangeInterface
Returns:
the model maximum bounds number or null if no model is set.
See Also:
setMaximumNumber(java.lang.Number)

getMinimumNumber

public java.lang.Number getMinimumNumber()
Get the minimum bounds number based on the model.

Specified by:
getMinimumNumber in interface com.sas.models.RangeInterface
Returns:
the model minimum bounds number or null if no model is set.
See Also:
setMinimumNumber(java.lang.Number)

getNumberValue

public java.lang.Number getNumberValue()
Get the value number based on the model.

Returns:
the model value number or null if no model is set.
See Also:
setNumberValue(java.lang.Number)

setMaximumNumber

public void setMaximumNumber(java.lang.Number max)
Set the maximum bounds number.

Specified by:
setMaximumNumber in interface com.sas.models.RangeInterface
Parameters:
max - the new maximum bounds for the SpinButton value.
See Also:
getMaximumNumber()

setMinimumNumber

public void setMinimumNumber(java.lang.Number min)
Set the minimum bounds number.

Specified by:
setMinimumNumber in interface com.sas.models.RangeInterface
Parameters:
min - the new minimum bounds for the SpinButton value.
See Also:
getMinimumNumber()

setBlockIncrementNumber

public void setBlockIncrementNumber(java.lang.Number block)
Set the blockIncrement number.

Specified by:
setBlockIncrementNumber in interface com.sas.models.IncrementInterface
Parameters:
block - the new blockIncrement number.
See Also:
getBlockIncrementNumber()

setUnitIncrementNumber

public void setUnitIncrementNumber(java.lang.Number unit)
Set the unitIncrement number.

Specified by:
setUnitIncrementNumber in interface com.sas.models.IncrementInterface
Parameters:
unit - the new blockIncrement number.
See Also:
getUnitIncrementNumber()

setNumberValue

public void setNumberValue(java.lang.Number newValue)
Set the number value.

Parameters:
newValue - the new value.
See Also:
getNumberValue()

layoutActionAreas

protected java.awt.Rectangle layoutActionAreas()
Determine the bounds of the decrement, increment, and thumb areas. This is based on the value of the ScrollSlider and the visibleAmount of the thumb area.

Returns:
the bounds of the area that need to be repainted because of changes to the thumb area

checkTrackEnabled

protected void checkTrackEnabled(int thumbHeight,
                                 int sizeHeight)
Check the height of the thumb to determine if the track should be disabled.

Parameters:
thumbHeight - the height of the thumb area
sizeHeight - the height of the ScrollSlider

getIncrementBounds

public java.awt.Rectangle getIncrementBounds()
Get the bounds of the increment area for the sliderListener to determine which area the mouse was pressed on.

Specified by:
getIncrementBounds in interface SliderInterface
Returns:
the bounds of the increment area

getDecrementBounds

public java.awt.Rectangle getDecrementBounds()
Get the bounds of the decrement area for the sliderListener to determine which area the mouse was pressed on.

Specified by:
getDecrementBounds in interface SliderInterface
Returns:
the bounds of the decrement area

getThumbBounds

protected java.awt.Rectangle getThumbBounds()
Get the bounds of the thumb area for the sliderListener to determine which area the mouse was pressed on.

Returns:
the bounds of the thumb area

getThumbPosition

public java.awt.Point getThumbPosition()
Get the top, left position of the thumb area.

Specified by:
getThumbPosition in interface SliderInterface
Returns:
the top, left position of the thumb area

setThumbPosition

public void setThumbPosition(java.awt.Point pt)
Set the new top, left position of the thumb area. This will be translated into a valid value and the value of the ScrollSlider will be changed.

Specified by:
setThumbPosition in interface SliderInterface
Parameters:
pt - the new thumb area position



Copyright © 2009 SAS Institute Inc. All Rights Reserved.