adavid.awt
Class DefaultTNodeRenderer

java.lang.Object
  |
  +--adavid.awt.DefaultTNodeRenderer

public class DefaultTNodeRenderer
extends java.lang.Object
implements TNodeRenderer

default tree renderer


Field Summary
static DefaultTNodeRenderer INSTANCE
          a shared instance for this renderer, since its only function is to draw a node
static int SIZE
          constant controling the size of the drawing
 
Constructor Summary
protected DefaultTNodeRenderer()
          a protected constructor in order not to use it : use the shared instance protected so that the class could be extended to some customized renderer
 
Method Summary
 int getHeight()
          the height taken
 int getWidth()
          the width taken
 void paint(TNode node, java.awt.Graphics g, boolean expanded, boolean selected, boolean leaf)
          basic drawing : a triangle ; note that the color is set by TNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultTNodeRenderer INSTANCE
a shared instance for this renderer, since its only function is to draw a node

SIZE

public static final int SIZE
constant controling the size of the drawing
Constructor Detail

DefaultTNodeRenderer

protected DefaultTNodeRenderer()
a protected constructor in order not to use it : use the shared instance protected so that the class could be extended to some customized renderer
Method Detail

paint

public void paint(TNode node,
                  java.awt.Graphics g,
                  boolean expanded,
                  boolean selected,
                  boolean leaf)
basic drawing : a triangle ; note that the color is set by TNode
Specified by:
paint in interface TNodeRenderer
Tags copied from interface: TNodeRenderer
Parameters:
node - the node to be repainted
g - Graphics object to repaint the node
expanded - state of the node
selected - state of the node
leaf - nature of the node

getHeight

public int getHeight()
the height taken
Specified by:
getHeight in interface TNodeRenderer
Tags copied from interface: TNodeRenderer
Returns:
the height of the painted zone, icon or whatever, not the whole tree node!

getWidth

public int getWidth()
the width taken
Specified by:
getWidth in interface TNodeRenderer
Tags copied from interface: TNodeRenderer
Returns:
the width of the painted zone, icon or whatever, not the whole tree node!