info.bioinfweb.treegraph.document
Class LabelLine

java.lang.Object
  extended by info.bioinfweb.treegraph.document.LabelLine
All Implemented Interfaces:
Cloneable

public class LabelLine
extends Object
implements Cloneable


Field Summary
private static int CAPACITY_INCREMENT
           
private static int INITIAL_CAPACITY
           
private  Vector<Label> line
           
 
Constructor Summary
LabelLine()
           
 
Method Summary
protected  LabelLine clone()
           
 boolean contains(Label label)
           
 Label get(int pos)
           
 float getDescent()
          Return the maximal descent of all labels in this line.
 float getHeight(PositionPaintType type)
           
 int getPosBeforeLinePos(int linePos)
          Returns the index of the label at the given line position.
 float getWidth(PositionPaintType type, float spacing)
           
 int indexOf(Label label)
           
 int insert(Label label)
           
 boolean remove(Label label)
           
 int size()
           
 
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

line

private Vector<Label> line
Constructor Detail

LabelLine

public LabelLine()
Method Detail

insert

public int insert(Label label)

remove

public boolean remove(Label label)

get

public Label get(int pos)

getPosBeforeLinePos

public int getPosBeforeLinePos(int linePos)
Returns the index of the label at the given line position. If no label has the given line position the element with the closest smaller position is returned. If there is no such element too, -1 is returned.

Parameters:
linePos -
Returns:
the index of the element in the line list.

contains

public boolean contains(Label label)

size

public int size()

getWidth

public float getWidth(PositionPaintType type,
                      float spacing)

getHeight

public float getHeight(PositionPaintType type)

getDescent

public float getDescent()
Return the maximal descent of all labels in this line. The descent is the distance from the baseline to the bottom (left) of the text.

Returns:
the descent in millimeters

clone

protected LabelLine clone()
Overrides:
clone in class Object

indexOf

public int indexOf(Label label)