Class MenuAction

java.lang.Object
org.ka2ddo.yaac.gui.pluginadapter.MenuAction
All Implemented Interfaces:
ActionListener, ItemListener, EventListener, Action, AbstractMenuActionPropertyListener

public class MenuAction extends Object implements Action, AbstractMenuActionPropertyListener, ItemListener
This class defines a Java Swing specific wrapper around the now GUI-independent AbstractMenuAction class in the plugin API package.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Details

    • MenuAction

      public MenuAction(AbstractMenuAction abstractMenuAction)
      Create the AWT/Swing-specific wrapper around an AbstractMenuAction.
      Parameters:
      abstractMenuAction - AbstractMenuAction to instantiate in Java Swing
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Adds a PropertyChange listener. Containers and attached components use these methods to register interest in this Action object. When its enabled state or other property changes, the registered listeners are informed of the change.
      Specified by:
      addPropertyChangeListener in interface Action
      Parameters:
      listener - a PropertyChangeListener object
    • getValue

      public Object getValue(String key)
      Gets one of this object's properties using the associated key.
      Specified by:
      getValue in interface Action
      See Also:
    • putValue

      public void putValue(String key, Object value)
      Sets one of this object's properties using the associated key. If the value has changed, a PropertyChangeEvent is sent to listeners.
      Specified by:
      putValue in interface Action
      Parameters:
      key - a String containing the key
      value - an Object value
    • setEnabled

      public void setEnabled(boolean b)
      Sets the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method. If the value has changed, a PropertyChangeEvent is sent to listeners.
      Specified by:
      setEnabled in interface Action
      Parameters:
      b - true to enable this Action, false to disable it
    • isEnabled

      public boolean isEnabled()
      Returns the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method.
      Specified by:
      isEnabled in interface Action
      Returns:
      true if this Action is enabled
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Removes a PropertyChange listener.
      Specified by:
      removePropertyChangeListener in interface Action
      Parameters:
      listener - a PropertyChangeListener object
      See Also:
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when an action occurs.
      Specified by:
      actionPerformed in interface ActionListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      DO NOT CALL. Handles association of JMenuItemCheckBox with MenuAction.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      e - ItemEvent reporting JMenuItemCheckBox state change