Class MDStateAction

All Implemented Interfaces:
com.nomagic.magicdraw.actions.ShortcutSchemaAction, ActionListener, Serializable, Cloneable, Comparable, EventListener, Action
Direct Known Subclasses:
com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramStateAction, DefaultBrowserStateAction

@OpenApiAll public class MDStateAction extends NMStateAction implements com.nomagic.magicdraw.actions.ShortcutSchemaAction
The class describes the action for changing some boolean state. This action uses ActionsGroupController for checking enabled/disable state of assigned relative actions group(if it has some group).
See Also:
  • Constructor Details

    • MDStateAction

      public MDStateAction(@CheckForNull String id, @CheckForNull String name, @CheckForNull KeyStroke stroke, @CheckForNull String group)
      Creates the action with given id, name, key stroke, group.
      Parameters:
      id - the id of the action.
      name - the name of the action.
      stroke - the KeyStroke of the action
      group - the name of the related commands group.
    • MDStateAction

      public MDStateAction(@CheckForNull String id, @CheckForNull String name, @CheckForNull KeyStroke stroke, @CheckForNull String group, boolean useShortcutSchema)
      Creates the action with given id, name, key stroke, group.
      Parameters:
      id - the id of the action.
      name - the name of the action.
      stroke - the KeyStroke of the action
      group - the name of the related commands group.
      useShortcutSchema - use shortcuts schema
    • MDStateAction

      public MDStateAction(@CheckForNull String id, @CheckForNull String name, int mnemonic, @CheckForNull String group)
      Constructs the action with given id, name, mnemonic key and group.
      Parameters:
      id - the id of the action.
      name - the name of the action.
      mnemonic - the mnemonic key of the action
      group - the name of the related commands group.
  • Method Details

    • actionPerformed

      public void actionPerformed(@CheckForNull ActionEvent e)
      Executes action.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class NMStateAction
      Parameters:
      e - event caused execution.
    • updateState

      public void updateState()
      If action has assigned relative group, takes enable flag value from this group and sets to itself.
      Overrides:
      updateState in class NMAction
    • isUseShortcutSchema

      public boolean isUseShortcutSchema()
      Specified by:
      isUseShortcutSchema in interface com.nomagic.magicdraw.actions.ShortcutSchemaAction
      Returns:
      true if action is using schema for taking default shortcuts