info.bioinfweb.treegraph.document.undo.file
Class ApplyNameTableEdit
java.lang.Object
  
info.bioinfweb.treegraph.document.undo.DocumentEdit
      
info.bioinfweb.treegraph.document.undo.file.ApplyNameTableEdit
- All Implemented Interfaces: 
 - UndoableEdit
 
public class ApplyNameTableEdit
- extends DocumentEdit
 
 
 
 
| 
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 java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
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
ApplyNameTableEdit
public ApplyNameTableEdit(Document document,
                          NodeBranchDataAdapter adapter,
                          List<String> oldNames,
                          List<String> newNames,
                          boolean ignoreWhitespaces,
                          boolean caseSensitive,
                          boolean parseNumericValues)
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