Class TreeTable.TreeTableCellRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
likelihoodDetectionModule.TreeTable.TreeTableCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, TableCellRenderer
Enclosing class:
TreeTable

public class TreeTable.TreeTableCellRenderer extends JTree implements TableCellRenderer
The class TreeTableCellRenderer is the main guts of the TreeTable's functionality that renderers the JTree within the first column of the JTable.
See Also:
  • Constructor Details

    • TreeTableCellRenderer

      public TreeTableCellRenderer(TreeModel model)
      Instantiates a new tree table cell renderer. The actual model that will be used when this is instantiated is a TreeTableModel.
      Parameters:
      model - the model
      See Also:
  • 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
      Parameters:
      rowHeight - the row height
    • 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
      Parameters:
      g - the g
    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      This returns the renderer to be used by the JTree view to draw the cells. For the TreeTable implementation, this will be a CheckRenderer.
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
      Parameters:
      table - the table
      value - the value that will be renderered in the cell
      isSelected - the is selected flag
      hasFocus - the has focus flag
      row - the row
      column - the column
      Returns:
      the table cell renderer component
      See Also: