Class DefaultDiagramAction

  • 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
    Direct Known Subclasses:
    DefaultActiveDiagramAction, DiagramContextToolbarAction

    @OpenApiAll
    public class DefaultDiagramAction
    extends com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramAction
    implements DiagramAction
    The default implementation of DiagramAction and simple MDAction
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultDiagramAction

        public DefaultDiagramAction​(@CheckForNull
                                    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
      • DefaultDiagramAction

        public DefaultDiagramAction​(@CheckForNull
                                    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
    • Method Detail

      • setDiagram

        public final void setDiagram​(@CheckForNull
                                     AbstractDiagramPresentationElement diagram)
        Sets the diagram to this action. Only @DiagramPresentationElement are supported.
        Specified by:
        setDiagram in interface com.dassault_systemes.modeler.magic.ui.diagrams.actions.AbstractDiagramAction
        Overrides:
        setDiagram in class com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramAction
        Parameters:
        diagram - the given diagram
      • getDiagram

        @CheckForNull
        public DiagramPresentationElement getDiagram()
        Description copied from class: com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramAction
        Returns diagram of this action. MagicDraw framework guarantee that diagram will set if this method is called from updateState() or actionPerformed(ActionEvent) methods.
        Overrides:
        getDiagram in class com.dassault_systemes.modeler.magic.ui.diagrams.actions.DefaultAbstractDiagramAction
        Returns:
        set diagram