info.bioinfweb.treegraph.graphics.positionpaint
Class RectangularCladogramPainter

java.lang.Object
  extended by info.bioinfweb.treegraph.graphics.positionpaint.RectangularCladogramPainter
All Implemented Interfaces:
TreePainter
Direct Known Subclasses:
PhylogramPainter

public class RectangularCladogramPainter
extends Object
implements TreePainter


Field Summary
private  Document document
           
private  int dX
           
private  int dY
           
private static RectangularCladogramPainter firstInstance
           
private  Graphics2D g
           
private  float pixelsPerMillimeter
           
static DecimalFormat SCALE_BAR_LABEL_FORMAT
           
private  TreeSelection selection
           
static float SELECTION_DISTANCE
           
static float SHORT_DASH_SCALE_FACTOR
           
protected  PositionPaintType type
           
static float UNDERLINE_DISTANCE_FACTOR
           
static float UNDERLINE_LINE_WIDTH_FACTOR
           
static float UNDERLINE_X_SHIFT_FACTOR
           
 
Constructor Summary
protected RectangularCladogramPainter()
           
 
Method Summary
static RectangularCladogramPainter getInstance()
           
private  void paintBranch(Branch b)
           
private  void paintInternalNode(Node n)
          Paints the given node.
private  void paintLabelBlock(Labels labels, boolean above)
           
private  void paintLeaf(Node leaf)
           
private  void paintLegend(Legend l)
           
private  void paintPointNode(Node n)
           
private  void paintScaleBar(ScaleBar scaleBar)
           
private  void paintSelection(ConcretePaintableElement element)
           
private  void paintSubtree(Node root)
           
private  float paintText(String text, TextFormats f, float x, float y)
           
 void paintTree(Graphics2D g, Document document, TreeSelection selection, int x, int y, float pixelsPerMillimeter, boolean transparent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTION_DISTANCE

public static final float SELECTION_DISTANCE
See Also:
Constant Field Values

UNDERLINE_DISTANCE_FACTOR

public static final float UNDERLINE_DISTANCE_FACTOR
See Also:
Constant Field Values

UNDERLINE_LINE_WIDTH_FACTOR

public static final float UNDERLINE_LINE_WIDTH_FACTOR
See Also:
Constant Field Values

UNDERLINE_X_SHIFT_FACTOR

public static final float UNDERLINE_X_SHIFT_FACTOR
See Also:
Constant Field Values

SHORT_DASH_SCALE_FACTOR

public static final float SHORT_DASH_SCALE_FACTOR
See Also:
Constant Field Values

SCALE_BAR_LABEL_FORMAT

public static final DecimalFormat SCALE_BAR_LABEL_FORMAT

firstInstance

private static RectangularCladogramPainter firstInstance

type

protected PositionPaintType type

g

private Graphics2D g

document

private Document document

selection

private TreeSelection selection

dX

private int dX

dY

private int dY

pixelsPerMillimeter

private float pixelsPerMillimeter
Constructor Detail

RectangularCladogramPainter

protected RectangularCladogramPainter()
Method Detail

getInstance

public static RectangularCladogramPainter getInstance()

paintSelection

private void paintSelection(ConcretePaintableElement element)

paintText

private float paintText(String text,
                        TextFormats f,
                        float x,
                        float y)

paintBranch

private void paintBranch(Branch b)

paintLabelBlock

private void paintLabelBlock(Labels labels,
                             boolean above)

paintInternalNode

private void paintInternalNode(Node n)
Paints the given node.

Parameters:
n - the node to paint

paintPointNode

private void paintPointNode(Node n)

paintLeaf

private void paintLeaf(Node leaf)

paintSubtree

private void paintSubtree(Node root)

paintScaleBar

private void paintScaleBar(ScaleBar scaleBar)

paintLegend

private void paintLegend(Legend l)

paintTree

public void paintTree(Graphics2D g,
                      Document document,
                      TreeSelection selection,
                      int x,
                      int y,
                      float pixelsPerMillimeter,
                      boolean transparent)
Specified by:
paintTree in interface TreePainter
selection - - a list of the selected elements
transparent - determines weather the background should be filled in the background color of the document