info.bioinfweb.treegraph.document.undo.format
Class DistanceValuesBackup
java.lang.Object
info.bioinfweb.treegraph.document.undo.format.DistanceValuesBackup
public class DistanceValuesBackup
- extends Object
Backups all distance values specified by the constructor parameter targetAdapters
including legends line widths and text heights.
- Since:
- 2.0.24
- Author:
- Ben Stöver
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
private Node root
legends
private Legend[] legends
targetAdapters
private DistanceAdapter[] targetAdapters
oldTreeValues
private List<Float>[] oldTreeValues
storeLegendFormats
private boolean storeLegendFormats
oldLegendFormats
private List<LegendFormats> oldLegendFormats
DistanceValuesBackup
public DistanceValuesBackup(Tree tree,
Node root,
DistanceAdapter[] targetAdapters)
containsLegendFormats
public boolean containsLegendFormats()
- Returns whether legend formats have been stored. This is
true
if the specified
targetAdapters
contained instances of subclasses of AbstractLegendAdapter
and does not necessarily mean that concrete values were found in the specified subtree.
- Returns:
getLegends
public Legend[] getLegends()
saveOldTreeValues
private void saveOldTreeValues()
saveOldSubtreeValues
private void saveOldSubtreeValues(Node root)
- Saves the old widths in a linear list (ordering is root, child 0..n)
- Parameters:
root
-
saveOldLegendValues
private void saveOldLegendValues()
restoreValues
public void restoreValues()
restoreSubtreeValues
private int restoreSubtreeValues(Node root,
int index)
- Assigns the previously saved line widths to the branches in the subtree under
root.
- Parameters:
root
- index
- the index of the value for root in oldWidths
- Returns:
- the next unused index of
oldWidths