All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class net.e2technologies.util.ENumericSpinner

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

public class ENumericSpinner
extends ESpinner
ENumericSpinner is a class that extends ESpinner by displaying and manipulating numeric 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). Check ESpinner for more functionality (such as roll over).

See Also:
ESpinner

Constructor Index

 o ENumericSpinner()
Default constructor for ENumericSpinner.
 o ENumericSpinner(int, int, int, int, int)
Construtor for ENumericSpinner.
 o ENumericSpinner(int, int, int, int, int, boolean)
Constructor for ENumericSpinner.

Method Index

 o getDoubleValue()
takes the current value can converts it to a double
 o getText()
will return the current value as type String
 o setMax(int)
sets the maximum value the component will display.
 o setMin(int)
sets the minimum value the component will display.
 o updateFromValue()
updates the text field according to what the current value stored is and will notify all registered listners by sending an ActionEvent.

Constructors

 o ENumericSpinner
 public ENumericSpinner()
Default constructor for ENumericSpinner. Will create a spinner with the initial value of 1, a minimum of 0, a maximum of 9999, and an increment of 1.

 o ENumericSpinner
 public ENumericSpinner(int p_startValue,
                        int p_decimalPlaces,
                        int p_min,
                        int p_max,
                        int p_increment)
Construtor for ENumericSpinner.

Parameters:
int - p_startValue - the initial value to display in the text field at start up.
int - p_decimalPlaces - the number of decimal places to show.
int - p_min - the minimum value to allow.
int - p_max - the maximum value to allow.
int - p_increment - how much to increase/decrease the value by.
 o ENumericSpinner
 public ENumericSpinner(int p_startValue,
                        int p_decimalPlaces,
                        int p_min,
                        int p_max,
                        int p_increment,
                        boolean p_showButtons)
Constructor for ENumericSpinner.

Parameters:
int - p_startValue - the initial value to display in the text field at start up.
int - p_decimalPlaces - the number of decimal places to show.
int - p_min - the mimimum value to allow.
int - p_max - the maximum value to allow.
int - p_increment - how much to increase/decrease the value by.
boolean - p_showButtons - true to show spinner buttons, false to not show spin buttons.

Methods

 o setMax
 public final void setMax(int p_max)
sets the maximum value the component will display. This method will also resize the text field to exactly fit a number of the max size.

Parameters:
int - p_max - the maximum value that the component will display
Overrides:
setMax in class ESpinner
 o setMin
 public final void setMin(int p_min)
sets the minimum value the component will display.

Parameters:
int - p_min - the minimum value that the component will display
Overrides:
setMin in class ESpinner
 o getDoubleValue
 public final double getDoubleValue()
takes the current value can converts it to a double

Returns:
double -the current value
Overrides:
getDoubleValue in class ESpinner
 o updateFromValue
 public void updateFromValue()
updates the text field according to what the current value stored is and will notify all registered listners by sending an ActionEvent. If the roll over flag is set to ture and the component roll over the maximum value, then the ActionCommand of the ActionEvent sent will be "SPIN_ROLLOVER" and if the component roll under, the ActionCommand will be "SPIN_ROLLUNDER".

Overrides:
updateFromValue in class ESpinner
 o getText
 public String getText()
will return the current value as type String

Returns:
String
Overrides:
getText in class ESpinner

All Packages  Class Hierarchy  This Package  Previous  Next  Index