Class ATKField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
ATKNumberField, ATKStringField

public class ATKField extends JTextField
ATKField is a superclass for ATKStringField and ATKNumberField.
Version:
$Version$
Author:
Erik Assum
See Also:
  • Field Details

    • inserting

      protected boolean inserting
    • editable

      protected boolean editable
    • modelEditable

      protected boolean modelEditable
    • receivedEvent

      protected boolean receivedEvent
    • length

      protected int length
    • format

      protected String format
    • error

      protected String error
    • userFormat

      protected ATKFormat userFormat
  • Constructor Details

    • ATKField

      public ATKField()
  • Method Details

    • setUserFormat

      public void setUserFormat(ATKFormat format)
      setUserFormat lets the application programmer format the field independently of what format is specified by the attribute.
      Parameters:
      format - an ATKFormat value
      See Also:
    • getUserFormat

      public ATKFormat getUserFormat()
      getUserFormat returns the ATKFormat for this object.
      Returns:
      an ATKFormat value
    • setFont

      public void setFont(Font f)
      setFont sets the font of this field. Also readjusts the size of the field if setMaximumLength has been called.
      Overrides:
      setFont in class JTextField
      Parameters:
      f - a Font value
    • enter

      protected void enter(ActionEvent e)
      enter is called when a user presses enter.
      Parameters:
      e - an ActionEvent value
    • setState

      public void setState(Color color)
      setState sets the background-color of this field on a statechange, unless the field is editable.
      Parameters:
      color - a Color value
    • setEditable

      public void setEditable(boolean b)
      setEditable sets the editable property of this field. A field representing an attribute which is not editable, will never be editable even if setEditable is set to true.
      Overrides:
      setEditable in class JTextComponent
      Parameters:
      b - a boolean value
    • isEditable

      public boolean isEditable()
      isEditable returns true if this field is setEditable and the attribute it is representing is editable.
      Overrides:
      isEditable in class JTextComponent
      Returns:
      a boolean value
    • setError

      public void setError()
      setError sets the field to the error-text, normally this is ------ if the field is editable.
    • setFormat

      public void setFormat(String format)
      setFormat sets the format of this field.
      Parameters:
      format - a String value containing a format specifier in either Tango-style or C-style.
    • getFormat

      public String getFormat()
      getFormat returns the format string for this field.
      Returns:
      a String value
    • setMaximumLength

      public void setMaximumLength(int characters)
      setMaximumLength sets the maximum number of charachters this field can occupy.
      Parameters:
      characters - an int value
    • getMaximumLength

      public int getMaximumLength()
      getMaximumLength
      Returns:
      an int value containing the maximum number of charachter this field can occupy