Changeset 14281 in josm for trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
- Timestamp:
- 2018-09-30T00:46:01+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r14220 r14281 25 25 * 26 26 * @see #getLastCommand() 27 * @see #getUndoCommands() 27 28 */ 28 29 public final LinkedList<Command> commands = new LinkedList<>(); 30 29 31 /** 30 32 * The stack for redoing commands 33 34 * @see #getRedoCommands() 31 35 */ 32 36 public final LinkedList<Command> redoCommands = new LinkedList<>(); … … 232 236 233 237 /** 238 * Returns all commands that were made on the dataset, that can be undone. 239 * @return all commands that were made on the dataset, that can be undone 240 * @since 14281 241 */ 242 public LinkedList<Command> getUndoCommands() { 243 return new LinkedList<>(commands); 244 } 245 246 /** 247 * Returns all commands that were made and undone on the dataset, that can be redone. 248 * @return all commands that were made and undone on the dataset, that can be redone. 249 * @since 14281 250 */ 251 public LinkedList<Command> getRedoCommands() { 252 return new LinkedList<>(redoCommands); 253 } 254 255 /** 234 256 * Gets the last command that was executed on the command stack. 235 257 * @return That command or <code>null</code> if there is no such command. … … 238 260 public Command getLastCommand() { 239 261 return commands.peekLast(); 262 } 263 264 /** 265 * Determines if commands can be undone. 266 * @return {14281 true} if at least a command can be undone 267 * @since xxx 268 */ 269 public boolean hasUndoCommands() { 270 return !commands.isEmpty(); 271 } 272 273 /** 274 * Determines if commands can be redone. 275 * @return {@code true} if at least a command can be redone 276 * @since 14281 277 */ 278 public boolean hasRedoCommands() { 279 return !redoCommands.isEmpty(); 240 280 } 241 281
Note:
See TracChangeset
for help on using the changeset viewer.