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
Class Labels

    java.lang.Object
      info.bioinfweb.treegraph.document.Labels

All Implemented Interfaces:
  java.lang.Cloneable

    public class Labels

extends java.lang.Object
implements java.lang.Cloneable

This class stores the Labels of a Node and provides infomation about whole rows and columns.

Author:
  BenStoever

Field Summary
`private static int` | `CAPACITY_INCREMENT`
`private Branch` | `holdingBranch`
`private static int` | `INITIAL_CAPACITY`
`private java.util.Vector<LabelLine>` | `labelLinesAbove`
`private java.util.Vector<LabelLine>` | `labelLinesBelow`

Constructor Summary
`Labels(Branch holdingBranch)`

Method Summary
`int` | `add(Label label)` Adds a label to the List.
`float` | `blockHeight(PositionPaintType type, boolean above, float spacing)` Returns the overall height of all rows of labels above or below the node.
`float` | `blockWidth(PositionPaintType type, float spacing)` Returns the maximum width of all lines of labels above and below the branch without the block margin defined in the formats of the accordant document.
`void` | `clear()`
`Labels` | `clone()` Returns a deep copy of this `Labels`-object (including copys of all `LabelLine`-objects and their `Labels`.
`boolean` | `contains(Label label)`
`boolean` | `containsSameID(Labels other)`
`private boolean` | `containsSameID(Labels other, boolean above)`
`Label` | `get(boolean above, int lineNo, int lineIndex)` Returns the label at the specified position
`Label` | `get(java.lang.String id)`
`Branch` | `getHoldingBranch()`
`boolean` | `isEmpty()` Tests if any labels are present
`int` | `labelCount(boolean above, int lineNo)` Returns the number of labels in the specified line.
`int` | `lineCount(boolean above)`
`float` | `lineDescent(boolean above, int lineNumber)`
`float` | `lineHeight(PositionPaintType type, boolean above, int lineNumber)`
`float` | `lineWidth(PositionPaintType type, boolean above, int lineNumber, float spacing)` Returns the width of the specified line
`private void` | `reduceLabelLineVectors()`
`boolean` | `reinsert(Label label)`
`boolean` | `remove(Label label)`
`private Label` | `searchByID(java.lang.String id, boolean above)`
`void` | `setHoldingBranch(Branch holdingBranch)`

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

Field Detail

### INITIAL_CAPACITY

    private static final int INITIAL_CAPACITY

See Also:
  Constant Field Values

### CAPACITY_INCREMENT

    private static final int CAPACITY_INCREMENT

See Also:
  Constant Field Values

### holdingBranch

    private Branch holdingBranch

### labelLinesAbove

    private java.util.Vector<LabelLine> labelLinesAbove

### labelLinesBelow

    private java.util.Vector<LabelLine> labelLinesBelow

Constructor Detail

### Labels

    public Labels(Branch holdingBranch)

Method Detail

### getHoldingBranch

    public Branch getHoldingBranch()

### setHoldingBranch

    public void setHoldingBranch(Branch holdingBranch)

### reduceLabelLineVectors

    private void reduceLabelLineVectors()

### add

    public int add(Label label)

  Adds a label to the List.

  Parameters:
    `label` - the label to add
  Returns:
    the index the label has in its line

### remove

    public boolean remove(Label label)

### reinsert

    public boolean reinsert(Label label)

### get

    public Label get(boolean above,
                     int lineNo,
                     int lineIndex)

  Returns the label at the specified position

  Parameters:
    `above` - indicates wheather the label is above the branch
    `lineNo` - the number of the line the label in located in (below or above the branch) The first line has the index 0.
    `lineIndex` - the position in the line counted from the left (Does not equal the linePosition value.)
  Returns:
    the label at the specified position

### searchByID

    private Label searchByID(java.lang.String id,
                             boolean above)

### get

    public Label get(java.lang.String id)

### contains

    public boolean contains(Label label)

### clear

    public void clear()

### isEmpty

    public boolean isEmpty()

  Tests if any labels are present

  Returns:
    true if labels are present

### lineCount

    public int lineCount(boolean above)

### labelCount

    public int labelCount(boolean above,
                          int lineNo)

  Returns the number of labels in the specified line.

### lineWidth

    public float lineWidth(PositionPaintType type,
                           boolean above,
                           int lineNumber,
                           float spacing)

  Returns the width of the specified line

  Parameters:
    `id` - the id of the treepositioner used to position the paintable elements
    `above` - indicates wheather the line widths above or below the branch should be returned
    `spacing` - the vertical spacing in millimeters between two labels in one line (depends on the user values in the current document)
  Returns:
    the width of the line in millimeters including the specified spacing between each label

### blockWidth

    public float blockWidth(PositionPaintType type,
                            float spacing)

  Returns the maximum width of all lines of labels above and below the branch without the block margin defined in the formats of the accordant document.

  Parameters:
    `id` -
    `spacing` -
  Returns:
    the maximum width in millimeters

### lineHeight

    public float lineHeight(PositionPaintType type,
                            boolean above,
                            int lineNumber)

### lineDescent

    public float lineDescent(boolean above,
                             int lineNumber)

### blockHeight

    public float blockHeight(PositionPaintType type,
                             boolean above,
                             float spacing)

  Returns the overall height of all rows of labels above or below the node. The value does not include the block margin defined in the formats of the accordant document.

  Returns:
    the width in pixels

### containsSameID

    private boolean containsSameID(Labels other,
                                   boolean above)

### containsSameID

    public boolean containsSameID(Labels other)

### clone

    public Labels clone()

  Returns a deep copy of this `Labels`-object (including copys of all `LabelLine`-objects and their `Labels`. Note that the holding branch is still the same as in the original `Labels`-object.

  Overrides:
    `clone` in class `java.lang.Object`

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