Class DefaultAbstractDiagramAction

java.lang.Object
javax.swing.AbstractAction
com.nomagic.actions.NMAction
com.nomagic.magicdraw.actions.MDAction
com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramAction
All Implemented Interfaces:
com.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction, com.nomagic.magicdraw.actions.ShortcutSchemaAction, ActionListener, Serializable, Cloneable, Comparable, EventListener, Action
Direct Known Subclasses:
DefaultDiagramAction

@OpenApiAll public class DefaultAbstractDiagramAction extends MDAction implements com.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction
The default implementation of AbstractDiagramAction and simple MDAction
See Also:
  • Constructor Details

    • DefaultAbstractDiagramAction

      public DefaultAbstractDiagramAction(@CheckForNull String actionID, @CheckForNull String actionName, @CheckForNull KeyStroke stroke, @CheckForNull String group)
      Constructs new action.
      Parameters:
      actionID - the action ID
      actionName - the action name
      stroke - the action stroke
      group - the action group
    • DefaultAbstractDiagramAction

      public DefaultAbstractDiagramAction(@CheckForNull String actionID, @CheckForNull String actionName, @CheckForNull KeyStroke stroke, @CheckForNull String group, boolean useSchema)
      Constructs new action.
      Parameters:
      actionID - the action ID
      actionName - the action name
      stroke - the action stroke
      group - the action group
  • Method Details

    • setDiagram

      public void setDiagram(@CheckForNull AbstractDiagramPresentationElement diagram)
      Sets diagram for this action.
      Specified by:
      setDiagram in interface com.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction
      Parameters:
      diagram - the given diagram
    • getDiagram

      @CheckForNull public AbstractDiagramPresentationElement getDiagram()
      Returns diagram of this action. MagicDraw framework guarantee that diagram will set if this method is called from updateState() or actionPerformed(ActionEvent) methods.
      Returns:
      set diagram
    • getFirstSelected

      @CheckForNull protected PresentationElement getFirstSelected()
      Returns first selected presentation element in the diagram.
      Returns:
      first selected presentation element
    • getSelected

      protected List<PresentationElement> getSelected()
      Returns list of selected presentation elements.
      Returns:
      list of selected presentation elements. If no elements selected, empty list is returned.