Package net.sf.gridarta.gui.undo
Class UndoControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.undo.UndoControl<G,A,R>
-
- All Implemented Interfaces:
EditorAction
public class UndoControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction
Implements the controller for undo/redo actions.
-
-
Constructor Summary
Constructors Constructor Description UndoControl(@NotNull MapManager<G,A,R> mapManager, @NotNull GameObjectFactory<G,A,R> gameObjectFactory, @NotNull GameObjectMatchers gameObjectMatchers)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxUndoStates()Returns the maximum number of undo states saved for each map.voidredo()"Redo" was selected.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.voidsetMaxUndoStates(int maxUndoStates)Sets the maximum number of undo states saved for each map.voidundo()"Undo" was selected.
-
-
-
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 managergameObjectFactory- the game object factory to usegameObjectMatchers- 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:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
-