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:
- javax.swing.undo.UndoableEdit
public class ApplyNameTableEdit
- extends DocumentEdit
|
Constructor Summary |
ApplyNameTableEdit(Document document,
NodeBranchDataAdapter adapter,
java.util.List<java.lang.String> oldNames,
java.util.List<java.lang.String> newNames,
boolean ignoreWhitespaces,
boolean caseSensitive,
boolean parseNumericValues)
|
|
Method Summary |
private int |
findDecimal(java.util.List<java.lang.String> list,
double value)
Returns the index of the first string that represents the specified
double value. |
private int |
findString(java.util.List<java.lang.String> list,
java.lang.String value)
|
java.lang.String |
getPresentationName()
|
static void |
loadNameTable(java.io.File file,
java.util.Vector<java.lang.String> oldNames,
java.util.Vector<java.lang.String> newNames,
char separator)
|
static void |
loadNameTable(java.io.InputStream stream,
java.util.Vector<java.lang.String> oldNames,
java.util.Vector<java.lang.String> newNames,
char separator)
|
void |
redo()
|
private void |
rename(Node root,
java.util.List<java.lang.String> oldNames,
java.util.List<java.lang.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 java.util.List<java.lang.String> oldNames
newNames
private java.util.List<java.lang.String> newNames
savedValues
private java.util.List<TextElementData> savedValues
ignoreWhitespaces
private boolean ignoreWhitespaces
caseSensitive
private boolean caseSensitive
parseNumericValues
private boolean parseNumericValues
ApplyNameTableEdit
public ApplyNameTableEdit(Document document,
NodeBranchDataAdapter adapter,
java.util.List<java.lang.String> oldNames,
java.util.List<java.lang.String> newNames,
boolean ignoreWhitespaces,
boolean caseSensitive,
boolean parseNumericValues)
findDecimal
private int findDecimal(java.util.List<java.lang.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(java.util.List<java.lang.String> list,
java.lang.String value)
rename
private void rename(Node root,
java.util.List<java.lang.String> oldNames,
java.util.List<java.lang.String> newNames)
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
restoreNames
private int restoreNames(Node root,
int pos)
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()
loadNameTable
public static void loadNameTable(java.io.File file,
java.util.Vector<java.lang.String> oldNames,
java.util.Vector<java.lang.String> newNames,
char separator)
throws java.io.FileNotFoundException,
java.io.IOException,
InvalidFormatException
- Throws:
java.io.FileNotFoundException
java.io.IOException
InvalidFormatException
loadNameTable
public static void loadNameTable(java.io.InputStream stream,
java.util.Vector<java.lang.String> oldNames,
java.util.Vector<java.lang.String> newNames,
char separator)
throws java.io.IOException,
InvalidFormatException
- Throws:
java.io.IOException
InvalidFormatException