All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.Spinner
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----symantec.itools.awt.Spinner
- public class Spinner
- extends Panel
- implements Orientation
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.
- See Also:
- ListSpinner, NumericSpinner
-
current
- The current selection value.
-
increment
- Amount the current value changes when scrolling up or down.
-
max
- The maximum possible value.
-
min
- The minimum possible value.
-
ORIENTATION_DEFAULT
- The default orientation of the spinner buttons (vertical).
-
text
- The text of the current selection.
-
textField
- The optional text field for this spinner.
-
textWidth
- The width of the optional text field for this spinner, in columns.
-
Spinner()
- Construct an empty Spinner.
-
addNotify()
- Tells this component that it has been added to a container.
-
getCurrent()
- Gets the current value of the spinner.
-
getCurrentText()
- Gets the currently selected string from the list.
-
getDelay()
- Returns the current delay between notification events of the spinner
buttons in milliseconds.
-
getEditable()
- Returns whether the Spinner's TextField is editable.
-
getMax()
- Gets the current maximum value the spinner may have.
-
getMin()
- Gets the current minimum value the spinner may have.
-
getNotifyWhilePressed()
- Gets the current notifyWhilePressed status.
-
getOrientation()
- Gets the current orientation of the spin buttons.
-
getWrappable()
- Gets whether the current value can wrap around from maximum
to minimum and from minimum to maximum.
-
handleEvent(Event)
- Processes events for this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
scrollDown()
- Decrements the spinner's value and handles wrapping as needed.
-
scrollUp()
- Increments the spinner's value and handles wrapping as needed.
-
setCurrent(int)
- Sets the value of the spinner.
-
setDelay(int)
- Sets the notification event delay of the spinner buttons in milliseconds.
-
setEditable(boolean)
- Conditionally enables editing of the Spinner's TextField.
-
setLayout(LayoutManager)
- Takes no action.
-
setMax(int)
- Sets the maximum value the spinner may have.
-
setMin(int)
- Sets the minimum value the spinner may have.
-
setNotifyWhilePressed(boolean)
- Sets whether the spinner buttons will continually post notify events
while pressed.
-
setOrientation(int)
- Sets the orientation of the spin buttons.
-
setWrappable(boolean)
- Conditionally sets whether the current value wraps around from maximum
to minimum and from minimum to maximum.
-
updateText()
- Updates the text field with the current text, as needed.
ORIENTATION_DEFAULT
public final int ORIENTATION_DEFAULT
- The default orientation of the spinner buttons (vertical).
min
protected int min
- The minimum possible value.
max
protected int max
- The maximum possible value.
current
protected int current
- The current selection value. min <= current <= max.
- See Also:
- min, max
text
protected String text
- The text of the current selection.
textWidth
protected int textWidth
- The width of the optional text field for this spinner, in columns.
textField
protected TextField textField
- The optional text field for this spinner.
increment
protected int increment
- Amount the current value changes when scrolling up or down.
Spinner
protected Spinner()
- Construct an empty Spinner. It has the default orientation, an increment
of 1, no text field, and minimum, maximum, and current values of 0.
setEditable
public void setEditable(boolean f)
- Conditionally enables editing of the Spinner's TextField.
- Parameters:
- f - true = allow editing;
false = disallow editing
getEditable
public boolean getEditable()
- Returns whether the Spinner's TextField is editable.
- Returns:
- true if the TextField can be edited, false otherwise
setWrappable
public void setWrappable(boolean f)
- Conditionally sets whether the current value wraps around from maximum
to minimum and from minimum to maximum.
- Parameters:
- f - if true the value can wrap
- See Also:
- getWrappable
getWrappable
public boolean getWrappable()
- Gets whether the current value can wrap around from maximum
to minimum and from minimum to maximum.
- Returns:
- true if the value can wrap
- See Also:
- setWrappable
setMin
public void setMin(int i)
- Sets the minimum value the spinner may have.
- Parameters:
- i - the new minimum value
- See Also:
- getMin
getMin
public int getMin()
- Gets the current minimum value the spinner may have.
- Returns:
- the current minimum value
- See Also:
- setMin
setMax
public void setMax(int i)
- Sets the maximum value the spinner may have.
- Parameters:
- i - the new maximum value
- See Also:
- getMax
getMax
public int getMax()
- Gets the current maximum value the spinner may have.
- Returns:
- the current maximum value
- See Also:
- setMax
setCurrent
public void setCurrent(int i)
- Sets the value of the spinner.
- Parameters:
- i - the new value
- See Also:
- getCurrent
getCurrent
public int getCurrent()
- Gets the current value of the spinner.
- Returns:
- the current spinner value
- See Also:
- setCurrent
setOrientation
public void setOrientation(int o)
- Sets the orientation of the spin buttons.
- Parameters:
- o - the new orientation: ORIENTATION_VERTICAL, ORIENTATION_HORIZONTAL,
or ORIENTATION_DEFAULT
- See Also:
- getOrientation, ORIENTATION_VERTICAL, ORIENTATION_VERTICAL, ORIENTATION_DEFAULT
getOrientation
public int getOrientation()
- Gets the current orientation of the spin buttons.
- Returns:
- the current orientation, ORIENTATION_VERTICAL or ORIENTATION_HORIZONTAL
- See Also:
- setOrientation, ORIENTATION_VERTICAL, ORIENTATION_VERTICAL
setNotifyWhilePressed
public void setNotifyWhilePressed(boolean f)
- Sets whether the spinner buttons will continually post notify events
while pressed.
- Parameters:
- f - true = post notify events; false = do not post events
- See Also:
- getNotifyWhilePressed, setDelay, getDelay
getNotifyWhilePressed
public boolean getNotifyWhilePressed()
- Gets the current notifyWhilePressed status.
- Returns:
- true if notify events posted while pressed, false otherwise
- See Also:
- setNotifyWhilePressed, setDelay, getDelay
setDelay
public void setDelay(int d)
- Sets the notification event delay of the spinner buttons in milliseconds.
- Parameters:
- d - the delay between notification events in milliseconds
- See Also:
- setNotifyWhilePressed, getDelay
getDelay
public int getDelay()
- Returns the current delay between notification events of the spinner
buttons in milliseconds.
- See Also:
- setNotifyWhilePressed, setDelay
handleEvent
public boolean handleEvent(Event e)
- Processes events for this component.
This is a standard Java AWT method which gets called by the AWT
to handle this component's events. The default handler for
components dispatches to one of the following methods as needed:
action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(),
mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().
- Parameters:
- e - the event to handle
- Returns:
- true if the event was handled and no further action is needed,
false to pass the event to this component's parent
- Overrides:
- handleEvent in class Component
- See Also:
- action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
addNotify
public 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.
Here it's used to setup the component, creating the TextField as needed.
- Overrides:
- addNotify in class Panel
- See Also:
- removeNotify
paint
public void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its <0,0>
coordinate is this component's top-left corner.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Container
- See Also:
- repaint, update
scrollUp
protected void scrollUp()
- Increments the spinner's value and handles wrapping as needed.
- See Also:
- scrollDown, increment
scrollDown
protected void scrollDown()
- Decrements the spinner's value and handles wrapping as needed.
- See Also:
- scrollUp, increment
updateText
protected void updateText()
- Updates the text field with the current text, as needed.
- See Also:
- getCurrentText
getCurrentText
protected abstract String getCurrentText()
- Gets the currently selected string from the list.
- Returns:
- the string currently visible in the Spinner
- See Also:
- updateText
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:
- l - the layout manager to use to layout this container's components
(IGNORED)
- Overrides:
- setLayout in class Container
- See Also:
- getLayout
All Packages Class Hierarchy This Package Previous Next Index