adalogo.gui.varmonitor

Class JTreeTable.TreeTableCellRenderer

Enclosing Class:
JTreeTable
Implemented Interfaces:
TableCellRenderer

public class JTreeTable.TreeTableCellRenderer
extends JTree
implements TableCellRenderer

A TreeCellRenderer that displays a JTree.

Nested Class Summary

Field Summary

protected int
visibleRow
Last table/tree row asked to renderer.

Constructor Summary

TreeTableCellRenderer(TreeModel model)

Method Summary

Component
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
TreeCellRenderer method.
void
paint(Graphics g)
Sublcassed to translate the graphics such that the last visible row will be drawn at 0,0.
void
setBounds(int x, int y, int w, int h)
This is overridden to set the height to match that of the JTable.
void
setRowHeight(int rowHeight)
Sets the row height of the tree, and forwards the row height to the table.
void
updateUI()
updateUI is overridden to set the colors of the Tree's renderer to match that of the table.

Field Details

visibleRow

protected int visibleRow
Last table/tree row asked to renderer.

Constructor Details

TreeTableCellRenderer

public TreeTableCellRenderer(TreeModel model)

Method Details

getTableCellRendererComponent

public Component getTableCellRendererComponent(JTable table,
                                               Object value,
                                               boolean isSelected,
                                               boolean hasFocus,
                                               int row,
                                               int column)
TreeCellRenderer method. Overridden to update the visible row.


paint

public void paint(Graphics g)
Sublcassed to translate the graphics such that the last visible row will be drawn at 0,0.


setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
This is overridden to set the height to match that of the JTable.


setRowHeight

public void setRowHeight(int rowHeight)
Sets the row height of the tree, and forwards the row height to the table.


updateUI

public void updateUI()
updateUI is overridden to set the colors of the Tree's renderer to match that of the table.