net.clackrouter.actions
Class ClackAddComponent

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.clackrouter.actions.AbstractActionDefault
          extended by net.clackrouter.actions.ClackAddComponent
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, TranslatorConstants

public class ClackAddComponent
extends AbstractActionDefault

Action to implement component addition (via the Router Graph popup menu).

Uses reflection to create a new component. We use the command string plus an integer to assure that the name is unqiue within the router.

The class to create is based on mappings from command to fully-qualified classname that are stored in the net/clackrouter/jgraph/pad/resources/Clack.properties file.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.clackrouter.actions.AbstractActionDefault
graphpad
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface net.clackrouter.jgraph.pad.resources.TranslatorConstants
PREFIX_COMPONENT, PREFIX_MESSAGE_ERROR, PREFIX_MESSAGE_INFORMATION, PREFIX_MESSAGE_WARING, SUFFIX_ACCELERATOR, SUFFIX_ACTION, SUFFIX_ICON, SUFFIX_IMAGE, SUFFIX_LABEL, SUFFIX_MENU, SUFFIX_MNEMONIC, SUFFIX_TEXT, SUFFIX_TITLE, SUFFIX_TOOL_TIP_TEXT
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ClackAddComponent(ClackFramework graphpad)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addMapping(java.lang.String menuName, java.lang.String className)
           
 java.lang.String[] getMenuNames()
           
 
Methods inherited from class net.clackrouter.actions.AbstractActionDefault
getCurrentDocument, getCurrentGraph, getCurrentGraphLayoutCache, getGraphpad, getMenuComponent, getMenuComponents, getName, getPresentationText, getToolComponent, getToolComponents, setGraphpad, setSelectionAttributes, update
 
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

ClackAddComponent

public ClackAddComponent(ClackFramework graphpad)
Method Detail

addMapping

public void addMapping(java.lang.String menuName,
                       java.lang.String className)

getMenuNames

public java.lang.String[] getMenuNames()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)