info.bioinfweb.treegraph.document.undo.edit
Class DeleteEdit

java.lang.Object
  extended by info.bioinfweb.treegraph.document.undo.DocumentEdit
      extended by info.bioinfweb.treegraph.document.undo.edit.DeleteEdit
All Implemented Interfaces:
WarningEdit, javax.swing.undo.UndoableEdit
Direct Known Subclasses:
CutEdit

public class DeleteEdit
extends DocumentEdit
implements WarningEdit

Removes all elements currently selected. RemoveSubtreeEdit, RemoveLabelEdit and RemoveLegendEdit are used internally.

Author:
Ben Stöver

Field Summary
private  java.util.Vector<DocumentEdit> edits
           
private  java.util.Vector<ConcretePaintableElement> elements
           
private  boolean showWarnings
           
 
Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
document
 
Constructor Summary
DeleteEdit(Document document, ConcretePaintableElement[] elements, boolean showWarnings)
           
 
Method Summary
private  boolean containsParent(Node node)
           
private  void createSubedits()
           
private  void deleteSubtreeElements()
           
 java.lang.String getPresentationName()
           
 boolean getShowWarnings()
           
 void redo()
           
 void setShowWarnings(boolean showWarnings)
           
 void undo()
           
 
Methods inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

private java.util.Vector<ConcretePaintableElement> elements

edits

private java.util.Vector<DocumentEdit> edits

showWarnings

private boolean showWarnings
Constructor Detail

DeleteEdit

public DeleteEdit(Document document,
                  ConcretePaintableElement[] elements,
                  boolean showWarnings)
Method Detail

getShowWarnings

public boolean getShowWarnings()
Specified by:
getShowWarnings in interface WarningEdit

setShowWarnings

public void setShowWarnings(boolean showWarnings)
Specified by:
setShowWarnings in interface WarningEdit

containsParent

private boolean containsParent(Node node)

deleteSubtreeElements

private void deleteSubtreeElements()

createSubedits

private void createSubedits()

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class DocumentEdit
Throws:
javax.swing.undo.CannotRedoException

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class DocumentEdit
Throws:
javax.swing.undo.CannotUndoException

getPresentationName

public java.lang.String getPresentationName()
Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit