Class ActionsCreator


  • @OpenApi
    public class ActionsCreator
    extends java.lang.Object
    The helper class used for creating and holding all MagicDraw actions.
    • Field Detail

      • generalActionsManager

        private MDActionsManager generalActionsManager
        Cached general actions.
      • anyDgrActionsManager

        private MDActionsManager anyDgrActionsManager
        Cached Any diagram actions.
      • classDgrActionsManager

        private MDActionsManager classDgrActionsManager
        Cached Class diagram actions.
      • useCaseDgrActionsManager

        private MDActionsManager useCaseDgrActionsManager
        Cached UseCase diagram actions.
      • collaborationDgrActionsManager

        private MDActionsManager collaborationDgrActionsManager
        Cached Collaboration diagram actions.
      • sequenceDgrActionsManager

        private MDActionsManager sequenceDgrActionsManager
        Cached sequence diagram actions.
      • stateDgrActionsManager

        private MDActionsManager stateDgrActionsManager
        Cached state diagram actions.
      • protocolStateDgrActionsManager

        private MDActionsManager protocolStateDgrActionsManager
        Cached state diagram actions.
      • activityDgrActionsManager

        private MDActionsManager activityDgrActionsManager
        Cached activity diagram actions.
      • interactionOverviewDgrActionsManager

        private MDActionsManager interactionOverviewDgrActionsManager
        Cached interaction overview diagram actions.
      • objectDgrActionsManager

        private MDActionsManager objectDgrActionsManager
        Cached object diagram actions.
      • packageDgrActionsManager

        private MDActionsManager packageDgrActionsManager
        Cached package diagram actions.
      • componentDgrActionsManager

        private MDActionsManager componentDgrActionsManager
        Cached component diagram actions.
      • deploymentDgrActionsManager

        private MDActionsManager deploymentDgrActionsManager
        Cached deployment diagram actions.
      • profileDgrActionsManager

        private MDActionsManager profileDgrActionsManager
        Cached profile diagram actions.
      • compositeStructureDgrActionsManager

        private MDActionsManager compositeStructureDgrActionsManager
        Cached composite structure diagram actions.
      • diagramContextToolbarActionsManager

        private MDActionsManager diagramContextToolbarActionsManager
        Cached Class diagram actions.
      • configuration

        private PropertyManager configuration
        Loaded actions configuration.
      • LAYOUT_ACTIONS

        public static final java.util.Collection<java.lang.String> LAYOUT_ACTIONS
    • Constructor Detail

      • ActionsCreator

        ActionsCreator()
        The constructor which constructs all categories and actions and adds everything into the given actions manager.
    • Method Detail

      • createGeneralActions

        @OpenApi
        public MDActionsManager createGeneralActions()
        Creates the general actions.
        Returns:
        create general actions.
      • createCommonDiagramsActions

        @OpenApi
        public void createCommonDiagramsActions​(ActionsCategory category)
        Creates actions common for all diagrams. This method will always create new instances of the actions.
        Parameters:
        category - the category to add created actions into.
      • createClassDiagramActions

        @OpenApi
        public MDActionsManager createClassDiagramActions()
        Creates the actions for class diagram.
        Returns:
        the class diagram actions.
      • createUseCaseDiagramActions

        @OpenApi
        public MDActionsManager createUseCaseDiagramActions()
        Creates the actions for use case diagram
        Returns:
        the use case diagram actions.
      • createCommunicationDiagramActions

        @OpenApi
        public MDActionsManager createCommunicationDiagramActions()
        Creates the actions for collaboration diagram
        Returns:
        the collaboration diagram actions.
      • createSequenceDiagramActions

        @OpenApi
        public MDActionsManager createSequenceDiagramActions()
        Creates the actions for collaboration diagram
        Returns:
        the sequence diagram actions.
      • createStateDiagramActions

        @OpenApi
        public MDActionsManager createStateDiagramActions()
        Creates the actions for state diagram
        Returns:
        the state diagram actions.
      • createProtocolStateDiagramActions

        @OpenApi
        public MDActionsManager createProtocolStateDiagramActions()
        Creates the actions for protocol state machine diagram
        Returns:
        the protocol state machine diagram actions.
      • createActivityDiagramActions

        @OpenApi
        public MDActionsManager createActivityDiagramActions()
        Creates the actions for activity diagram
        Returns:
        the activity diagram actions.
      • createInteractionOverviewDiagramActions

        @OpenApi
        public MDActionsManager createInteractionOverviewDiagramActions()
        Creates the actions for activity diagram
        Returns:
        the activity diagram actions.
      • createImplementationDiagramActions

        @OpenApi
        @Deprecated
        public MDActionsManager createImplementationDiagramActions()
        Creates the actions for implementation diagram
        Returns:
        the implementation diagram actions.
      • createObjectDiagramActions

        @OpenApi
        public MDActionsManager createObjectDiagramActions()
        Creates the actions for object diagram
        Returns:
        the object diagram actions.
      • createPackageDiagramActions

        @OpenApi
        public MDActionsManager createPackageDiagramActions()
        Creates the actions for package diagram
        Returns:
        the package diagram actions.
      • createComponentDiagramActions

        @OpenApi
        public MDActionsManager createComponentDiagramActions()
        Creates the actions for component diagram
        Returns:
        the component diagram actions.
      • createDeploymentDiagramActions

        @OpenApi
        public MDActionsManager createDeploymentDiagramActions()
        Creates the actions for deployment diagram
        Returns:
        the deployment diagram actions.
      • createProfileDiagramActions

        @OpenApi
        public MDActionsManager createProfileDiagramActions()
        Creates the actions for profile diagram
        Returns:
        the profile diagram actions.
      • createCompositeStructureDiagramActions

        @OpenApi
        public MDActionsManager createCompositeStructureDiagramActions()
        Creates the actions for composite structure diagram
        Returns:
        the composite structure diagram actions.
      • createDiagramsActionsManager

        public DiagramsActionsManager createDiagramsActionsManager()
        Creates the action managers for diagrams
        Returns:
        all diagrams actions.
      • createAnyDiagramActions

        @OpenApi
        public MDActionsManager createAnyDiagramActions()
        Creates the actions for any abstract diagram.
        Returns:
        the abstract diagram actions.
      • createDiagramAction

        private static com.nomagic.magicdraw.ui.actions.BaseDiagramAction createDiagramAction​(ActionsCategory category,
                                                                                              java.lang.String id,
                                                                                              @CheckForNull
                                                                                              javax.swing.KeyStroke key)
        Creates diagram action.
        Parameters:
        category - category of action.
        id - action id.
        key - keystroke of action.
      • createAction

        private static NMAction createAction​(ActionsCategory category,
                                             java.lang.String id,
                                             @CheckForNull
                                             javax.swing.KeyStroke key,
                                             @CheckForNull
                                             java.lang.String group)
        Creates action.
        Parameters:
        category - category of action.
        id - action id.
        key - keystroke of action.
        group - group of action.
      • createAction

        private static NMAction createAction​(ActionsCategory category,
                                             java.lang.String id,
                                             @CheckForNull
                                             javax.swing.KeyStroke keyStroke,
                                             @CheckForNull
                                             java.lang.String group,
                                             @CheckForNull
                                             java.lang.String key)
        Creates action.
        Parameters:
        category - category of action.
        id - action id.
        keyStroke - keystroke of action.
        group - group of action.
        key - key which is used getting name from resources.
      • createCategory

        private static ActionsCategory createCategory​(java.lang.String id)
        Creates actions category.
        Parameters:
        id - action id.
      • createCategory

        private static ActionsCategory createCategory​(java.lang.String actionID,
                                                      java.lang.String name)
        Creates category with given id and name.
        Parameters:
        actionID - action id
        name - of category
        Returns:
        created category
      • storeDefaultConfiguration

        public void storeDefaultConfiguration()
      • applyDefaultConfiguration

        public void applyDefaultConfiguration​(java.util.Collection<NMAction> actions)
      • createDiagramContextToolbarActions

        public MDActionsManager createDiagramContextToolbarActions()
      • createDiagramContextToolbarAction

        private static DiagramContextToolbarAction createDiagramContextToolbarAction​(ActionsCategory category,
                                                                                     java.lang.String id,
                                                                                     @CheckForNull
                                                                                     javax.swing.Icon icon)
        Creates action.
        Parameters:
        category - category of action.
        id - action id.