Changeset 6413 in josm for trunk/src/org
- Timestamp:
- 2013-11-25T02:19:43+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r6380 r6413 12 12 import org.openstreetmap.josm.gui.layer.Layer; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 14 import org.openstreetmap.josm.tools.CheckParameterUtil; 14 15 15 16 public class UndoRedoHandler implements MapView.LayerChangeListener { … … 26 27 private final LinkedList<CommandQueueListener> listenerCommands = new LinkedList<CommandQueueListener>(); 27 28 29 /** 30 * Constructs a new {@code UndoRedoHandler}. 31 */ 28 32 public UndoRedoHandler() { 29 33 MapView.addLayerChangeListener(this); … … 31 35 32 36 /** 33 * Execute the command and add it to the intern command queue. 37 * Executes the command and add it to the intern command queue. 38 * @param c The command to execute. Must not be {@code null}. 34 39 */ 35 40 public void addNoRedraw(final Command c) { 41 CheckParameterUtil.ensureParameterNotNull(c, "c"); 36 42 c.executeCommand(); 37 43 commands.add(c); … … 53 59 54 60 /** 55 * Execute the command and add it to the intern command queue. 61 * Executes the command and add it to the intern command queue. 62 * @param c The command to execute. Must not be {@code null}. 56 63 */ 57 64 synchronized public void add(final Command c) { … … 69 76 /** 70 77 * Undoes multiple commands. 78 * @param num The number of commands to undo 71 79 */ 72 80 synchronized public void undo(int num) { … … 104 112 /** 105 113 * Redoes multiple commands. 114 * @param num The number of commands to redo 106 115 */ 107 116 public void redo(int num) { … … 167 176 public void activeLayerChange(Layer oldLayer, Layer newLayer) {} 168 177 178 /** 179 * Removes a command queue listener. 180 * @param l The command queue listener to remove 181 */ 169 182 public void removeCommandQueueListener(CommandQueueListener l) { 170 183 listenerCommands.remove(l); 171 184 } 172 185 186 /** 187 * Adds a command queue listener. 188 * @param l The commands queue listener to add 189 * @return {@code true} if the listener has been added, {@code false} otherwise 190 */ 173 191 public boolean addCommandQueueListener(CommandQueueListener l) { 174 192 return listenerCommands.add(l);
Note:
See TracChangeset
for help on using the changeset viewer.