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 ;-) |
|
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 |
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
DefaultNodeRenderer
public DefaultNodeRenderer()
- constructor
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 intorect - - the rect where to render intoobj - - 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.