use of org.exbin.deltahex.operation.BinaryDataCommand in project deltahex-java by exbin.
the class CodeAreaUndoHandler method commandAdded.
private void commandAdded(@Nonnull BinaryDataCommand addedCommand) {
// TODO: Check for undoOperationsMaximumCount & size
while (commands.size() > commandPosition) {
BinaryDataCommand command = commands.get((int) commandPosition);
try {
command.dispose();
} catch (BinaryDataOperationException ex) {
Logger.getLogger(CodeAreaUndoHandler.class.getName()).log(Level.SEVERE, null, ex);
}
commands.remove(command);
}
commands.add(addedCommand);
commandPosition++;
undoUpdated();
for (BinaryDataUndoUpdateListener listener : listeners) {
listener.undoCommandAdded(addedCommand);
}
}
use of org.exbin.deltahex.operation.BinaryDataCommand in project deltahex-java by exbin.
the class CodeAreaUndoHandler method performUndoInt.
private void performUndoInt() throws BinaryDataOperationException {
commandPosition--;
BinaryDataCommand command = commands.get((int) commandPosition);
command.undo();
}
use of org.exbin.deltahex.operation.BinaryDataCommand in project deltahex-java by exbin.
the class HexCompoundCommand method undo.
@Override
public void undo() throws BinaryDataOperationException {
for (int i = commands.size() - 1; i >= 0; i--) {
BinaryDataCommand command = commands.get(i);
command.undo();
}
}
use of org.exbin.deltahex.operation.BinaryDataCommand in project deltahex-java by exbin.
the class CodeAreaUndoHandler method clear.
@Override
public void clear() {
for (BinaryDataCommand command : commands) {
try {
command.dispose();
} catch (BinaryDataOperationException ex) {
Logger.getLogger(CodeAreaUndoHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}
commands.clear();
init();
undoUpdated();
}
use of org.exbin.deltahex.operation.BinaryDataCommand in project deltahex-java by exbin.
the class CodeAreaUndoHandler method performRedoInt.
private void performRedoInt() throws BinaryDataOperationException {
BinaryDataCommand command = commands.get((int) commandPosition);
command.redo();
commandPosition++;
}
Aggregations