Class ATKNumberField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public class ATKNumberField extends ATKField
ATKNumberField is a class to handel numeric input. The user can input input numbers in a normal fashion, but this field also supports the notion of wheelswitch, in which the user can use the arrow keys to change the value of the field. Arrow up increases the digit under the cursor, arrow down decreases the digit under the cursor, and arrow left or right moves the cursor.
Version:
$Version$
Author:
Erik Assum
See Also:
  • Field Details

    • wheelSwitchEnabled

      protected boolean wheelSwitchEnabled
    • model

      protected fr.esrf.tangoatk.core.INumberScalar model
    • bg

      protected Color bg
    • insertOK

      protected boolean insertOK
  • Constructor Details

    • ATKNumberField

      public ATKNumberField()
  • Method Details

    • setText

      public void setText(Number d)
      setText inserts the number passed as parameter into the textfield formated with the userformat if it is there, if not with the format of the attribute.
      Parameters:
      d - a Number value
    • setValue

      public void setValue(Number d)
      setValue sets the numeric value of this field
      Parameters:
      d - a Number value
    • getValue

      public Number getValue()
      getValue returns the value of this field.
      Returns:
      a Number value
    • setModel

      public void setModel(fr.esrf.tangoatk.core.INumberScalar m)
      setModel sets the model for this field.
      Parameters:
      m - an INumber value
    • enter

      protected void enter(ActionEvent e)
      Description copied from class: ATKField
      enter is called when a user presses enter.
      Overrides:
      enter in class ATKField
      Parameters:
      e - an ActionEvent value
    • newValue

      protected void newValue(Number d)
    • setWheelSwitchEnabled

      public void setWheelSwitchEnabled(boolean b)
      setWheelSwitchEnabled sets the enabledness of the wheelswitch feature
      Parameters:
      b - a boolean value
    • isWheelSwitchEnabled

      public boolean isWheelSwitchEnabled()
      isWheelSwitchEnabled is it enabled?
      Returns:
      a boolean value
    • getFactor

      protected double getFactor()
    • downStroke

      protected void downStroke(ActionEvent e)
    • upStroke

      protected void upStroke(ActionEvent e)
    • leftStroke

      protected void leftStroke(ActionEvent e)
    • rightStroke

      protected void rightStroke(ActionEvent e)
    • moveRight

      protected void moveRight()
    • moveLeft

      protected void moveLeft()
    • changeValue

      protected void changeValue(int sign)
    • createDefaultModel

      protected Document createDefaultModel()
      Overrides:
      createDefaultModel in class JTextField
    • main

      public static void main(String[] args)