Package com.nomagic.magicdraw.ui.actions
Class DefaultDiagramStateAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.actions.BaseNMStateAction
-
- com.nomagic.actions.NMStateAction
-
- com.nomagic.magicdraw.actions.MDStateAction
-
- com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction
-
- com.nomagic.magicdraw.ui.actions.DefaultDiagramStateAction
-
- All Implemented Interfaces:
com.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction
,DiagramAction
,com.nomagic.magicdraw.actions.ShortcutSchemaAction
,java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
@OpenApiAll public class DefaultDiagramStateAction extends com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction implements DiagramAction
The default implementation of DiagramAction and MDStateAction- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nomagic.actions.NMStateAction
DISTINGUISH, STATE
-
Fields inherited from class com.nomagic.actions.BaseNMStateAction
GROUPED
-
Fields inherited from class com.nomagic.actions.NMAction
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, DO_NOT_REGISTER_ACTION_TO_COMPONENTS, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK, TINY_ICON
-
-
Constructor Summary
Constructors Constructor Description DefaultDiagramStateAction(java.lang.String actionID, java.lang.String actionName, javax.swing.KeyStroke stroke, java.lang.String group)
Constructs new action.DefaultDiagramStateAction(java.lang.String actionID, java.lang.String actionName, javax.swing.KeyStroke stroke, java.lang.String group, boolean useSchema)
Constructs new action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DiagramPresentationElement
getDiagram()
Returns diagram this action.void
setDiagram(AbstractDiagramPresentationElement diagram)
Sets the diagram to this action.void
setDiagram(DiagramPresentationElement diagram)
Sets diagram for this action.-
Methods inherited from class com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction
getFirstSelected, getSelected
-
Methods inherited from class com.nomagic.magicdraw.actions.MDStateAction
actionPerformed, isUseShortcutSchema, updateState
-
Methods inherited from class com.nomagic.actions.NMStateAction
accept, getState, isDistinguish, isStateEvent, setDistinguish, setState
-
Methods inherited from class com.nomagic.actions.BaseNMStateAction
isGrouped, setGrouped
-
Methods inherited from class com.nomagic.actions.NMAction
addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, forEach, forEachIncludingSelf, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removeIf, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, shallowClone, toString
-
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
-
-
-
Constructor Detail
-
DefaultDiagramStateAction
public DefaultDiagramStateAction(java.lang.String actionID, @CheckForNull java.lang.String actionName, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
Constructs new action.- Parameters:
actionID
- the action ID.actionName
- the action name.stroke
- the action stroke.group
- the action group.
-
DefaultDiagramStateAction
public DefaultDiagramStateAction(java.lang.String actionID, @CheckForNull java.lang.String actionName, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group, boolean useSchema)
Constructs new action.- Parameters:
actionID
- the action ID.actionName
- the action name.stroke
- the action stroke.group
- the action group.useSchema
- use shortcuts schema
-
-
Method Detail
-
setDiagram
public void setDiagram(@CheckForNull DiagramPresentationElement diagram)
Sets diagram for this action.- Specified by:
setDiagram
in interfaceDiagramAction
- Parameters:
diagram
- the given diagram
-
setDiagram
public final void setDiagram(@CheckForNull AbstractDiagramPresentationElement diagram)
Sets the diagram to this action. Only @DiagramPresentationElement
are supported.- Specified by:
setDiagram
in interfacecom.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction
- Overrides:
setDiagram
in classcom.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction
- Parameters:
diagram
- the given diagram
-
getDiagram
@CheckForNull protected DiagramPresentationElement getDiagram()
Description copied from class:com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction
Returns diagram this action. MagicDraw framework guarantee that diagram will set if this method is called from updateState() or actionPerformed(ActionEvent) methods.- Overrides:
getDiagram
in classcom.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction
- Returns:
- diagram.
-
-