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).
-
ESpinner()
-
The default contructor for ESpinner.
-
ESpinner(int)
- Contructor for ESpinner.
-
ESpinner(int, int, int)
- Contructor for ESpinner.
-
addActionListener(ActionListener)
- adds an ActionListener to the button
-
decrement()
- subtracts the internal increment value to the internal value.
-
getButtonPanel()
- gets the panel that will contain the up and down buttons for the spinner
-
getDoubleValue()
- gets the double value storedt within ESpinner.
-
getDownButton()
- gets the button used as the down button in the spinner.
-
getField()
- gets the spinner's internal text field
-
getListener()
- gets the listener for the spinner class
-
getMax()
- get the maximum value for the spinner
-
getMin()
- gets the minium value for the spinner.
-
getRollOver()
- gets the flag value that indicates whether the spinner will roll over values or not.
-
getText()
- Abstract method that should return the current value of the Spinner as a String type
-
getUpButton()
- gets the button used as the up button in the spinner.
-
getValue()
- gets the current value stored within ESpinner.
-
increment()
- adds the internal increment value to the internal value.
-
removeActionListener(ActionListener)
- removes an ActionListener from the button
-
run()
- Threading method used for when the user hold down a button.
-
setButtonPanel(JPanel)
- sets the panel that will contain the up and down buttons for the spinner
-
setDownButton(JButton)
- sets the down button for the spinner.
-
setEditable(boolean)
- will enable or disable the spinners buttons and text field.
-
setField(ESpinnerField)
- sets the spinner's internal text field
-
setIncrement(int)
- set the value at which the spinner will advance
-
setListener(ESpinner. ESpinnerListener)
- adds the listener to the ESpinner so that it will be notified of spinner events
such as when the value changes.
-
setMax(int)
- sets the maximum value of the spinner
-
setMin(int)
- sets the minimum value for the spinner
-
setRollOver(boolean)
- sets the roll over flag.
-
setUpButton(JButton)
- sets the up button for the spinner.
-
setValue(int)
- sets the integer value of the spinner.
ESpinner
public ESpinner()
- The default contructor for ESpinner.
This contructor will setup the internal listeners for events.
ESpinner
public ESpinner(int p_startValue)
- Contructor for ESpinner.
- Parameters:
- int - p_startValue - the integer value to initially display
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
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
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
getMax
public int getMax()
- get the maximum value for the spinner
- Returns:
- int
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
getMin
public int getMin()
- gets the minium value for the spinner.
- Returns:
- int
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
getDoubleValue
public double getDoubleValue()
- gets the double value storedt within ESpinner.
- Returns:
- double
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
getListener
public ESpinner. ESpinnerListener getListener()
- gets the listener for the spinner class
- Returns:
- SpinListener
setField
public void setField(ESpinnerField p_textField)
- sets the spinner's internal text field
- Parameters:
- - - ESpinnerField p_textField
getField
public ESpinnerField getField()
- gets the spinner's internal text field
- Returns:
- ESpinnerField
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.
getRollOver
public boolean getRollOver()
- gets the flag value that indicates whether the spinner will roll over values or not.
- Returns:
- boolean
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
getButtonPanel
public JPanel getButtonPanel()
- gets the panel that will contain the up and down buttons for the spinner
- Returns:
- JPanel
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
getUpButton
public JButton getUpButton()
- gets the button used as the up button in the spinner.
- Returns:
- JButton
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
getDownButton
public JButton getDownButton()
- gets the button used as the down button in the spinner.
- Returns:
- JButton
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.
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
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
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.
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
removeActionListener
public final void removeActionListener(ActionListener p_actionListener)
- removes an ActionListener from the button
- Parameters:
- ActionListener - p_actionListener - an external listener
increment
public void increment()
- adds the internal increment value to the internal value.
This method will also call updateFromValue().
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