public class TreeTableCellRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer
TableCellRenderer
that is supplied in the constructor.
For example, in the following tree representation, the spacing and +/-
icons would be added to each tree node by this renderer, while the data text
would be added by the component returned from the delegate
TableCellRenderer
.
- Cars + BMW - Ford Taurus Focus - Lexus ES 300 LS 600h L
Constructor and Description |
---|
TreeTableCellRenderer(javax.swing.table.TableCellRenderer delegate,
TreeList treeList)
Decorate the component returned from the
delegate with
extra components that display the tree node's location within the tree. |
Modifier and Type | Method and Description |
---|---|
protected javax.swing.table.TableCellRenderer |
createDelegateRenderer()
Build the delegate TableCellRenderer that handles rendering the data of
each tree node.
|
void |
dispose()
Cleanup the data within this renderer as it is no longer being used and
must be prepared for garbage collection.
|
javax.swing.table.TableCellRenderer |
getDelegate()
Returns the delegate TableCellRenderer being decorated.
|
protected int |
getIndent(TreeNodeData treeNodeData,
boolean showExpanderForEmptyParent)
Returns the number of pixels to indent the contents of the renderer.
|
protected int |
getSpacer(TreeNodeData treeNodeData,
boolean showExpanderForEmptyParent)
Returns the number of pixels of space between the expand/collapse button
and the node component.
|
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Return a decorated form of the component returned by the data
TableCellRenderer . |
public TreeTableCellRenderer(javax.swing.table.TableCellRenderer delegate, TreeList treeList)
delegate
with
extra components that display the tree node's location within the tree.
If delegate
is null then a
DefaultTableCellRenderer
will be used as the delegate.delegate
- the renderer that produces the data for the tree nodetreeList
- the data structure that answers questions about the tree
node and the tree that contains itprotected javax.swing.table.TableCellRenderer createDelegateRenderer()
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
TableCellRenderer
.getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
protected int getIndent(TreeNodeData treeNodeData, boolean showExpanderForEmptyParent)
treeNodeData
- hierarhical information about the node within the treeshowExpanderForEmptyParent
- true indicates the expander
button should always be present, even when no children yet existprotected int getSpacer(TreeNodeData treeNodeData, boolean showExpanderForEmptyParent)
treeNodeData
- hierarhical information about the node within the treeshowExpanderForEmptyParent
- true indicates the expander
button should always be present, even when no children yet existpublic javax.swing.table.TableCellRenderer getDelegate()
public void dispose()
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by mockbuild at 2017-02-10 17:48