Home / Development / Documentation / 2.0.44 / ApplyNameTableEdit
TreeGraph 2
 


info.bioinfweb.treegraph.document.undo.file
Class ApplyNameTableEdit

java.lang.Object
  extended by info.bioinfweb.treegraph.document.undo.DocumentEdit
      extended by info.bioinfweb.treegraph.document.undo.file.ApplyNameTableEdit
All Implemented Interfaces:
UndoableEdit

public class ApplyNameTableEdit
extends DocumentEdit


Field Summary
private  NodeBranchDataAdapter adapter
           
private  boolean caseSensitive
           
private  boolean ignoreWhitespaces
           
private  List<String> newNames
           
private  List<String> oldNames
           
private  boolean parseNumericValues
           
private  List<TextElementData> savedValues
           
 
Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
document
 
Constructor Summary
ApplyNameTableEdit(Document document, NodeBranchDataAdapter adapter, List<String> oldNames, List<String> newNames, boolean ignoreWhitespaces, boolean caseSensitive, boolean parseNumericValues)
           
 
Method Summary
private  int findDecimal(List<String> list, double value)
          Returns the index of the first string that represents the specified double value.
private  int findString(List<String> list, String value)
           
 String getPresentationName()
           
static void loadNameTable(File file, Vector<String> oldNames, Vector<String> newNames, char separator)
           
static void loadNameTable(InputStream stream, Vector<String> oldNames, Vector<String> newNames, char separator)
           
 void redo()
           
private  void rename(Node root, List<String> oldNames, List<String> newNames)
           
private  int restoreNames(Node root, int pos)
           
 void undo()
           
 
Methods inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
addEdit, canRedo, canUndo, die, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, setIsSubedit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adapter

private NodeBranchDataAdapter adapter

oldNames

private List<String> oldNames

newNames

private List<String> newNames

savedValues

private List<TextElementData> savedValues

ignoreWhitespaces

private boolean ignoreWhitespaces

caseSensitive

private boolean caseSensitive

parseNumericValues

private boolean parseNumericValues
Constructor Detail

ApplyNameTableEdit

public ApplyNameTableEdit(Document document,
                          NodeBranchDataAdapter adapter,
                          List<String> oldNames,
                          List<String> newNames,
                          boolean ignoreWhitespaces,
                          boolean caseSensitive,
                          boolean parseNumericValues)
Method Detail

findDecimal

private int findDecimal(List<String> list,
                        double value)
Returns the index of the first string that represents the specified double value.

Parameters:
list -
value -
Returns:
the index or -1 of the value is not found

findString

private int findString(List<String> list,
                       String value)

rename

private void rename(Node root,
                    List<String> oldNames,
                    List<String> newNames)

redo

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

restoreNames

private int restoreNames(Node root,
                         int pos)

undo

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

getPresentationName

public String getPresentationName()

loadNameTable

public static void loadNameTable(File file,
                                 Vector<String> oldNames,
                                 Vector<String> newNames,
                                 char separator)
                          throws FileNotFoundException,
                                 IOException,
                                 InvalidFormatException
Throws:
FileNotFoundException
IOException
InvalidFormatException

loadNameTable

public static void loadNameTable(InputStream stream,
                                 Vector<String> oldNames,
                                 Vector<String> newNames,
                                 char separator)
                          throws IOException,
                                 InvalidFormatException
Throws:
IOException
InvalidFormatException