org.argouml.uml.diagram.ui
Class ActionNavigability

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.argouml.uml.ui.UMLAction
          extended byorg.argouml.uml.diagram.ui.ActionNavigability
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable

public class ActionNavigability
extends UMLAction

A class to perform the action of changing the unidirectional or bidirectional navigation of an association.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private  Object assocEnd
           
private  Object assocStart
           
static int BIDIRECTIONAL
          Enumeration constant for BIDIRECTIONAL navigability.
static int ENDTOSTART
          Enumeration constant for ENDTOSTART navigability.
private  int nav
           
static int STARTTOEND
          Enumeration constant for STARTTOEND navigability.
 
Fields inherited from class org.argouml.uml.ui.UMLAction
HAS_ICON, NO_ICON
 
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 ActionNavigability(String label, Object theAssociationStart, Object theAssociationEnd, int theNavigability)
          The constructor.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          To perform the action of changing navigability.
private static String getDescription(Object assocStart, Object assocEnd, int nav)
          Build a description string from the given association ends, and the navigability.
static ActionNavigability newActionNavigability(Object assocStart, Object assocEnd, int nav)
          The ActionNavigability constructor.
 boolean shouldBeEnabled()
          The is action is always enabled.
 
Methods inherited from class org.argouml.uml.ui.UMLAction
getMnemonic, getValue, isEnabled, putValue, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIDIRECTIONAL

public static final int BIDIRECTIONAL
Enumeration constant for BIDIRECTIONAL navigability.

See Also:
Constant Field Values

STARTTOEND

public static final int STARTTOEND
Enumeration constant for STARTTOEND navigability.

See Also:
Constant Field Values

ENDTOSTART

public static final int ENDTOSTART
Enumeration constant for ENDTOSTART navigability.

See Also:
Constant Field Values

nav

private int nav

assocStart

private Object assocStart

assocEnd

private Object assocEnd
Constructor Detail

ActionNavigability

protected ActionNavigability(String label,
                             Object theAssociationStart,
                             Object theAssociationEnd,
                             int theNavigability)
The constructor.

Parameters:
label - the description as build in getDescription
theAssociationStart - association end 1
theAssociationEnd - association end 2
theNavigability - the navigability: one of BIDIRECTIONAL, STARTTOEND, ENDTOSTART
Method Detail

newActionNavigability

public static ActionNavigability newActionNavigability(Object assocStart,
                                                       Object assocEnd,
                                                       int nav)
The ActionNavigability constructor.

Parameters:
assocStart - a MAssociationEnd object at the start of an association.
assocEnd - a MAssociationEnd object at the end of an association.
nav - the type of navigation required in the association being either
  • BIDIRECTIONAL
  • STARTTOEND
  • ENDTOSTART
Returns:
the constructed class

getDescription

private static String getDescription(Object assocStart,
                                     Object assocEnd,
                                     int nav)
Build a description string from the given association ends, and the navigability.

Parameters:
assocStart - association end 1
assocEnd - association end 2
nav - the navigability
Returns:
the string containing a human-readible indication of the navigability

actionPerformed

public void actionPerformed(ActionEvent ae)
To perform the action of changing navigability.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class UMLAction
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

shouldBeEnabled

public boolean shouldBeEnabled()
The is action is always enabled.

Overrides:
shouldBeEnabled in class UMLAction
Returns:
true if the action should be available.
See Also:
UMLAction.shouldBeEnabled()


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook