|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.visuals.ScrollSlider
public class ScrollSlider
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:
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 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 |
| Fields inherited from interface com.sas.models.IncrementInterface |
|---|
BLOCK, UNIT |
| 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(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(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(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. |
| Field Detail |
|---|
protected boolean trackEnabled
protected boolean thumbVisible
protected boolean allowIncrements
protected boolean maximumReachable
protected int orientation
protected java.lang.Number visibleAmt
protected int minThumbHeight
protected transient boolean modelSet
protected transient boolean validBounds
protected transient java.awt.Rectangle incrementBounds
protected transient java.awt.Rectangle decrementBounds
protected transient java.awt.Rectangle thumbBounds
protected transient boolean thumbMove
protected transient java.awt.event.AdjustmentListener adjustmentListener
protected com.sas.util.transforms.TransformInterface roundNumberTransform
protected ButtonModelInterface incrModel
protected ButtonModelInterface decrModel
protected ButtonModelInterface trackModel
protected ButtonListenerInterface sliderListener
protected BoundedNumberInterface defaultModel
| Constructor Detail |
|---|
public ScrollSlider()
| Method Detail |
|---|
public static int getDefaultWidth()
public static void setDefaultWidth(int newDefaultWidth)
newDefaultWidth - the new default widthpublic static int getDefaultHeight()
public static void setDefaultHeight(int newDefaultHeight)
newDefaultHeight - the new default heightpublic static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed in interface java.awt.event.ActionListenere - the ActionEvent to handlepublic void addAdjustmentListener(java.awt.event.AdjustmentListener l)
addAdjustmentListener in interface java.awt.Adjustablel - the adjustment listenerAdjustable.addAdjustmentListener(java.awt.event.AdjustmentListener),
AdjustmentEventpublic void setModelInterface(ModelInterface model)
setModelInterface in interface ViewInterfacesetModelInterface in class ComponentVisualComponentmodel - the new model for the ScrollSliderViewInterface.setModelInterface(com.sas.ModelInterface)public void detachModel(ModelInterface model)
detachModel in interface ViewInterfacedetachModel in class ComponentVisualComponentmodel - Model to detachViewInterface.detachModel(com.sas.ModelInterface)public java.awt.Dimension computePreferredSize()
computePreferredSize in interface VisualInterfacecomputePreferredSize in class ComponentVisualComponentVisualInterface.computePreferredSize()public java.awt.Dimension getMinimumSize()
getMinimumSize in interface VisualInterfacegetMinimumSize in class ComponentVisualInterface.getMinimumSize()public final int getBlockIncrement()
getBlockIncrement in interface java.awt.AdjustablesetBlockIncrement(int)public ButtonModelInterface getDecrementModel()
public ButtonModelInterface getIncrementModel()
public final int getMaximum()
getMaximum in interface java.awt.AdjustablesetMaximum(int)public final int getMinimum()
getMinimum in interface java.awt.AdjustablesetMinimum(int)public int getMinimumThumbHeight()
public int getOrientation()
getOrientation in interface java.awt.AdjustableAdjustable,
setOrientation(int)public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces in interface ViewInterfacegetRequiredInterfaces in class ComponentVisualComponentViewInterface.getRequiredInterfaces()public ButtonModelInterface getTrackModel()
public final int getUnitIncrement()
getUnitIncrement in interface java.awt.AdjustablesetUnitIncrement(int)public final int getValue()
getValue in interface java.awt.AdjustablesetValue(int)public java.lang.Number getVisibleAmountNumber()
public int getVisibleAmount()
getVisibleAmount in interface java.awt.Adjustable
public java.lang.Number incrementBy(int increment,
int incrementType)
incrementBy in interface IncrementInterfaceincrement - 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 amountpublic boolean isMaximumReachable()
public void paint(java.awt.Graphics g)
paint in class ComponentVisualComponentg - the Graphics contextVisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)protected void paintBackground(java.awt.Graphics g)
protected void paintIncrementArea(java.awt.Graphics g,
java.awt.Rectangle incrBounds)
g - the Graphics context.incrBounds - the bounds of the increment area.
protected void paintDecrementArea(java.awt.Graphics g,
java.awt.Rectangle decrBounds)
g - the Graphics context.decrBounds - the bounds of the decrement area.
protected void paintThumbArea(java.awt.Graphics g,
java.awt.Rectangle tRect)
g - the Graphics context.tBounds - the bounds of the thumb area.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class ComponentVisualComponentPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)protected void processEvent(java.awt.AWTEvent e)
processEvent in class java.awt.Componentprotected void processAdjustmentEvent(java.awt.event.AdjustmentEvent e)
public void refresh(ModelInterface model)
refresh in interface ViewInterfacerefresh in class ComponentVisualComponentmodel - Model that has just been updatedViewInterface.refresh(com.sas.ModelInterface)public void removeAdjustmentListener(java.awt.event.AdjustmentListener l)
removeAdjustmentListener in interface java.awt.Adjustablel - the adjustment listeneraddAdjustmentListener(java.awt.event.AdjustmentListener),
AdjustmentEvent
public void setBounds(int x,
int y,
int width,
int height)
setBounds in interface VisualInterfacesetBounds in class ComponentVisualComponentVisualInterface.setBounds(int, int, int, int)public final void setBlockIncrement(int block)
setBlockIncrement in interface java.awt.AdjustableblockIncrement - the new value of the blockIncrement property.getBlockIncrement()public void setDefaultValues()
setDefaultValues in interface VisualInterfacesetDefaultValues in interface ComponentInterfacesetDefaultValues in class ComponentComponentInterface.setDefaultValues()public void setEnabled(boolean enabled)
setEnabled in interface VisualInterfacesetEnabled in class ComponentVisualComponentenabled - the enabled state of the ScrollSlider.VisualInterface.setEnabled(boolean)public void setMaximumReachable(boolean reachable)
reachable - set whether the thumb value can reach the maximum.public final void setMaximum(int max)
setMaximum in interface java.awt.Adjustablemax - the new value of the maximum bounds.getMaximum()public final void setMinimum(int min)
setMinimum in interface java.awt.Adjustablemin - the new value of the minimum bounds.getMinimum()public void setMinimumThumbHeight(int minThumb)
minThumb - the minimum pixel height of the thumb area.public boolean isTrackEnabled()
public void setTrackEnabled(boolean te)
public boolean isThumbVisible()
public void setThumbVisible(boolean vis)
vis - true if the thumb is visible, false otherwisepublic com.sas.util.transforms.TransformInterface getRoundNumberTransform()
public void setRoundNumberTransform(com.sas.util.transforms.TransformInterface transform)
transform - the transform used to round the numberValue set when the slider is draggedpublic final void setUnitIncrement(int unit)
setUnitIncrement in interface java.awt.Adjustableunit - the amount the value is incremented/decremented when
the ScrollSlider is triggered.getUnitIncrement()public final void setValue(int newValue)
setValue in interface java.awt.AdjustablenewValue - the new value of the ScrollSlider.getValue()public void setVisibleAmount(int visAmount)
setVisibleAmount in interface java.awt.AdjustablevisAmount - the value of the visible amount of the Scrollbar thumb.public void setVisibleAmountNumber(java.lang.Number visAmount)
visAmount - the value of the visible amount of the Scrollbar thumb.public void setOrientation(int orient)
orient - the value of the orientation property.Adjustablepublic java.lang.Number getUnitIncrementNumber()
getUnitIncrementNumber in interface IncrementInterfacesetUnitIncrementNumber(java.lang.Number)public java.lang.Number getBlockIncrementNumber()
getBlockIncrementNumber in interface IncrementInterfacesetBlockIncrementNumber(java.lang.Number)public java.lang.Number getMaximumNumber()
getMaximumNumber in interface RangeInterfacesetMaximumNumber(java.lang.Number)public java.lang.Number getMinimumNumber()
getMinimumNumber in interface RangeInterfacesetMinimumNumber(java.lang.Number)public java.lang.Number getNumberValue()
setNumberValue(java.lang.Number)public void setMaximumNumber(java.lang.Number max)
setMaximumNumber in interface RangeInterfacemax - the new maximum bounds for the SpinButton value.getMaximumNumber()public void setMinimumNumber(java.lang.Number min)
setMinimumNumber in interface RangeInterfacemin - the new minimum bounds for the SpinButton value.getMinimumNumber()public void setBlockIncrementNumber(java.lang.Number block)
setBlockIncrementNumber in interface IncrementInterfaceblock - the new blockIncrement number.getBlockIncrementNumber()public void setUnitIncrementNumber(java.lang.Number unit)
setUnitIncrementNumber in interface IncrementInterfaceunit - the new blockIncrement number.getUnitIncrementNumber()public void setNumberValue(java.lang.Number newValue)
newValue - the new value.getNumberValue()protected java.awt.Rectangle layoutActionAreas()
protected void checkTrackEnabled(int thumbHeight,
int sizeHeight)
thumbHeight - the height of the thumb areasizeHeight - the height of the ScrollSliderpublic java.awt.Rectangle getIncrementBounds()
getIncrementBounds in interface SliderInterfacepublic java.awt.Rectangle getDecrementBounds()
getDecrementBounds in interface SliderInterfaceprotected java.awt.Rectangle getThumbBounds()
public java.awt.Point getThumbPosition()
getThumbPosition in interface SliderInterfacepublic void setThumbPosition(java.awt.Point pt)
setThumbPosition in interface SliderInterfacept - the new thumb area position
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||