org.argouml.uml.diagram.ui
Class ActionCompartmentDisplay

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.tigris.gef.undo.UndoableAction
          extended byorg.argouml.uml.diagram.ui.ActionCompartmentDisplay
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable

public class ActionCompartmentDisplay
extends org.tigris.gef.undo.UndoableAction

A class to implement the actions involved in hiding and showing compartments on interfaces, classes and use cases.

This implementation may easily be extended for other compartments of other figs.

The class declares a number of static instances, each with an actionPerformed method that performs the required action.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected ActionCompartmentDisplay(boolean d, String c, int type)
          Constructor for a new instance.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Action method invoked when an event triggers this action.
static Collection getActions()
          Return the compartment show and/or hide actions needed for the selected Figs.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionCompartmentDisplay

protected ActionCompartmentDisplay(boolean d,
                                   String c,
                                   int type)
Constructor for a new instance. Can only be called by this class or its children, since used to create static instances only.

Parameters:
d - true if the compartment is to be shown, false if it is to be hidden
c - the text to be displayed for this action
type - the type of compartment. See definition at #cType
Method Detail

getActions

public static Collection getActions()
Return the compartment show and/or hide actions needed for the selected Figs. Only returns the actions for the menu-items that make sense for the current selection.


actionPerformed

public void actionPerformed(ActionEvent ae)
Action method invoked when an event triggers this action.

The #cType instance variable defines the action to take, and the #display instance variable whether it should set visibility or not.

Parameters:
ae - The event that triggered us.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook