All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class net.e2technologies.util.ETextSpinner

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JPanel
                                   |
                                   +----net.e2technologies.util.ESpinner
                                           |
                                           +----net.e2technologies.util.ETextSpinner

public class ETextSpinner
extends ESpinner
ETestSpinner is a class that extends ESpinner by displaying and manipulating text values within its component. This class is highly customizable and can be extended for even more functionality if desired. Common to all spinners, ENumberiSpinner can take a value and then increment or decrement by a pre-determined value by pressing the up/down buttons or the Up/Down arrow keys. ActionListeners can also be registered to be notified of this component's events (such as change in value). This class functions by manipulating an array of Strings. The array can by of any length and manipulated according to the index of the array. Check ESpinner for more functionality of this class (such as roll over).

See Also:
ESpinner

Constructor Index

 o ETextSpinner(String[])
Default contructor for ETextSpinner.
 o ETextSpinner(String[], boolean)
Constructor for ETextSpinner.
 o ETextSpinner(String[], int, boolean)
Constructor for ETextSpinner.
 o ETextSpinner(String[], int, boolean, boolean)
Contructor for ETextSpinner.
 o ETextSpinner(String[], int, boolean, int)
Contructor for ETextSpinner.
 o ETextSpinner(String[], int, boolean, int, boolean)
Constructor for ETextSpinner

Method Index

 o getText()
gets the text from the String array for the current index value.
 o updateFromTextField()
this method causes the component to get the text from the text field and check to see if it is in the String array and if it is, set the current index to that one and fire the ActionEvent to its registered listeners.
 o updateFromValue()
refreashes the display to show the current String value from the String array for the current index value.

Constructors

 o ETextSpinner
 public ETextSpinner(String p_text[])
Default contructor for ETextSpinner. The String array is required at construction. This constructor will default the starting string to be the first (0) index with up and down buttons.

Parameters:
String[] - p_text - the String array to manipulate
 o ETextSpinner
 public ETextSpinner(String p_text[],
                     boolean p_upAndDownButtons)
Constructor for ETextSpinner.

Parameters:
String[] - p_text - the String array to manipulate
boolean - p_upAndDownButtons - true will produce up and down buttons to the right of the text field. false will produce the left (down) button to the left of the text field and the right (up) button to the right of the text field.
 o ETextSpinner
 public ETextSpinner(String p_text[],
                     int p_startIndex,
                     boolean p_upAndDownButtons)
Constructor for ETextSpinner.

Parameters:
String[] - p_text - the String array to manipulate
int - p_startIndex - the index of the String array to display upon start up
boolean - p_upAndDownButtons - true will produce up and down buttons to the right of the text field. false will produce the left (down) button to the left of the text field and the right (up) button to the right of the text field.
 o ETextSpinner
 public ETextSpinner(String p_text[],
                     int p_startIndex,
                     boolean p_upAndDownButtons,
                     int p_buttonSize)
Contructor for ETextSpinner.

Parameters:
String[] - p_text - the String array to manipulate
int - p_startIndex - the index of the String array to display upon start up
boolean - p_upAndDownButtons - true will produce up adn down buttons to the right of the text field. false will produce the left (down) button to the left of the text field and the right (up) button to the right of the text field.
int - p_buttonSize - this will determine the size of the arrows within the up/down buttons in pixels.
 o ETextSpinner
 public ETextSpinner(String p_text[],
                     int p_startIndex,
                     boolean p_upAndDownButtons,
                     boolean p_showButtons)
Contructor for ETextSpinner.

Parameters:
String[] - p_text - the String array to manipulate
int - p_startIndex - the index of the String array to display upon start up
boolean - p_upAndDownButtons - true will produce up adn down buttons to the right of the text field. false will produce the left (down) button to the left of the text field and the right (up) button to the right of the text field.
boolean - p_showButtons - false will not show the spine buttons. true will cause the spin buttons to be shown.
 o ETextSpinner
 public ETextSpinner(String p_text[],
                     int p_startIndex,
                     boolean p_upAndDownButtons,
                     int p_buttonSize,
                     boolean p_showButtons)
Constructor for ETextSpinner

Parameters:
String[] - p_text - the String array to manipulate
int - p_startIndex - the index of the String array to display upon start up
boolena - p_upAndDownButtons - true will produce up and down buttons to the right of the text field. false will producte the left (down) button to the left of the text field and the right (up) button to the right of the text field.
int - p_buttonSize - this will determine the size of the arrows within the up/down buttons in pixels.
boolean - p_showButtons - false will not show the spin buttons. true will show the spin buttons.

Methods

 o getText
 public final String getText()
gets the text from the String array for the current index value.

Returns:
String
Overrides:
getText in class ESpinner
 o updateFromValue
 public final void updateFromValue()
refreashes the display to show the current String value from the String array for the current index value. This method will also fire the ActionPerformed event and notify its registered listeners that the value has changed. If roll over flag is turned on and the change in value causes the value to roll over it will send and ActionEvent with "SPIN_ROLLOVER" as the ActionCommand string, and "SPIN_ROLLUNDER" as the ActionCommand string if the value roll under.

Overrides:
updateFromValue in class ESpinner
 o updateFromTextField
 public final void updateFromTextField()
this method causes the component to get the text from the text field and check to see if it is in the String array and if it is, set the current index to that one and fire the ActionEvent to its registered listeners.

Overrides:
updateFromTextField in class ESpinner

All Packages  Class Hierarchy  This Package  Previous  Next  Index