Class DefaultDiagramStateAction

  • All Implemented Interfaces:
    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
    Direct Known Subclasses:
    com.nomagic.magicdraw.ui.actions.BaseDiagramAction

    @OpenApiAll
    public class DefaultDiagramStateAction
    extends MDStateAction
    implements DiagramAction
    The default implementation of DiagramAction and MDStateAction
    See Also:
    Serialized Form
    • 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

      • getDiagram

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

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

        protected java.util.List<PresentationElement> getSelected()
        Returns list of selected views.
        Returns:
        list of selected view.