Package adams.gui.flow.tree.menu
Class AbstractAddMostCommonActorAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- adams.gui.action.AbstractBaseAction
-
- adams.gui.action.AbstractActionWithDialog<D>
-
- adams.gui.action.AbstractPropertiesAction<T,D>
-
- adams.gui.action.AbstractPropertiesMenuItemAction<StateContainer,GenericObjectEditorDialog>
-
- adams.gui.flow.tree.menu.AbstractTreePopupMenuItemAction
-
- adams.gui.flow.tree.menu.AbstractAddMostCommonActorAction
-
- All Implemented Interfaces:
CleanUpHandler
,BaseAction
,PropertiesAction<StateContainer>
,TreePopupAction
,ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
AddMostCommonActorAfter
,AddMostCommonActorBeneath
,AddMostCommonActorHere
public abstract class AbstractAddMostCommonActorAction extends AbstractTreePopupMenuItemAction
Ancestor for actions that add most common actors.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>
m_Blacklisted
for blacklisting actor classnames that couldn't be instantiated.-
Fields inherited from class adams.gui.action.AbstractPropertiesAction
m_State
-
Fields inherited from class adams.gui.action.AbstractActionWithDialog
m_Dialog
-
Fields inherited from class adams.gui.action.AbstractBaseAction
ASYNCHRONOUS
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Constructor Description AbstractAddMostCommonActorAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
blacklistActor(String classname)
Flags the actor as blacklisted for the current session.protected BaseMenu
finalizeMenu(List<JMenuItem> menuitems)
Finalizes the menu.protected List<String>
getMostCommonActors(TreePath path, TreeOperations.InsertPosition position)
Returns the classnames of the most commonly used actors.protected boolean
isBlacklistedActor(String classname)
Checks whether the actor has been blacklisted.protected Actor
newActor(String classname)
Instantiates the specified actor if not blacklisted.protected JMenuItem
newMenuItem(List<JMenuItem> menuitems, Actor actor)
Creates a new menuitem.-
Methods inherited from class adams.gui.flow.tree.menu.AbstractTreePopupMenuItemAction
addUndoPoint, getParentDialog, getParentFrame, getProperties, keyStrokeApplies
-
Methods inherited from class adams.gui.action.AbstractPropertiesMenuItemAction
getMenuItem
-
Methods inherited from class adams.gui.action.AbstractPropertiesAction
canUseIcon, doUpdate, getTitle, initialize, update
-
Methods inherited from class adams.gui.action.AbstractActionWithDialog
cleanUp, createDialog, getDialog
-
Methods inherited from class adams.gui.action.AbstractBaseAction
actionPerformed, doActionPerformed, getAccelerator, getIcon, getMnemonic, getName, getToolTipText, hasAccelerator, hasIcon, hasMnemonic, hasToolTipText, isAsynchronous, isSelected, postActionPerformed, preActionPerformed, setAccelerator, setAsynchronous, setIcon, setIcon, setMnemonic, setName, setSelected, setToolTipText
-
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
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Methods inherited from interface adams.gui.action.BaseAction
cleanUp, getAccelerator, getIcon, getMnemonic, getName, getToolTipText, hasAccelerator, hasMnemonic, hasToolTipText, isAsynchronous, isSelected, setAccelerator, setAsynchronous, setIcon, setIcon, setMnemonic, setName, setSelected, setToolTipText
-
Methods inherited from interface adams.gui.action.PropertiesAction
getMenuItem, update
-
-
-
-
Method Detail
-
blacklistActor
protected void blacklistActor(String classname)
Flags the actor as blacklisted for the current session.- Parameters:
classname
- the classname to blacklist
-
isBlacklistedActor
protected boolean isBlacklistedActor(String classname)
Checks whether the actor has been blacklisted.- Parameters:
classname
- the classname to check- Returns:
- true if blacklisted
-
newActor
protected Actor newActor(String classname)
Instantiates the specified actor if not blacklisted. Blacklists it automatically if it can't be instantiated.- Parameters:
classname
- the classname of the actor to instantiate- Returns:
- the actor, null if failed to instantiate
-
getMostCommonActors
protected List<String> getMostCommonActors(TreePath path, TreeOperations.InsertPosition position)
Returns the classnames of the most commonly used actors.- Parameters:
path
- the path to insert the actor atposition
- where to insert the actor- Returns:
- the actors
-
newMenuItem
protected JMenuItem newMenuItem(List<JMenuItem> menuitems, Actor actor)
Creates a new menuitem.- Parameters:
menuitems
- the list to add toactor
- the actor to create the menuitem for- Returns:
- the new item
-
-