    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class xu.xu_CheckBoxAction

    java.lang.Object
       |
       +----com.sun.java.swing.AbstractAction
               |
               +----xu.xu_CheckBoxAction

public class xu_CheckBoxAction
extends AbstractAction

An action intended to be associated with a check box menu item, such that it is invoked when the menu item is clicked. The action thus indicates the state of the menu item, and can be accessed to determine its state so that the caller need never deal with the menu item object itself. When the menu item is clicked, the actionPerformed method is invoked, and the ActionEvent it is passed gives details of the menu item's state.

##

AssociatedCheckBoxMenuItem
  The associated check box menu item.
StateFlag
  Flag reflecting the current state (checked or not) of the associated menu item.

##

xu_CheckBoxAction(String)
  Constructor.

##

actionPerformed(ActionEvent)
  Something's happened: record where the event came from, and determine the state of the check box menu item.
getAssociatedCheckBoxMenuItem()
  Get the menu item associated with this action.
getState()
  Get the current state (checked or not) of the associated menu item.
setState(boolean)
  Set the current state of this action.

##

AssociatedCheckBoxMenuItem

     protected JCheckBoxMenuItem AssociatedCheckBoxMenuItem

  The associated check box menu item.

StateFlag

     protected boolean StateFlag

  Flag reflecting the current state (checked or not) of the associated menu item. It defaults to 'false'.

##

xu_CheckBoxAction

     public xu_CheckBoxAction(String InputActionName)

  Constructor.

  Parameters:
    InputActionName - The name of the action

##

actionPerformed

     public void actionPerformed(ActionEvent InputActionEvent)

  Something's happened: record where the event came from, and determine the state of the check box menu item.

  Overrides:
    actionPerformed in class AbstractAction

setState

     public void setState(boolean InputStateFlag)

  Set the current state of this action. This is intended to be used at initialisation time (to set the initial state, say, according to the value in a configuration file).

getAssociatedCheckBoxMenuItem

     public JCheckBoxMenuItem getAssociatedCheckBoxMenuItem()

  Get the menu item associated with this action.

getState

     public boolean getState()

  Get the current state (checked or not) of the associated menu item.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index