jebl.gui.trees.treecomponent
Class SquareTreePainter

java.lang.Object
  extended by jebl.gui.trees.treecomponent.SquareTreePainter
All Implemented Interfaces:
RootedTreePainter

public class SquareTreePainter
extends Object
implements RootedTreePainter

Author:
Alexei Drummond

Field Summary
protected  Font hilightLabelFont
           
protected  Paint hilightLabelPaint
           
protected  Paint hilightPaint
           
protected  Stroke hilightStroke
           
protected  Font labelFont
           
protected  Paint labelPaint
           
protected  Paint linePaint
           
protected  Stroke lineStroke
           
protected  int maxFontSize
           
 
Constructor Summary
SquareTreePainter()
           
SquareTreePainter(boolean rememberYPositions)
           
 
Method Summary
 void drawHorizontals(boolean drawHorizontals)
           
 void drawLabels(boolean drawLabels)
           
 void drawVerticals(boolean drawVerticals)
           
 Node findNodeAtPoint(Point2D point)
          Find the node under point.
 void paintTree(Graphics2D g2, Dimension size, RootedTree tree)
          Do the actual painting.
 void setFontSize(int size)
           
 void setHilightLabelStyle(Font hilightLabelFont, Paint hilightLabelPaint)
          Set hilight label style.
 void setHilightStyle(Stroke hilightStroke, Paint hilightPaint)
          Set hilight style
 void setLabelStyle(Font labelFont, Paint labelPaint)
          Set label style.
 void setLinePaint(Paint linePaint)
          Set line style
 void setLineStyle(Stroke lineStroke, Paint linePaint)
          Set line style
 void setUserDefinedHeight(double height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineStroke

protected Stroke lineStroke

linePaint

protected Paint linePaint

hilightStroke

protected Stroke hilightStroke

hilightPaint

protected Paint hilightPaint

maxFontSize

protected int maxFontSize

labelFont

protected Font labelFont

labelPaint

protected Paint labelPaint

hilightLabelFont

protected Font hilightLabelFont

hilightLabelPaint

protected Paint hilightLabelPaint
Constructor Detail

SquareTreePainter

public SquareTreePainter()

SquareTreePainter

public SquareTreePainter(boolean rememberYPositions)
Method Detail

setLineStyle

public void setLineStyle(Stroke lineStroke,
                         Paint linePaint)
Set line style

Specified by:
setLineStyle in interface RootedTreePainter

setLinePaint

public void setLinePaint(Paint linePaint)
Set line style


setHilightStyle

public void setHilightStyle(Stroke hilightStroke,
                            Paint hilightPaint)
Set hilight style

Specified by:
setHilightStyle in interface RootedTreePainter

setFontSize

public void setFontSize(int size)

setLabelStyle

public void setLabelStyle(Font labelFont,
                          Paint labelPaint)
Set label style.

Specified by:
setLabelStyle in interface RootedTreePainter

setHilightLabelStyle

public void setHilightLabelStyle(Font hilightLabelFont,
                                 Paint hilightLabelPaint)
Set hilight label style.

Specified by:
setHilightLabelStyle in interface RootedTreePainter

setUserDefinedHeight

public void setUserDefinedHeight(double height)

drawLabels

public void drawLabels(boolean drawLabels)

drawHorizontals

public void drawHorizontals(boolean drawHorizontals)

drawVerticals

public void drawVerticals(boolean drawVerticals)

paintTree

public void paintTree(Graphics2D g2,
                      Dimension size,
                      RootedTree tree)
Do the actual painting.

Specified by:
paintTree in interface RootedTreePainter

findNodeAtPoint

public final Node findNodeAtPoint(Point2D point)
Find the node under point. Returns null if not found.

Specified by:
findNodeAtPoint in interface RootedTreePainter