prolog.treeview
Class DefaultNodeRenderer

java.lang.Object
  |
  +--prolog.treeview.DefaultNodeRenderer
All Implemented Interfaces:
INodeRenderer

public class DefaultNodeRenderer
extends java.lang.Object
implements INodeRenderer

this is the implementation of the default node renderer rendering any object


Field Summary
protected  javax.swing.JComponent component
          stores a component for calculating string width and height
protected static java.awt.Dimension gvDefaultSize
          the default node size of this default node renderer ;-)
 
Constructor Summary
DefaultNodeRenderer()
          constructor
 
Method Summary
 java.awt.Dimension calculateDimension(java.lang.Object obj)
          calculates the require size this renderer require to render the given object
 void renderNode(java.awt.Graphics2D g, java.awt.Rectangle rect, java.lang.Object obj)
          renders the given object into the given graphic context
 void setComponent(javax.swing.JComponent c)
          sets the component to render in. with this reference the node renderer is able to fetch a graphic context and to calculate the width of a string on screen.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

gvDefaultSize

protected static java.awt.Dimension gvDefaultSize
the default node size of this default node renderer ;-)

component

protected javax.swing.JComponent component
stores a component for calculating string width and height
Constructor Detail

DefaultNodeRenderer

public DefaultNodeRenderer()
constructor
Method Detail

renderNode

public void renderNode(java.awt.Graphics2D g,
                       java.awt.Rectangle rect,
                       java.lang.Object obj)
renders the given object into the given graphic context
Specified by:
renderNode in interface INodeRenderer
Parameters:
g - - the graphic context to render into
rect - - the rect where to render into
obj - - the node content that should be rendered

calculateDimension

public java.awt.Dimension calculateDimension(java.lang.Object obj)
calculates the require size this renderer require to render the given object
Specified by:
calculateDimension in interface INodeRenderer
Returns:
the size of the rendered object

setComponent

public void setComponent(javax.swing.JComponent c)
sets the component to render in. with this reference the node renderer is able to fetch a graphic context and to calculate the width of a string on screen.