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
Constructor and Description |
---|
UndoControl(MapManager<G,A,R> mapManager,
GameObjectFactory<G,A,R> gameObjectFactory,
GameObjectMatchers gameObjectMatchers)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxUndoStates()
Returns the maximum number of undo states saved for each map.
|
void |
redo()
"Redo" was selected.
|
void |
setAction(javax.swing.Action action,
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.
|
public UndoControl(@NotNull MapManager<G,A,R> mapManager, @NotNull GameObjectFactory<G,A,R> gameObjectFactory, @NotNull GameObjectMatchers gameObjectMatchers)
mapManager
- the map managergameObjectFactory
- the game object factory to usegameObjectMatchers
- the game object matchers to use@ActionMethod public void undo()
@ActionMethod public void redo()
public int getMaxUndoStates()
0
=unlimitedpublic void setMaxUndoStates(int maxUndoStates)
maxUndoStates
- the maximum number of undo states saved for each
map; 0
=unlimitedpublic void setAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)
Action
instance for this editor action.setAction
in interface EditorAction
action
- the action instancename
- the name of the action