All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class net.e2technologies.util.ESpinner

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

public abstract class ESpinner
extends JPanel
implements Runnable
ESpinner is the base class for implementing the spinner group (ENumericSpinner & ETextSpinner). This is and abstract class containing abstract methods that must be implemented by its sub-classes. Therefore this class should not be used alone, as it will not be able to perform any usefull end-user actions. ESpinner peforms the internal event notification for the ESpinner package and also contains and updates the spinner values such at minimum and maximum values and the roll over flag. By default, the ESpinner will have a minimum value of 0, a maximum value of 9999 (these are int types), and the roll over/under flag is set to true. This will cause the spinner to automatically roll over to the minimum value when the value is over the maximum (same for minimum).


Constructor Index

 o ESpinner()
The default contructor for ESpinner.
 o ESpinner(int)
Contructor for ESpinner.
 o ESpinner(int, int, int)
Contructor for ESpinner.

Method Index

 o addActionListener(ActionListener)
adds an ActionListener to the button
 o decrement()
subtracts the internal increment value to the internal value.
 o getButtonPanel()
gets the panel that will contain the up and down buttons for the spinner
 o getDoubleValue()
gets the double value storedt within ESpinner.
 o getDownButton()
gets the button used as the down button in the spinner.
 o getField()
gets the spinner's internal text field
 o getListener()
gets the listener for the spinner class
 o getMax()
get the maximum value for the spinner
 o getMin()
gets the minium value for the spinner.
 o getRollOver()
gets the flag value that indicates whether the spinner will roll over values or not.
 o getText()
Abstract method that should return the current value of the Spinner as a String type
 o getUpButton()
gets the button used as the up button in the spinner.
 o getValue()
gets the current value stored within ESpinner.
 o increment()
adds the internal increment value to the internal value.
 o removeActionListener(ActionListener)
removes an ActionListener from the button
 o run()
Threading method used for when the user hold down a button.
 o setButtonPanel(JPanel)
sets the panel that will contain the up and down buttons for the spinner
 o setDownButton(JButton)
sets the down button for the spinner.
 o setEditable(boolean)
will enable or disable the spinners buttons and text field.
 o setField(ESpinnerField)
sets the spinner's internal text field
 o setIncrement(int)
set the value at which the spinner will advance
 o setListener(ESpinner. ESpinnerListener)
adds the listener to the ESpinner so that it will be notified of spinner events such as when the value changes.
 o setMax(int)
sets the maximum value of the spinner
 o setMin(int)
sets the minimum value for the spinner
 o setRollOver(boolean)
sets the roll over flag.
 o setUpButton(JButton)
sets the up button for the spinner.
 o setValue(int)
sets the integer value of the spinner.

Constructors

 o ESpinner
 public ESpinner()
The default contructor for ESpinner. This contructor will setup the internal listeners for events.

 o ESpinner
 public ESpinner(int p_startValue)
Contructor for ESpinner.

Parameters:
int - p_startValue - the integer value to initially display
 o ESpinner
 public ESpinner(int p_startValue,
                 int p_min,
                 int p_max)
Contructor for ESpinner.

Parameters:
int - p_startValue - the integer value to initially display
int - p_min - the integer value that the spinner will not go under
int - p_max - the integer value that the spinner willnot go over

Methods

 o getText
 public abstract String getText()
Abstract method that should return the current value of the Spinner as a String type

Returns:
String - the current value of spinner
 o setMax
 public void setMax(int p_max)
sets the maximum value of the spinner

Parameters:
- - int p_max = the integer value that the spinner will not go over
 o getMax
 public int getMax()
get the maximum value for the spinner

Returns:
int
 o setMin
 public void setMin(int p_min)
sets the minimum value for the spinner

Parameters:
int - p_min - the integer value that the spinner will not go over
 o getMin
 public int getMin()
gets the minium value for the spinner.

Returns:
int
 o getValue
 public int getValue()
gets the current value stored within ESpinner. This can be the actual integer value, or it could be the current index number of an array of values (such as an array of String)

Returns:
int
 o getDoubleValue
 public double getDoubleValue()
gets the double value storedt within ESpinner.

Returns:
double
 o setListener
 public void setListener(ESpinner. ESpinnerListener p_listener)
adds the listener to the ESpinner so that it will be notified of spinner events such as when the value changes.

Parameters:
SpinListener - p_listener - an inner class that listens for events for the spinner
 o getListener
 public ESpinner. ESpinnerListener getListener()
gets the listener for the spinner class

Returns:
SpinListener
 o setField
 public void setField(ESpinnerField p_textField)
sets the spinner's internal text field

Parameters:
- - ESpinnerField p_textField
 o getField
 public ESpinnerField getField()
gets the spinner's internal text field

Returns:
ESpinnerField
 o setRollOver
 public void setRollOver(boolean p_shouldRollOver)
sets the roll over flag. If the boolean is true, the spinner will loop over to the next valid value (i.e. if the value is greater than the maximum value, the spinner will roll over to the minimum value). If the boolean is false, the spinner will stop at the maximum or minimum values.

Parameters:
boolean - p_shouldRollOver - the boolean flag to indicate that the spinner should roll over the minimum and maximum values.
 o getRollOver
 public boolean getRollOver()
gets the flag value that indicates whether the spinner will roll over values or not.

Returns:
boolean
 o setButtonPanel
 public void setButtonPanel(JPanel p_buttonPanel)
sets the panel that will contain the up and down buttons for the spinner

Parameters:
JPanel - p_buttonPanel - the panel to hold the spin buttons
 o getButtonPanel
 public JPanel getButtonPanel()
gets the panel that will contain the up and down buttons for the spinner

Returns:
JPanel
 o setUpButton
 public void setUpButton(JButton p_upButton)
sets the up button for the spinner. Also adds the mouse and key listeners.

Parameters:
JButton - p_upButton - the button to be used as the up button
 o getUpButton
 public JButton getUpButton()
gets the button used as the up button in the spinner.

Returns:
JButton
 o setDownButton
 public void setDownButton(JButton p_downButton)
sets the down button for the spinner. Also adds the mouse and key listeners.

Parameters:
JButton - p_downButton - the button to be used as the down button
 o getDownButton
 public JButton getDownButton()
gets the button used as the down button in the spinner.

Returns:
JButton
 o run
 public void run()
Threading method used for when the user hold down a button. It will wait for a second and call the buttonPushed method to simulate multiple button presses.

 o setEditable
 public void setEditable(boolean p_editable)
will enable or disable the spinners buttons and text field.

Parameters:
boolean - p_editable - true = enabled, false = disabled
 o setIncrement
 public void setIncrement(int p_incr)
set the value at which the spinner will advance

Parameters:
int - p_incr - the value to increment the spinner
 o setValue
 public void setValue(int p_value)
sets the integer value of the spinner. This method will call updateFromValue() automatically.

Parameters:
int - p_value - the actual integer value or the index of the array to diaplay.
 o addActionListener
 public final void addActionListener(ActionListener p_actionListener)
adds an ActionListener to the button

Parameters:
ActionListener - p_actionListener - an external listener to receive action events such as value changed.
See Also:
ActionListener
 o removeActionListener
 public final void removeActionListener(ActionListener p_actionListener)
removes an ActionListener from the button

Parameters:
ActionListener - p_actionListener - an external listener
 o increment
 public void increment()
adds the internal increment value to the internal value. This method will also call updateFromValue().

 o decrement
 public void decrement()
subtracts the internal increment value to the internal value. This method will also call updateFromValue().


All Packages  Class Hierarchy  This Package  Previous  Next  Index