org.openstreetmap.josm.data
Class UndoRedoHandler

java.lang.Object
  extended by org.openstreetmap.josm.data.UndoRedoHandler
All Implemented Interfaces:
MapView.LayerChangeListener

public class UndoRedoHandler
extends java.lang.Object
implements MapView.LayerChangeListener


Field Summary
 java.util.LinkedList<Command> commands
          All commands that were made on the dataset.
private  java.util.LinkedList<OsmDataLayer.CommandQueueListener> listenerCommands
           
 java.util.LinkedList<Command> redoCommands
          The stack for redoing commands
 
Constructor Summary
UndoRedoHandler()
           
 
Method Summary
 void activeLayerChange(Layer oldLayer, Layer newLayer)
          Notifies this listener that the active layer has changed.
 void add(Command c)
          Execute the command and add it to the intern command queue.
 boolean addCommandQueueListener(OsmDataLayer.CommandQueueListener l)
           
 void addNoRedraw(Command c)
          Execute the command and add it to the intern command queue.
 void afterAdd()
           
 void clean()
           
 void clean(Layer layer)
           
 void fireCommandsChanged()
           
 void layerAdded(Layer newLayer)
          Notifies this listener that a layer has been added.
 void layerRemoved(Layer oldLayer)
          Notifies this listener that a layer has been removed.
 void redo()
          Redoes the last undoed command.
 void redo(int num)
          Redoes multiple commands.
 void removeCommandQueueListener(OsmDataLayer.CommandQueueListener l)
           
 void undo()
          Undoes the last added command.
 void undo(int num)
          Undoes multiple commands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commands

public final java.util.LinkedList<Command> commands
All commands that were made on the dataset. Don't write from outside!


redoCommands

public final java.util.LinkedList<Command> redoCommands
The stack for redoing commands


listenerCommands

private final java.util.LinkedList<OsmDataLayer.CommandQueueListener> listenerCommands
Constructor Detail

UndoRedoHandler

public UndoRedoHandler()
Method Detail

addNoRedraw

public void addNoRedraw(Command c)
Execute the command and add it to the intern command queue.


afterAdd

public void afterAdd()

add

public void add(Command c)
Execute the command and add it to the intern command queue.


undo

public void undo()
Undoes the last added command.


undo

public void undo(int num)
Undoes multiple commands.


redo

public void redo()
Redoes the last undoed command.


redo

public void redo(int num)
Redoes multiple commands.


fireCommandsChanged

public void fireCommandsChanged()

clean

public void clean()

clean

public void clean(Layer layer)

layerRemoved

public void layerRemoved(Layer oldLayer)
Description copied from interface: MapView.LayerChangeListener
Notifies this listener that a layer has been removed.

Specified by:
layerRemoved in interface MapView.LayerChangeListener
Parameters:
oldLayer - The old removed layer

layerAdded

public void layerAdded(Layer newLayer)
Description copied from interface: MapView.LayerChangeListener
Notifies this listener that a layer has been added.

Specified by:
layerAdded in interface MapView.LayerChangeListener
Parameters:
newLayer - The new added layer

activeLayerChange

public void activeLayerChange(Layer oldLayer,
                              Layer newLayer)
Description copied from interface: MapView.LayerChangeListener
Notifies this listener that the active layer has changed.

Specified by:
activeLayerChange in interface MapView.LayerChangeListener
Parameters:
oldLayer - The previous active layer
newLayer - The new activer layer

removeCommandQueueListener

public void removeCommandQueueListener(OsmDataLayer.CommandQueueListener l)

addCommandQueueListener

public boolean addCommandQueueListener(OsmDataLayer.CommandQueueListener l)


JOSM