Home / Development / Documentation / 2.0.44 / LabelFormats
TreeGraph 2
 


info.bioinfweb.treegraph.document.format
Class LabelFormats

java.lang.Object
  extended by info.bioinfweb.treegraph.document.format.LabelFormats
All Implemented Interfaces:
ElementFormats, Cloneable
Direct Known Subclasses:
GraphicalLabelFormats, TextLabelFormats

public class LabelFormats
extends Object
implements ElementFormats, Cloneable

Implements basic label formats.

Author:
Ben Stöver

Field Summary
private  boolean above
           
static float DEFAULT_MARGIN_IN_MM
           
private  int lineNumber
           
private  int linePosition
           
private  Margin margin
           
private  Label owner
           
 
Constructor Summary
LabelFormats(Label owner)
           
LabelFormats(Label owner, boolean above, int line, int linePosition)
           
 
Method Summary
 void assignLabelFormats(LabelFormats other)
           
 LabelFormats clone()
          Returns a deep copy with the owner null.
 int getLineNumber()
          The number of the line in which this label shall be displayed.
 int getLinePosition()
          If more than one element is located in the same line the line position is used to determine the order of the elements.
 Margin getMargin()
           
 Label getOwner()
           
 boolean isAbove()
           
private  void reinsert()
          If this object has an owner-Label this is reinserted into its Labels-object.
 void setAbove(boolean above)
           
 void setLineNumber(int line)
           
 void setLinePosition(int linePosition)
           
 void setOwner(Label labelOwner)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MARGIN_IN_MM

public static final float DEFAULT_MARGIN_IN_MM
See Also:
Constant Field Values

above

private boolean above

lineNumber

private int lineNumber

linePosition

private int linePosition

owner

private Label owner

margin

private Margin margin
Constructor Detail

LabelFormats

public LabelFormats(Label owner)

LabelFormats

public LabelFormats(Label owner,
                    boolean above,
                    int line,
                    int linePosition)
Method Detail

reinsert

private void reinsert()
If this object has an owner-Label this is reinserted into its Labels-object. This is necassary because the store-position in the Labels-object is dependent of the label position formats.


getLineNumber

public int getLineNumber()
The number of the line in which this label shall be displayed. The lines closest to the branch have the index 0. (i.e. line numbers above the branch increase from bottom to top and lines below the branch increase from top to bottom. If the branch is the paint start, label positions will be rotated counterclockwise.)

Returns:
the current line number

setLineNumber

public void setLineNumber(int line)

getLinePosition

public int getLinePosition()
If more than one element is located in the same line the line position is used to determine the order of the elements. Elements with a low line position are displayed on the left.

Returns:
the current value of line position

setLinePosition

public void setLinePosition(int linePosition)

setAbove

public void setAbove(boolean above)

isAbove

public boolean isAbove()

getOwner

public Label getOwner()

setOwner

public void setOwner(Label labelOwner)

getMargin

public Margin getMargin()

assignLabelFormats

public void assignLabelFormats(LabelFormats other)

clone

public LabelFormats clone()
Returns a deep copy with the owner null.

Specified by:
clone in interface ElementFormats
Overrides:
clone in class Object