|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.visuals.SpinBox
public class SpinBox
SpinBox is a class that combines a textField and a spinButton.
The value in the textField can be incremented by pressing the spinButton.
The SpinBox supports two types of models: an StaticOrderedCollectionInterface model or a
BoundedNumberInterface model. The collection model displays one item from the collection
in the textField and allows stepping throught the collection by using the spinButton.
The boundedNumber model displays the value of the boundedNumber in the textField and allows
it to be incremented or decremented by the spinButton. An AdjustmentEvent is fired any time
the value of the SpinBox changes. An ItemEvent is also fired when the model is a collection
and the value changes. The defaultModel for the SpinBox is a BoundedDouble.
Notes:
StaticOrderedCollectionInterface,
BoundedNumberInterface,
TextField,
SpinButton,
Serialized Form| Field Summary | |
|---|---|
protected java.awt.event.AdjustmentListener |
adjustmentListener
|
protected com.sas.visuals.SpinBox.ArrowKeyAdapter |
arrowKeyAdapter
|
protected com.sas.models.BoundedNumberInterface |
defaultRangeModel
|
protected com.sas.util.transforms.TransformInterface |
displayTransform
|
protected java.awt.event.ItemListener |
itemListener
|
protected com.sas.visuals.SpinBox.ItemTextAdapter |
itemTextAdapter
|
static int |
LEFT_RIGHT
int values representing the orientation of the spinButton arrows- LEFT_RIGHT |
protected java.text.NumberFormat |
numberFormat
|
protected boolean |
numberFormatSet
|
protected double |
precision
|
protected boolean |
precisionDisplayed
|
protected PrefixPredicate |
prefixPredicate
|
static java.lang.String |
RB_KEY
|
protected SpinButton |
spinBtn
|
protected TextField |
text
|
protected boolean |
textInvoked
|
static int |
UP_DOWN
int values representing the orientation of the spinButton arrows- UP_DOWN |
protected boolean |
valueInvoked
|
| Constructor Summary | |
|---|---|
SpinBox()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addAdjustmentListener(java.awt.event.AdjustmentListener l)
Add a listener to receive adjustment events when the value of the SpinBox changes. |
void |
addItemListener(java.awt.event.ItemListener l)
Add a listener to receive item events when the state of the SpinBox changes. |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Handle all adjustment events that are sent out by spinButton. |
void |
contentsChanged(com.sas.collection.ContentsChangedEvent e)
Handle contentsChanged events from a collection model. |
void |
detachModel(com.sas.ModelInterface model)
Detach the specified model from the SpinBox. |
Alarm |
getAlarm()
Deprecated. |
int |
getArrowDirection()
Get the direction the SpinButton arrows are pointing. |
int |
getBlockIncrement()
Get the block value increment for the spinButton. |
java.lang.Number |
getBlockIncrementNumber()
Get the blockIncrement number value for the spinButton. |
int |
getColumns()
Get the number of columns of the textField. |
static int |
getDefaultHeight()
|
static int |
getDefaultWidth()
|
long |
getDelay()
Get the delay before the spinButton begins automatically incrementing its value. |
com.sas.util.transforms.TransformInterface |
getDisplayTransform()
Get the displayTransform used to transform the objects in the model before they are displayed. |
double |
getDoubleData()
Get the double data value of the SpinBox. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
int |
getMaximum()
Get the maximum integer value of the SpinBox. |
java.lang.Number |
getMaximumNumber()
Get the maximum number value for the SpinBox. |
int |
getMinimum()
Get the minimum integer value of the SpinBox. |
java.lang.Number |
getMinimumNumber()
Get the minimum number value for the SpinBox. |
java.text.NumberFormat |
getNumberFormat()
Get the NumberFormat applied to the value set as the text in the textField. |
java.lang.Number |
getNumberValue()
Get the number value of the SpinBox. |
int |
getOrientation()
Get the orientation of the spinButton. |
double |
getPrecision()
Get the precision of the value displayed in the textField. |
java.util.Vector |
getRequiredInterfaces()
Returns the required interfaces Vector for this component. |
java.lang.Object[] |
getSelectedObjects()
Get the selected object when the model is a collection. |
long |
getStartInterval()
Get the start interval for the spinButton alarm to increment the value. |
java.lang.String |
getText()
Get the text displayed in the textField. |
int |
getUnitIncrement()
Get the integer unitIncrement of the spinButton. |
java.lang.Number |
getUnitIncrementNumber()
Get the unitIncrement number value for the spinButton. |
int |
getValue()
Get the integer value of the SpinBox. |
int |
getVisibleAmount()
Not used. |
boolean |
isCycleOn()
Get if the spinButton is set to cycle through its values. |
boolean |
isPrecisionDisplayed()
Get if the text in the textField is displayed correctly. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle property change events on complex properties. |
void |
refresh(com.sas.ModelInterface model)
Refresh the SpinBox with the specified model. |
void |
removeAdjustmentListener(java.awt.event.AdjustmentListener l)
Remove the adjustment listener. |
void |
removeItemListener(java.awt.event.ItemListener l)
Remove the item listener. |
void |
setAlarm(Alarm alarm)
Deprecated. |
void |
setArrowDirection(int d)
Sets the direction the SpinButton arrows are pointing. |
void |
setBlockIncrement(int block)
Set the blockIncrement on the spinButton. |
void |
setBlockIncrementNumber(java.lang.Number block)
Set the blockIncrement number value for the spinButton. |
void |
setColumns(int cols)
Set the number of text columns on the textField. |
void |
setCycleOn(boolean cycle)
Set the spinButton to cycle through its values. |
static void |
setDefaultHeight(int newHeight)
|
void |
setDefaultValues()
Set the default internal values for the BaseButton. |
static void |
setDefaultWidth(int newWidth)
|
void |
setDelay(long delay)
Set the delay before the spinButton begins automatically incrementing its value. |
void |
setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
Set the displayTransform used to transform the items in the model when the model of the SpinBox is a StaticOrderedCollectionInterface object. |
void |
setDoubleData(double d)
Set the double value of the SpinBox. |
void |
setEnabled(boolean e)
Set the SpinBox enabled. |
void |
setErrorHandler(ErrorHandlerInterface errorHandler)
Set the errorHandler for the validator of the text in the textField of the SpinBox. |
void |
setForeground(java.awt.Color color)
Overrides setForeground in java.awt.Component. |
void |
setMaximum(int max)
Set the integer maximum value for the SpinBox. |
void |
setMaximumNumber(java.lang.Number max)
Set the maximum number value for the SpinBox. |
void |
setMinimum(int min)
Set the integer minimum value for the SpinBox. |
void |
setMinimumNumber(java.lang.Number min)
Set the minimum number value for the SpinBox. |
void |
setNumberFormat(java.text.NumberFormat nf)
Set the NumberFormat applied to the value set as the text in the textField. |
void |
setNumberValue(java.lang.Number value)
Set the number value for the SpinBox. |
void |
setOrientation(int orient)
Set the orientation of the spinButton. |
void |
setPrecision(double p)
Deprecated. |
void |
setPrecisionDisplayed(boolean b)
Deprecated. |
void |
setStartInterval(long startInterval)
Set the start interval for the spinButton alarm to increment the value. |
void |
setText(java.lang.String txt)
Set the text of the SpinBox. |
void |
setUnitIncrement(int unit)
Set the integer value of the unitIncrement. |
void |
setUnitIncrementNumber(java.lang.Number unit)
Set the unitIncrement number value for the SpinBox. |
void |
setValidator(ValidationInterface validator)
Set the validator for the text in the textField of the SpinBox. |
void |
setValue(int val)
Set the integer value of the SpinBox. |
void |
setVisibleAmount(int amt)
Not used. |
protected void |
updateText(java.lang.Number newValue)
Invoked when the text needs to be updated from a change in the value. |
protected void |
updateValue(java.lang.String txt)
Invoked when the value needs to be updated from a change in the text. |
| Methods inherited from interface com.sas.awt.ContainerInterface |
|---|
getComponents, getLayout, invalidate, setLayout, validate |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
protected SpinButton spinBtn
protected TextField text
protected double precision
protected java.text.NumberFormat numberFormat
protected boolean numberFormatSet
protected com.sas.models.BoundedNumberInterface defaultRangeModel
protected boolean precisionDisplayed
protected transient boolean textInvoked
protected transient boolean valueInvoked
protected transient PrefixPredicate prefixPredicate
protected transient com.sas.visuals.SpinBox.ArrowKeyAdapter arrowKeyAdapter
protected transient com.sas.visuals.SpinBox.ItemTextAdapter itemTextAdapter
protected transient java.awt.event.AdjustmentListener adjustmentListener
protected transient java.awt.event.ItemListener itemListener
protected com.sas.util.transforms.TransformInterface displayTransform
public static final int UP_DOWN
public static final int LEFT_RIGHT
| Constructor Detail |
|---|
public SpinBox()
| Method Detail |
|---|
public static int getDefaultHeight()
public static int getDefaultWidth()
public static void setDefaultHeight(int newHeight)
public static void setDefaultWidth(int newWidth)
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void addAdjustmentListener(java.awt.event.AdjustmentListener l)
addAdjustmentListener in interface java.awt.AdjustableAdjustable.addAdjustmentListener(java.awt.event.AdjustmentListener)public void addItemListener(java.awt.event.ItemListener l)
addItemListener in interface java.awt.ItemSelectableItemSelectable.addItemListener(java.awt.event.ItemListener)public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerpublic void contentsChanged(com.sas.collection.ContentsChangedEvent e)
contentsChanged in interface com.sas.collection.ContentsChangedListenerpublic void detachModel(com.sas.ModelInterface model)
detachModel in interface com.sas.ViewInterfacedetachModel in class ContainerVisualComponentmodel - Model to detachViewInterface.detachModel(com.sas.ModelInterface)public Alarm getAlarm()
SpinButton.getAlarm(),
setAlarm(com.sas.util.Alarm)public int getArrowDirection()
setArrowDirection(int)public long getDelay()
getStartInterval(),
setDelay(long)public long getStartInterval()
getDelay(),
setStartInterval(long)public int getBlockIncrement()
getBlockIncrement in interface java.awt.AdjustableAdjustable,
SpinButton,
getBlockIncrementNumber(),
setBlockIncrement(int)public int getColumns()
setColumns(int)public com.sas.util.transforms.TransformInterface getDisplayTransform()
public final double getDoubleData()
getNumberValue() method.
getDoubleData in interface com.sas.lang.DoubleDataInterfacesetDoubleData(double),
getNumberValue(),
DoubleDataInterfacepublic int getMaximum()
getMaximum in interface java.awt.AdjustableAdjustable,
getMaximumNumber(),
setMaximum(int)public int getMinimum()
getMinimum in interface java.awt.AdjustableAdjustable,
getMinimumNumber(),
setMinimum(int)public java.lang.Number getBlockIncrementNumber()
Adjustable,
SpinButton,
setBlockIncrement(int)public java.lang.Number getMaximumNumber()
BoundedNumberInterface,
setMaximumNumber(java.lang.Number)public java.lang.Number getMinimumNumber()
BoundedNumberInterface,
setMinimumNumber(java.lang.Number)public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces in interface com.sas.ViewInterfacegetRequiredInterfaces in class ContainerVisualComponentViewInterface.getRequiredInterfaces()public java.lang.Number getUnitIncrementNumber()
Adjustable,
SpinButton,
setBlockIncrement(int)public java.lang.Number getNumberValue()
setNumberValue(java.lang.Number)public java.text.NumberFormat getNumberFormat()
NumberFormatpublic int getOrientation()
getOrientation in interface java.awt.AdjustableAdjustable,
SpinButton,
setOrientation(int)public double getPrecision()
setPrecision(double)public java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectableItemSelectablepublic java.lang.String getText()
getText in interface com.sas.lang.StringDataInterfaceStringDataInterface,
setText(java.lang.String)public int getUnitIncrement()
getUnitIncrement in interface java.awt.AdjustablesetUnitIncrement(int)public int getValue()
getValue in interface java.awt.AdjustableAdjustable,
SpinButton,
setValue(int)public int getVisibleAmount()
getVisibleAmount in interface java.awt.AdjustableAdjustable,
setVisibleAmount(int)public boolean isCycleOn()
setCycleOn(boolean)public boolean isPrecisionDisplayed()
setPrecisionDisplayed(boolean)public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class ContainerVisualComponentPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)public void refresh(com.sas.ModelInterface model)
refresh in interface com.sas.ViewInterfacerefresh in class ContainerVisualComponentmodel - the model to refresh the SpinBox with.ViewInterface.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),
AdjustmentEventpublic void removeItemListener(java.awt.event.ItemListener l)
removeItemListener in interface java.awt.ItemSelectablel - the item listeneraddItemListener(java.awt.event.ItemListener),
ItemEventpublic void setAlarm(Alarm alarm)
alarm - the spinButton alarmSpinButton.setAlarm(com.sas.util.Alarm)public void setArrowDirection(int d)
d - the UP_DOWN or the LEFT_RIGHT values.getArrowDirection()public void setBlockIncrement(int block)
setBlockIncrement in interface java.awt.AdjustableAdjustable,
SpinButton,
getBlockIncrement()public void setColumns(int cols)
cols - the number of columns of textpublic void setCycleOn(boolean cycle)
cycle - true if the values will be cycled through; false otherwise.isCycleOn()public void setDefaultValues()
setDefaultValues in interface ContainerInterfacesetDefaultValues in interface VisualInterfacesetDefaultValues in interface com.sas.ComponentInterfacesetDefaultValues in class CompositeContainerContainerInterface.setDefaultValues()public void setForeground(java.awt.Color color)
setForeground in class java.awt.Componentcolor - the new color for the foregroundpublic void setDelay(long delay)
delay - the delay before the spinButton begins incrementing its value.getDelay()public void setStartInterval(long startInterval)
startInterval - the start interval between spinButton value increments.getStartInterval()public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
transform - the displayTransformpublic final void setDoubleData(double d)
setNumberValue(Number) method.
setDoubleData in interface com.sas.lang.DoubleDataInterfaced - new double valuegetDoubleData(),
setNumberValue(java.lang.Number),
DoubleDataInterfacepublic void setEnabled(boolean e)
setEnabled in interface VisualInterfacesetEnabled in class ContainerVisualComponente - true to enable the SpinBox; false to disable itVisualInterface.setEnabled(boolean)public void setMaximum(int max)
setMaximum in interface java.awt.Adjustablemax - the integer maximum valuegetMaximum()public void setMinimum(int min)
setMinimum in interface java.awt.Adjustablemin - the integer minimum valuegetMinimum()public void setBlockIncrementNumber(java.lang.Number block)
Adjustable,
SpinButton,
setBlockIncrement(int)public void setMaximumNumber(java.lang.Number max)
max - the maximum number value for the SpinBoxBoundedNumberInterface,
getMaximumNumber()public void setMinimumNumber(java.lang.Number min)
min - the minimum number value for the SpinBoxBoundedNumberInterface,
getMinimumNumber()public void setUnitIncrementNumber(java.lang.Number unit)
unit - the unitIncrement number value for the SpinBoxBoundedNumberInterface,
getUnitIncrementNumber()public void setNumberValue(java.lang.Number value)
value - the number value for the SpinBoxBoundedNumberInterface,
getNumberValue()public void setNumberFormat(java.text.NumberFormat nf)
nf - the NumberFormat object used to format the value set as the text in the textFieldNumberFormatpublic void setOrientation(int orient)
orient - an orientation value from java.awt.AdjustableAdjustable,
getOrientation()public void setPrecision(double p)
p - the precisiongetPrecision()public void setPrecisionDisplayed(boolean b)
b - true the precision value is used to display the SpinBox value; false
the entire value is displayed.isPrecisionDisplayed()public void setText(java.lang.String txt)
setText in interface com.sas.lang.StringDataInterfacetxt - the new text of the SpinBoxgetText()public void setUnitIncrement(int unit)
setUnitIncrement in interface java.awt.Adjustableunit - the new unitIncrement.Adjustable,
getUnitIncrement()public void setValue(int val)
setValue in interface java.awt.Adjustableval - the new integer valueAdjustable,
getValue()public void setValidator(ValidationInterface validator)
setValidator in interface ValidatorInterfacesetValidator in class ContainerContainerComponentpublic void setErrorHandler(ErrorHandlerInterface errorHandler)
setErrorHandler in interface ValidatorInterfacesetErrorHandler in class ContainerContainerComponentpublic void setVisibleAmount(int amt)
setVisibleAmount in interface java.awt.AdjustableAdjustableprotected void updateText(java.lang.Number newValue)
protected void updateValue(java.lang.String txt)
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||