Class JTreeTable.TreeTableCellRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
com.iamsoft.util.ui.swing.JTreeTable.TreeTableCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, TableCellRenderer
Enclosing class:
JTreeTable

public class JTreeTable.TreeTableCellRenderer extends JTree implements TableCellRenderer
A TreeCellRenderer that displays a JTree.
See Also:
  • Field Details

    • visibleRow

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

      protected Border highlightBorder
      Border to draw around the tree, if this is non-null, it will be painted.
  • Constructor Details

    • TreeTableCellRenderer

      public TreeTableCellRenderer(TreeModel model)
  • Method Details

    • updateUI

      public void updateUI()
      updateUI is overridden to set the colors of the Tree's renderer to match that of the table.
      Overrides:
      updateUI in class JTree
    • setRowHeight

      public void setRowHeight(int rowHeight)
      Sets the row height of the tree, and forwards the row height to the table.
      Overrides:
      setRowHeight in class JTree
    • 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.
      Overrides:
      setBounds in class Component
    • paint

      public void paint(Graphics g)
      Sublcassed to translate the graphics such that the last visible row will be drawn at 0,0.
      Overrides:
      paint in class JComponent
    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      TreeCellRenderer method. Overridden to update the visible row.
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
    • isPathEditable

      public boolean isPathEditable(TreePath pPath)
      Overrides:
      isPathEditable in class JTree