jebl.gui.trees.treeviewer_dev.painters
Interface Painter<T>

All Known Implementing Classes:
AbstractPainter, BasicLabelPainter, LabelPainter, NodeBarPainter, NodePainter, NodeShapePainter, ScaleBarPainter

public interface Painter<T>

A painter draws a particular decoration onto the tree within a rectangle.

Author:
Andrew Rambaut

Nested Class Summary
static class Painter.Justification
           
static class Painter.Orientation
           
 
Method Summary
 void addPainterListener(PainterListener listener)
           
 Rectangle2D calibrate(Graphics2D g2, T item)
          Called to calibrate the painters for a given graphics context.
 double getHeightBound()
           
 double getPreferredHeight()
           
 double getPreferredWidth()
           
 boolean isVisible()
          If this is false then the painter should not be displayed.
 void paint(Graphics2D g2, T item, Painter.Justification justification, Rectangle2D bounds)
          Called to actually paint into the current graphics context.
 void removePainterListener(PainterListener listener)
           
 void setTreePane(TreePane treePane)
          Called when the painter is installed in a TreePane.
 

Method Detail

setTreePane

void setTreePane(TreePane treePane)
Called when the painter is installed in a TreePane. Gives the painter a handle on the TreePane so that it get additional information.

Parameters:
treePane -

isVisible

boolean isVisible()
If this is false then the painter should not be displayed.

Returns:
is visible?

calibrate

Rectangle2D calibrate(Graphics2D g2,
                      T item)
Called to calibrate the painters for a given graphics context. This should work out the preferred width and height (perhaps for the current font).

Parameters:
g2 -
item -

paint

void paint(Graphics2D g2,
           T item,
           Painter.Justification justification,
           Rectangle2D bounds)
Called to actually paint into the current graphics context. The painter should respect the bounds.

Parameters:
g2 -
item -
justification -
bounds -

getPreferredWidth

double getPreferredWidth()

getPreferredHeight

double getPreferredHeight()

getHeightBound

double getHeightBound()

addPainterListener

void addPainterListener(PainterListener listener)

removePainterListener

void removePainterListener(PainterListener listener)