jebl.gui.trees.treeviewer_dev.painters
Class NodeShapePainter

java.lang.Object
  extended by jebl.gui.trees.treeviewer_dev.painters.AbstractPainter<Node>
      extended by jebl.gui.trees.treeviewer_dev.painters.NodePainter
          extended by jebl.gui.trees.treeviewer_dev.painters.NodeShapePainter
All Implemented Interfaces:
Painter<Node>

public class NodeShapePainter
extends NodePainter

Author:
Andrew Rambaut

Nested Class Summary
static class NodeShapePainter.NodeShape
           
 
Nested classes/interfaces inherited from interface jebl.gui.trees.treeviewer_dev.painters.Painter
Painter.Justification, Painter.Orientation
 
Field Summary
static String AREA_ATTRIBUTE
           
protected  String[] attributes
           
protected  Map<String,String> displayAttributes
           
protected  Map<String,Number> displayValues
           
static String HEIGHT_ATTRIBUTE
           
static String LOWER_ATTRIBUTE
           
static String RADIUS_ATTRIBUTE
           
protected  TreePane treePane
           
static String UPPER_ATTRIBUTE
           
static String WIDTH_ATTRIBUTE
           
 
Constructor Summary
NodeShapePainter()
           
 
Method Summary
 Rectangle2D calibrate(Graphics2D g2, Node item)
          Called to calibrate the painters for a given graphics context.
 String[] getAttributeNames()
           
 double getHeightBound()
           
 double getPreferredHeight()
           
 double getPreferredWidth()
           
 void paint(Graphics2D g2, Node item, Painter.Justification justification, Rectangle2D bounds)
          The bounds define the shape of the bar so just draw it
 void setDisplayAttribute(String display, String attribute)
           
 void setDisplayValues(String display, double value)
           
 void setTreePane(TreePane treePane)
          Called when the painter is installed in a TreePane.
 void setupAttributes(Tree tree)
           
 
Methods inherited from class jebl.gui.trees.treeviewer_dev.painters.NodePainter
getBackground, getBorderPaint, getBorderStroke, getForeground, getStroke, isVisible, setBackground, setBorder, setForeground, setStroke, setVisible
 
Methods inherited from class jebl.gui.trees.treeviewer_dev.painters.AbstractPainter
addPainterListener, firePainterChanged, firePainterSettingsChanged, removePainterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AREA_ATTRIBUTE

public static final String AREA_ATTRIBUTE
See Also:
Constant Field Values

RADIUS_ATTRIBUTE

public static final String RADIUS_ATTRIBUTE
See Also:
Constant Field Values

WIDTH_ATTRIBUTE

public static final String WIDTH_ATTRIBUTE
See Also:
Constant Field Values

HEIGHT_ATTRIBUTE

public static final String HEIGHT_ATTRIBUTE
See Also:
Constant Field Values

LOWER_ATTRIBUTE

public static final String LOWER_ATTRIBUTE
See Also:
Constant Field Values

UPPER_ATTRIBUTE

public static final String UPPER_ATTRIBUTE
See Also:
Constant Field Values

displayAttributes

protected Map<String,String> displayAttributes

displayValues

protected Map<String,Number> displayValues

attributes

protected String[] attributes

treePane

protected TreePane treePane
Constructor Detail

NodeShapePainter

public NodeShapePainter()
Method Detail

setupAttributes

public void setupAttributes(Tree tree)

setTreePane

public void setTreePane(TreePane treePane)
Description copied from interface: Painter
Called when the painter is installed in a TreePane. Gives the painter a handle on the TreePane so that it get additional information.


calibrate

public Rectangle2D calibrate(Graphics2D g2,
                             Node item)
Description copied from interface: Painter
Called to calibrate the painters for a given graphics context. This should work out the preferred width and height (perhaps for the current font).


getPreferredWidth

public double getPreferredWidth()

getPreferredHeight

public double getPreferredHeight()

getHeightBound

public double getHeightBound()

paint

public void paint(Graphics2D g2,
                  Node item,
                  Painter.Justification justification,
                  Rectangle2D bounds)
The bounds define the shape of the bar so just draw it

Parameters:
g2 -
item -
justification -
bounds -

getAttributeNames

public String[] getAttributeNames()

setDisplayAttribute

public void setDisplayAttribute(String display,
                                String attribute)

setDisplayValues

public void setDisplayValues(String display,
                             double value)