org.grinvin.gred.undoable

Class RemoveElements

Implemented Interfaces:
UndoableChange

public class RemoveElements
extends InternationalizedUndoableChange

Undoable change for removing elements from a graph.

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

Constructor Summary

RemoveElements(Graph graph, List elements)
Create an undoable change object for removing elements from a graph.
RemoveElements(Graph graph, Element element)
Create an undoable object for removing a single element from a graph.

Method Summary

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

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

getRedoCaption, getUndoCaption, redo, undo

Constructor Details

RemoveElements

public RemoveElements(Graph graph,
                      List elements)
Create an undoable change object for removing elements from a graph.
Parameters:
graph - Graph from which the elements were removed
elements - Elements removed from this graph.

RemoveElements

public RemoveElements(Graph graph,
                      Element element)
Create an undoable object for removing a single element from a graph.

Method Details

redo

public void redo()
Redoes this change by removing the elements in chronological order.
Overrides:
redo in interface InternationalizedUndoableChange

undo

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