info.bioinfweb.treegraph.document.undo
Class SaveLegendsEdit
java.lang.Object
  
info.bioinfweb.treegraph.document.undo.DocumentEdit
      
info.bioinfweb.treegraph.document.undo.SaveLegendsEdit
- All Implemented Interfaces: 
 - WarningEdit, UndoableEdit
 
- Direct Known Subclasses: 
 - CollapseNodeEdit, DeleteSubelementsEdit, InsertRemoveSubtreeEdit
 
public abstract class SaveLegendsEdit
- extends DocumentEdit
- implements WarningEdit
  
This class should be a superclass of all classes that might delete nodes which are anchors to
 legends. It offers the methods saveLegends() which can be called from the 
 redo()-method and restoreLegends() which can be called from the 
 undo()-method.
- Author:
 
  - Ben Stöver
 
 
 
 
 
| Methods inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit | 
addEdit, canRedo, canUndo, die, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, redo, replaceEdit, setIsSubedit, undo | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
legendsSave
private Legend[] legendsSave
legendsReanchored
private boolean legendsReanchored
legendsRemoved
private boolean legendsRemoved
showWarnings
private boolean showWarnings
helpTopic
private int helpTopic
SaveLegendsEdit
public SaveLegendsEdit(Document document)
getLegendsSave
protected Legend[] getLegendsSave()
 
 
saveLegends
protected void saveLegends()
 
 
restoreLegends
protected void restoreLegends()
                       throws CannotUndoException
 
- Throws:
 CannotUndoException
 
getLegendsReanchored
public boolean getLegendsReanchored()
 
 
setLegendsReanchored
protected void setLegendsReanchored(boolean legendsReanchored)
 
 
getLegendsRemoved
public boolean getLegendsRemoved()
 
 
setLegendsRemoved
protected void setLegendsRemoved(boolean legendsRemoved)
 
 
getShowWarnings
public boolean getShowWarnings()
- Specified by:
 getShowWarnings in interface WarningEdit
 
 
setShowWarnings
public void setShowWarnings(boolean showWarnings)
- Specified by:
 setShowWarnings in interface WarningEdit
 
 
getHelpTopic
protected int getHelpTopic()
 
 
setHelpTopic
protected void setHelpTopic(int helpTopic)
 
 
getWarningsMessages
protected String getWarningsMessages()
 
 
showWarningDialog
protected void showWarningDialog()
 
 
editSubtreeLegends
protected void editSubtreeLegends(Node root)
- This method can be used to adopt the legends of a document prior to deleting a subtree.
 If all anchors of a legend are contained in the deleted subtree, the legend is 
 deleted as well. If only one of the anchors is in the deleted subtree this anchor is
 deleted but the other remains unchanged (if necessary the former second anchor becomes the 
 first) and the legend is left in the document.
 
- Parameters:
 root - the root node of the subtree that will be deleted later