org.grinvin.gred.undoable

Class AddElements

Implemented Interfaces:
UndoableChange

public class AddElements
extends InternationalizedUndoableChange

Undoable change for adding elements to a graph.

Internationalization: By default, the caption key prefix for this command is AddElements.

Constructor Summary

AddElements(UndoableGraph graph, List elements)
Create an undoable change for adding elements to a graph.
AddElements(UndoableGraph graph, Element element)
Create an undoable change for adding a single element to a graph.

Method Summary

void
redo()
Reverts an undo by restoring the elements in chronological order.
void
undo()
Undoes the effects of this change by removing the added elements in reverse chronological order.

Methods inherited from class org.grinvin.gred.undoable.InternationalizedUndoableChange

getRedoCaption, getUndoCaption, redo, undo

Constructor Details

AddElements

public AddElements(UndoableGraph graph,
                   List elements)
Create an undoable change for adding elements to a graph.
Parameters:
graph - Graph to which the elements were added
elements - Elements added to this graph, in chronological order.

AddElements

public AddElements(UndoableGraph graph,
                   Element element)
Create an undoable change for adding a single element to a graph.

Method Details

redo

public void redo()
Reverts an undo by restoring the elements in chronological order.
Overrides:
redo in interface InternationalizedUndoableChange

undo

public void undo()
Undoes the effects of this change by removing the added elements in reverse chronological order.
Overrides:
undo in interface InternationalizedUndoableChange