Class symantec.itools.awt.util.spinner.Spinner
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.util.spinner.Spinner

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----symantec.itools.awt.util.spinner.Spinner

public abstract class Spinner
extends Panel
implements Orientation, Serializable
This abstract class is used to create spinners. A spinner is a component with two small direction buttons that lets the user scroll a list of predetermined values to select one, or possibly enter a new legal value.

Version:
1.1, June 2, 1997
Author:
Symantec
See Also:
ListSpinner, NumericSpinner

Variable Index

 o ORIENTATION_DEFAULT
The default spinner orientation.
 o action
An ActionEvent listener that handles typical spinner actions.
 o actionListener
The action listener which will receive action events from this component.
 o added
Tracks whether this component has been added to a container.
 o changes
Tracks listeners for all property change events.
 o current
The current spinner value.
 o currentVeto
A PropertyChangeEvent listener that constrains the "current" property as needed.
 o editable
Whether the Spinner's TextField is editable.
 o errors
Error reporting strings.
 o increment
The amount the spinner's value is changed when scrolling step is taken.
 o max
The maximum value the spinner may have.
 o maxVeto
A PropertyChangeEvent listener that constrains the "max" property as needed.
 o min
The minimum value the spinner may have.
 o minVeto
A PropertyChangeEvent listener that constrains the "min" property as needed.
 o orientation
Reserved.
 o text
Reserved.
 o textWidth
Reserved.
 o vetos
Tracks listeners for all vetoable property change events.
 o wrappable
Whether the value can wrap from max to min, and from min to max.

Constructor Index

 o symantec.itools.awt.util.spinner.Spinner()
Constructs a default spinner.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this component.
 o addCurrentListener(PropertyChangeListener)
Adds a listener for the current property changes.
 o addCurrentListener(VetoableChangeListener)
Adds a vetoable listener for the current property changes.
 o addMaxListener(PropertyChangeListener)
Adds a listener for the max property changes.
 o addMaxListener(VetoableChangeListener)
Adds a vetoable listener for the max property changes.
 o addMinListener(PropertyChangeListener)
Adds a listener for the min property changes.
 o addMinListener(VetoableChangeListener)
Adds a vetoable listener for the min property changes.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all property change events.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener for all vetoable property change events.
 o getCurrent()
Gets the current value of the spinner.
 o getCurrentText()
Gets the currently selected string from the list.
 o getDelay()
Returns the current delay between notification events of the spinner buttons in milliseconds.
 o getEditable()
 o getEntryFieldText()
Returns the text that is in the entry TextField.
 o getMax()
Gets the current maximum value the spinner may have.
 o getMin()
Gets the current minimum value the spinner may have.
 o getMinimumSize()
 o getNotifyWhilePressed()
 o getOrientation()
Gets whether the spinner buttons are laid out one above the other or one beside the other.
 o getPreferredSize()
 o getWrappable()
 o isEditable()
Returns whether the Spinner's TextField is editable.
 o isNotifyWhilePressed()
Gets the current notifyWhilePressed status.
 o isValidCurrentValue(int)
Is the given value valid for the Current property .
 o isValidMaxValue(int)
Is the given value valid for the Max property .
 o isValidMinValue(int)
Is the given value valid for the Min property .
 o isWrappable()
Gets whether the value can wrap from max to min, and from min to max.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this component.
 o removeCurrentListener(PropertyChangeListener)
Removes a listener for the current property changes.
 o removeCurrentListener(VetoableChangeListener)
Removes a vetoable listener for the current property changes.
 o removeMaxListener(PropertyChangeListener)
Removes a listener for the max property changes.
 o removeMaxListener(VetoableChangeListener)
Removes a vetoable listener for the max property changes.
 o removeMinListener(PropertyChangeListener)
Removes a listener for the min property changes.
 o removeMinListener(VetoableChangeListener)
Removes a vetoable listener for the min property changes.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all property change events.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener for all vetoable property change events.
 o scrollDown()
Decrements the spinner's value and handles wrapping as needed.
 o scrollUp()
Increments the spinner's value and handles wrapping as needed.
 o setCurrent(int)
Sets the value of the spinner.
 o setDelay(int)
Sets the notification event delay of the spinner buttons in milliseconds.
 o setEditable(boolean)
Conditionally enables editing of the Spinner's TextField.
 o setEnabled(boolean)
 o setLayout(LayoutManager)
Takes no action.
 o setMax(int)
Sets the maximum value the spinner may have.
 o setMin(int)
Sets the minimum value the spinner may have.
 o setNotifyWhilePressed(boolean)
Sets whether the spinner buttons will continually post notify events while pressed.
 o setOrientation(int)
Sets whether the spinner buttons are laid out one above the other or one beside the other.
 o setWrappable(boolean)
Sets whether the value can wrap from max to min, and from min to max.
 o sourceActionEvent(String)
Fire an action event to the listeners
 o updateButtonStatus()
Handles enabling or disabling the spinner buttons as needed.
 o updateText(boolean)
Updates the text field with the current text, as needed or depending on the force flag.
 o validateText()
returns boolean if text in field is a valid entry

Variables

 o ORIENTATION_DEFAULT
protected static int ORIENTATION_DEFAULT
The default spinner orientation.

 o action
protected symantec.itools.awt.util.spinner.Spinner. Action action
An ActionEvent listener that handles typical spinner actions.

 o actionListener
protected java.awt.event.ActionListener actionListener
The action listener which will receive action events from this component.

See Also:
addActionListener, removeActionListener
 o added
protected boolean added
Tracks whether this component has been added to a container.

 o changes
protected symantec.itools.beans.PropertyChangeSupport changes
Tracks listeners for all property change events.

See Also:
addPropertyChangeListener, removePropertyChangeListener
 o current
protected int current
The current spinner value.

See Also:
getCurrent, setCurrent
 o currentVeto
protected symantec.itools.awt.util.spinner.Spinner. CurrentVeto currentVeto
A PropertyChangeEvent listener that constrains the "current" property as needed.

See Also:
current, maxVeto, minVeto
 o editable
protected boolean editable
Whether the Spinner's TextField is editable.

See Also:
isEditable, setEditable
 o errors
protected java.util.ResourceBundle errors
Error reporting strings.

 o increment
protected int increment
The amount the spinner's value is changed when scrolling step is taken.

See Also:
scrollUp, scrollDown
 o max
protected int max
The maximum value the spinner may have.

See Also:
getMax, setMax
 o maxVeto
protected symantec.itools.awt.util.spinner.Spinner. MaxVeto maxVeto
A PropertyChangeEvent listener that constrains the "max" property as needed.

See Also:
max, currentVeto, minVeto
 o min
protected int min
The minimum value the spinner may have.

See Also:
getMin, setMin
 o minVeto
protected symantec.itools.awt.util.spinner.Spinner. MinVeto minVeto
A PropertyChangeEvent listener that constrains the "min" property as needed.

See Also:
min, currentVeto, maxVeto
 o orientation
protected int orientation
Reserved.

See Also:
getOrientation, setOrientation
 o text
protected java.lang.String text
Reserved.

 o textWidth
protected int textWidth
Reserved.

 o vetos
protected symantec.itools.beans.VetoableChangeSupport vetos
Tracks listeners for all vetoable property change events.

See Also:
addVetoableChangeListener, removeVetoableChangeListener
 o wrappable
protected boolean wrappable
Whether the value can wrap from max to min, and from min to max.

See Also:
isWrappable, setWrappable

Constructors

 o Spinner
public Spinner()
Constructs a default spinner. The current value is 0, the minimum value is 0, the maximum value is 1, the increment is 1, it is not wrappable, and has a vertical orientation.

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this component.

Parameters:
l - the action listener
See Also:
removeActionListener
 o addCurrentListener
public synchronized void addCurrentListener(PropertyChangeListener listener)
Adds a listener for the current property changes.

Parameters:
listener - the listener to add.
See Also:
removeCurrentListener(java.beans.PropertyChangeListener)
 o addCurrentListener
public synchronized void addCurrentListener(VetoableChangeListener listener)
Adds a vetoable listener for the current property changes.

Parameters:
listener - the listener to add.
See Also:
removeCurrentListener(java.beans.VetoableChangeListener)
 o addMaxListener
public synchronized void addMaxListener(PropertyChangeListener listener)
Adds a listener for the max property changes.

Parameters:
listener - the listener to add.
See Also:
removeMaxListener(java.beans.PropertyChangeListener)
 o addMaxListener
public synchronized void addMaxListener(VetoableChangeListener listener)
Adds a vetoable listener for the max property changes.

Parameters:
listener - the listener to add.
See Also:
removeMaxListener(java.beans.VetoableChangeListener)
 o addMinListener
public synchronized void addMinListener(PropertyChangeListener listener)
Adds a listener for the min property changes.

Parameters:
listener - the listener to add.
See Also:
removeMinListener(java.beans.PropertyChangeListener)
 o addMinListener
public synchronized void addMinListener(VetoableChangeListener listener)
Adds a vetoable listener for the min property changes.

Parameters:
listener - the listener to add.
See Also:
removeMinListener(java.beans.VetoableChangeListener)
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to hook-up event listeners. It is also used to setup the component, creating the TextField as needed.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events.

Parameters:
listener - the listener to add
See Also:
removeVetoableChangeListener
 o getCurrent
public int getCurrent()
Gets the current value of the spinner.

Returns:
the current spinner value
See Also:
setCurrent
 o getCurrentText
protected abstract java.lang.String getCurrentText()
Gets the currently selected string from the list.

Returns:
the string currently visible in the Spinner
See Also:
updateText(boolean)
 o getDelay
public int getDelay()
Returns the current delay between notification events of the spinner buttons in milliseconds.

See Also:
setNotifyWhilePressed, setDelay
 o getEditable
public boolean getEditable()
Note: getEditable() is deprecated.

See Also:
isEditable
 o getEntryFieldText
public java.lang.String getEntryFieldText()
Returns the text that is in the entry TextField.

 o getMax
public int getMax()
Gets the current maximum value the spinner may have.

Returns:
the current maximum value
See Also:
setMax
 o getMin
public int getMin()
Gets the current minimum value the spinner may have.

Returns:
the current minimum value
See Also:
setMin
 o getMinimumSize
public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class Container
 o getNotifyWhilePressed
public boolean getNotifyWhilePressed()
Note: getNotifyWhilePressed() is deprecated.

See Also:
isNotifyWhilePressed
 o getOrientation
public int getOrientation()
Gets whether the spinner buttons are laid out one above the other or one beside the other.

Returns:
the orientation, one of: ORIENTATION_VERTICAL, or ORIENTATION_HORIZONTAL
See Also:
setOrientation, ORIENTATION_VERTICAL, ORIENTATION_HORIZONTAL
 o getPreferredSize
public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class Container
 o getWrappable
public boolean getWrappable()
Note: getWrappable() is deprecated.

See Also:
isWrappable
 o isEditable
public boolean isEditable()
Returns whether the Spinner's TextField is editable.

Returns:
true if the TextField can be edited, false otherwise
See Also:
setEditable
 o isNotifyWhilePressed
public boolean isNotifyWhilePressed()
Gets the current notifyWhilePressed status.

Returns:
true if notify events posted while pressed, false otherwise
See Also:
setNotifyWhilePressed, setDelay, getDelay
 o isValidCurrentValue
protected boolean isValidCurrentValue(int i)
Is the given value valid for the Current property .

Parameters:
i - the given value
Returns:
true if the given value is acceptable, false if not.
 o isValidMaxValue
protected boolean isValidMaxValue(int i)
Is the given value valid for the Max property .

Parameters:
i - the given value
Returns:
true if the given value is acceptable, false if not.
 o isValidMinValue
protected boolean isValidMinValue(int i)
Is the given value valid for the Min property .

Parameters:
i - the given value
Returns:
true if the given value is acceptable, false if not.
 o isWrappable
public boolean isWrappable()
Gets whether the value can wrap from max to min, and from min to max.

Returns:
true if the value is allowed to wrap
See Also:
setWrappable
 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this component.

Parameters:
l - the action listener
See Also:
addActionListener
 o removeCurrentListener
public synchronized void removeCurrentListener(PropertyChangeListener listener)
Removes a listener for the current property changes.

Parameters:
listener - the listener to remove.
See Also:
addCurrentListener(java.beans.PropertyChangeListener)
 o removeCurrentListener
public synchronized void removeCurrentListener(VetoableChangeListener listener)
Removes a vetoable listener for the current property changes.

Parameters:
listener - the listener to remove.
See Also:
addCurrentListener(java.beans.VetoableChangeListener)
 o removeMaxListener
public synchronized void removeMaxListener(PropertyChangeListener listener)
Removes a listener for the max property changes.

Parameters:
listener - the listener to remove.
See Also:
addMaxListener(java.beans.PropertyChangeListener)
 o removeMaxListener
public synchronized void removeMaxListener(VetoableChangeListener listener)
Removes a vetoable listener for the max property changes.

Parameters:
listener - the listener to remove.
See Also:
addMaxListener(java.beans.VetoableChangeListener)
 o removeMinListener
public synchronized void removeMinListener(PropertyChangeListener listener)
Removes a listener for the min property changes.

Parameters:
listener - the listener to remove.
See Also:
addMinListener(java.beans.PropertyChangeListener)
 o removeMinListener
public synchronized void removeMinListener(VetoableChangeListener listener)
Removes a vetoable listener for the min property changes.

Parameters:
listener - the listener to remove.
See Also:
addMinListener(java.beans.VetoableChangeListener)
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to unhook event listeners.

Overrides:
removeNotify in class Container
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events.

Parameters:
listener - the listener to remove
See Also:
addVetoableChangeListener
 o scrollDown
protected void scrollDown()
Decrements the spinner's value and handles wrapping as needed.

See Also:
scrollUp, increment
 o scrollUp
protected void scrollUp()
Increments the spinner's value and handles wrapping as needed.

See Also:
scrollDown, increment
 o setCurrent
public void setCurrent(int i) throws PropertyVetoException
Sets the value of the spinner.

Parameters:
i - the new value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getCurrent
 o setDelay
public void setDelay(int d) throws PropertyVetoException
Sets the notification event delay of the spinner buttons in milliseconds.

Parameters:
d - the delay between notification events in milliseconds
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setNotifyWhilePressed, getDelay
 o setEditable
public void setEditable(boolean f) throws PropertyVetoException
Conditionally enables editing of the Spinner's TextField.

Parameters:
f - true = allow editing; false = disallow editing
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setEnabled
public void setEnabled(boolean f)
Overrides:
setEnabled in class Component
 o setLayout
public void setLayout(LayoutManager lm)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
lm - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o setMax
public void setMax(int i) throws PropertyVetoException
Sets the maximum value the spinner may have.

Parameters:
i - the new maximum value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getMax
 o setMin
public void setMin(int i) throws PropertyVetoException
Sets the minimum value the spinner may have.

Parameters:
i - the new minimum value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getMin
 o setNotifyWhilePressed
public void setNotifyWhilePressed(boolean f) throws PropertyVetoException
Sets whether the spinner buttons will continually post notify events while pressed.

Parameters:
f - true = send messages; false = do not send messages
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isNotifyWhilePressed, setDelay, getDelay
 o setOrientation
public void setOrientation(int o) throws PropertyVetoException
Sets whether the spinner buttons are laid out one above the other or one beside the other.

Parameters:
o - the new orientation, one of: ORIENTATION_VERTICAL, or ORIENTATION_HORIZONTAL
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getOrientation, ORIENTATION_VERTICAL, ORIENTATION_HORIZONTAL
 o setWrappable
public void setWrappable(boolean f) throws PropertyVetoException
Sets whether the value can wrap from max to min, and from min to max.

Parameters:
f - true to allow the value to wrap
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isWrappable
 o sourceActionEvent
protected void sourceActionEvent(String s)
Fire an action event to the listeners

 o updateButtonStatus
protected void updateButtonStatus()
Handles enabling or disabling the spinner buttons as needed.

 o updateText
protected void updateText(boolean force)
Updates the text field with the current text, as needed or depending on the force flag.

Parameters:
force - If true, causes the text field to update even if the value has not changed.
See Also:
getCurrentText
 o validateText
protected boolean validateText()
returns boolean if text in field is a valid entry

Returns:
true if text is valid

All Packages  Class Hierarchy  This Package  Previous  Next  Index