Class UndoControl<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMaxUndoStates()
      Returns the maximum number of undo states saved for each map.
      void redo()
      "Redo" was selected.
      void setAction​(@NotNull javax.swing.Action action, @NotNull java.lang.String name)
      Sets the Action instance for this editor action.
      void setMaxUndoStates​(int maxUndoStates)
      Sets the maximum number of undo states saved for each map.
      void undo()
      "Undo" was selected.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UndoControl

        public UndoControl​(@NotNull
                           @NotNull MapManager<G,​A,​R> mapManager,
                           @NotNull
                           @NotNull GameObjectFactory<G,​A,​R> gameObjectFactory,
                           @NotNull
                           @NotNull GameObjectMatchers gameObjectMatchers)
        Creates a new instance.
        Parameters:
        mapManager - the map manager
        gameObjectFactory - the game object factory to use
        gameObjectMatchers - the game object matchers to use
    • Method Detail

      • undo

        @ActionMethod
        public void undo()
        "Undo" was selected.
      • redo

        @ActionMethod
        public void redo()
        "Redo" was selected.
      • getMaxUndoStates

        public int getMaxUndoStates()
        Returns the maximum number of undo states saved for each map.
        Returns:
        the maximum number of undo states saved for each map; 0=unlimited
      • setMaxUndoStates

        public void setMaxUndoStates​(int maxUndoStates)
        Sets the maximum number of undo states saved for each map.
        Parameters:
        maxUndoStates - the maximum number of undo states saved for each map; 0=unlimited
      • setAction

        public void setAction​(@NotNull
                              @NotNull javax.swing.Action action,
                              @NotNull
                              @NotNull java.lang.String name)
        Description copied from interface: EditorAction
        Sets the Action instance for this editor action.
        Specified by:
        setAction in interface EditorAction
        Parameters:
        action - the action instance
        name - the name of the action