Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary
`private Legend[]` | `legends`
`private List<LegendFormats>` | `oldLegendFormats`
`private List<Float>[]` | `oldTreeValues`
`private Node` | `root`
`private boolean` | `storeLegendFormats`
`private DistanceAdapter[]` | `targetAdapters`

Constructor Summary
`DistanceValuesBackup(Tree tree, Node root, DistanceAdapter[] targetAdapters)`

Method Summary
`boolean` | `containsLegendFormats()` Returns whether legend formats have been stored.
`Legend[]` | `getLegends()`
`private int` | `restoreSubtreeValues(Node root, int index)` Assigns the previously saved line widths to the branches in the subtree under root.
`void` | `restoreValues()`
`private void` | `saveOldLegendValues()`
`private void` | `saveOldSubtreeValues(Node root)` Saves the old widths in a linear list (ordering is root, child 0..n)
`private void` | `saveOldTreeValues()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### DistanceValuesBackup

    public DistanceValuesBackup(Tree tree,
                                Node root,
                                DistanceAdapter[] targetAdapters)

Method Detail

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD