Class DiagramsActionsManager


  • @OpenApiAll
    public class DiagramsActionsManager
    extends java.lang.Object
    The class responsible for managing the actions used in all kind of diagrams. All actions in this manager are grouped by diagram type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.util.function.Supplier<ActionsManager>> mManagers
      The map of the managers.
    • Field Detail

      • mManagers

        private final java.util.Map<java.lang.String,​java.util.function.Supplier<ActionsManager>> mManagers
        The map of the managers. The map has such structure: diagram type - diagram actions manager.
    • Constructor Detail

      • DiagramsActionsManager

        public DiagramsActionsManager()
    • Method Detail

      • getManager

        @CheckForNull
        public ActionsManager getManager​(java.lang.String type)
        Returns the manager for the given diagram type.
        Returns:
        the manager for the given diagram type.
      • addManager

        public void addManager​(java.lang.String type,
                               java.util.function.Supplier<ActionsManager> manager)
        Adds the given manager of the given diagram type.
        Parameters:
        type - the type of the diagram.
        manager - the given manager.
      • removeManager

        public void removeManager​(java.lang.String type)
        Removes the added manager of the given diagram type.
        Parameters:
        type - the type of the diagram.
      • getManagers

        public java.util.List<ActionsManager> getManagers()
        Returns the list of all managers.
        Returns:
        the list of all managers.
      • managerStream

        private java.util.stream.Stream<ActionsManager> managerStream()
      • getActionFor

        @CheckForNull
        public NMAction getActionFor​(javax.swing.KeyStroke stroke)
        Return the action for given stroke. It looks in all managers.
        Returns:
        the action for given stroke or null if there are no action with such stroke.