Class NamedHotKeyConfigurer

java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.NamedHotKeyConfigurer
All Implemented Interfaces:
FocusListener, EventListener

public class NamedHotKeyConfigurer extends Configurer implements FocusListener
A configurer for Configuring Key Strokes. It allows the entry of either a standard keystroke, or a Named command. It contains two separate Text fields, one for the Name and one for the keystroke. A user can fill in one or the other. Filling in one, clears the other. This Configurer has a limited undo function. Whenever one of the two fields gains focus, the current state of the Configurer is saved and the Undo button enabled. The undo button will return to the state when that field gained focus. This provides a one-step undo if a user accidentally types in one of the fields and wipes out data in the other field.
  • Constructor Details Link icon

    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer(String key, String name, NamedKeyStroke val, int defaultFieldLength)
    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer(String key, String name, NamedKeyStroke val)
    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer(String key, String name)
    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer(NamedKeyStroke val, int defaultFieldLength)
    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer(NamedKeyStroke val)
    • NamedHotKeyConfigurer Link icon

      public NamedHotKeyConfigurer()
  • Method Details Link icon

    • getFancyString Link icon

      public static String getFancyString(NamedKeyStroke k)
    • getString Link icon

      public static String getString(NamedKeyStroke k)
      Return a String representation of a NamedKeyStroke
      Parameters:
      k - NamedKeyStroke
      Returns:
      String representation
    • getString Link icon

      public static String getString(KeyStroke k)
      Return a string representation of a KeyStroke
      Parameters:
      k - KeyStroke
      Returns:
      String representation
    • getValueString Link icon

      public String getValueString()
      Specified by:
      getValueString in class Configurer
      Returns:
      a String representation of the Object value
    • getValueNamedKeyStroke Link icon

      public NamedKeyStroke getValueNamedKeyStroke()
    • isNamed Link icon

      public boolean isNamed()
    • requestFocus Link icon

      public void requestFocus()
      Description copied from class: Configurer
      Move the cursor to the first input field of this Configurer
      Overrides:
      requestFocus in class Configurer
    • setValue Link icon

      public void setValue(Object o)
      Description copied from class: Configurer
      Set the Object value
      Overrides:
      setValue in class Configurer
    • updateVisibility Link icon

      protected void updateVisibility()
    • setValue Link icon

      public void setValue(String s)
      Description copied from class: Configurer
      Set the Object value from a String
      Specified by:
      setValue in class Configurer
    • getControls Link icon

      public Component getControls()
      Description copied from class: Configurer
      GUI interface for setting the option in an editing window
      Specified by:
      getControls in class Configurer
    • focusGained Link icon

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
    • focusLost Link icon

      public void focusLost(FocusEvent e)
      Specified by:
      focusLost in interface FocusListener
    • keyToString Link icon

      public String keyToString()
    • isPrintableAscii Link icon

      protected boolean isPrintableAscii(char c)
    • isPrintableAscii Link icon

      protected boolean isPrintableAscii(int i)
    • decode Link icon

      public static NamedKeyStroke decode(String s)
      Decode a String into a NamedKeyStroke
    • encode Link icon

      public static String encode(NamedKeyStroke stroke)
      Encode a NamedKeyStroke into a String
    • setHighlighted Link icon

      public void setHighlighted(boolean highlighted)
      Description copied from class: Configurer
      Set the highlighted status of this configurer. It is up to individual Configurers to override this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.
      Overrides:
      setHighlighted in class Configurer
      Parameters:
      highlighted - New Highlighted status
    • addFocusListener Link icon

      public void addFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Add a FocusListener to the Swing Components that make up this Configurer.
      Overrides:
      addFocusListener in class Configurer
      Parameters:
      listener - Focus Listener
    • removeFocusListener Link icon

      public void removeFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Remove a FocusListener from the Swing Components that make up this Configurer.
      Overrides:
      removeFocusListener in class Configurer
      Parameters:
      listener - Focus Listener