de.matthiasmann.twl
Class TreeTable

java.lang.Object
  extended by de.matthiasmann.twl.Widget
      extended by de.matthiasmann.twl.TableBase
          extended by de.matthiasmann.twl.TreeTable
All Implemented Interfaces:
ScrollPane.AutoScrollable, ScrollPane.CustomPageSize, ScrollPane.Scrollable
Direct Known Subclasses:
PropertySheet

public class TreeTable
extends TableBase

A Tree+Table widget. It does not have a TableSelectionManager by default. To make the table entries selectable you need to install a selection manager: TableBase.setSelectionManager(de.matthiasmann.twl.TableSelectionManager) or TableBase.setDefaultSelectionManager()


Nested Class Summary
static interface TreeTable.ExpandListener
           
protected  class TreeTable.ModelChangeListener
           
protected  class TreeTable.NodeState
           
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.TableBase
TableBase.Callback, TableBase.CellRenderer, TableBase.CellWidgetCreator, TableBase.ColumnHeader, TableBase.ColumnSizeSequence, TableBase.DragListener, TableBase.KeyboardSearchHandler, TableBase.StringCellRenderer
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.Widget
Widget.OffscreenMouseAdjustments, Widget.RenderOffscreen
 
Field Summary
 
Fields inherited from class de.matthiasmann.twl.TableBase
autoSizeAllRows, callbacks, cellRenderers, columnDefaultCellRenderer, columnDividerDragableDistance, columnHeaderHeight, columnHeaderModel, columnHeaders, columnModel, columnResizeCursor, defaultColumnWidth, DRAG_COLUMN_HEADER, DRAG_IGNORE, DRAG_INACTIVE, DRAG_USER, dragActive, dragColumn, dragCursor, dragListener, dragNotPossibleCursor, dragStartColWidth, dragStartSumWidth, dragStartX, dropMarkerBeforeRow, dropMarkerRow, ensureColumnHeaderMinWidth, firstRowPartialVisible, firstVisibleColumn, firstVisibleRow, hasCellWidgetCreators, imageColumnDivider, imageRowBackground, imageRowDropMarker, imageRowOverlay, keyboardSearchHandler, LAST_MOUSE_Y_OUTSIDE, lastMouseColumn, lastMouseRow, lastMouseY, lastRowPartialVisible, lastVisibleColumn, lastVisibleRow, normalCursor, numColumns, numRows, rowHeight, rowModel, scrollPosX, scrollPosY, selectionManager, STATE_FIRST_COLUMNHEADER, STATE_LAST_COLUMNHEADER, STATE_LEAD_ROW, STATE_ROW_DROPTARGET, STATE_ROW_HOVER, STATE_ROW_ODD, STATE_ROW_SELECTED, STATE_SELECTED, STATE_SORT_ASCENDING, STATE_SORT_DESCENDING, tableBaseThemeInfo, updateAllCellWidgets, updateAllColumnWidth, widgetGrid
 
Fields inherited from class de.matthiasmann.twl.Widget
STATE_DISABLED, STATE_HAS_FOCUSED_CHILD, STATE_HAS_OPEN_POPUPS, STATE_KEYBOARD_FOCUS
 
Constructor Summary
TreeTable()
           
TreeTable(TreeTableModel model)
           
 
Method Summary
 void addExpandListener(TreeTable.ExpandListener listener)
           
protected  void applyTheme(ThemeInfo themeInfo)
          Apply the given theme.
protected  void applyThemeTreeTable(ThemeInfo themeInfo)
           
 void collapseAll()
           
protected  int computeNumRows()
           
protected  TreeTable.NodeState createNodeState(TreeTableNode node)
           
protected  void expandedChanged(TreeTable.NodeState ns)
           
protected  java.lang.Object getCellData(int row, int column, TreeTableNode node)
           
protected  TableBase.CellRenderer getCellRenderer(int row, int col, TreeTableNode node)
           
 TreeTableNode getNodeFromRow(int row)
           
protected  TreeTable.NodeState getOrCreateNodeState(TreeTableNode node)
           
 int getRowFromNode(TreeTableNode node)
          Computes the row for the given node in the TreeTable.
 int getRowFromNodeExpand(TreeTableNode node)
           
protected  java.lang.Object getTooltipContentFromRow(int row, int column)
           
 boolean isRowExpanded(int row)
           
protected  boolean isVisible(TreeTable.NodeState ns)
           
protected  void modelNodesAdded(TreeTableNode parent, int idx, int count)
           
protected  void modelNodesChanged(TreeTableNode parent, int idx, int count)
           
protected  void modelNodesRemoved(TreeTableNode parent, int idx, int count)
           
protected  void recursiveRemove(TreeTable.NodeState ns)
           
 void removeExpandListener(TreeTable.ExpandListener listener)
           
 void setLeadRowExpanded(boolean expanded)
           
 void setModel(TreeTableModel model)
           
 void setRowExpanded(int row, boolean expanded)
           
 
Methods inherited from class de.matthiasmann.twl.TableBase
addCallback, adjustScrollPosition, applyCellRendererTheme, applyThemeMouseCursor, applyThemeTableBase, autoSizeAllRows, autoSizeRow, cancelDragging, checkColumnIndex, checkColumnRange, checkRowIndex, checkRowRange, childAdded, childRemoved, clampColumnWidth, clearDropMarker, columnHeaderClicked, computePreferredColumnWidth, computeRowHeight, createColumnHeader, getAutoScrollDirection, getCellRenderer, getCellRendererNoDefault, getColumnDefaultCellRenderer, getColumnEndPosition, getColumnFromPosition, getColumnHeaderAnimationState, getColumnMPM, getColumnSeparatorUnderMouse, getColumnStartPosition, getColumnUnderMouse, getColumnWidth, getDefaultCellRenderer, getDragListener, getDropMarkerRow, getKeyboardSearchHandler, getMinHeight, getMouseCursor, getNumColumns, getNumRows, getNumVisibleRows, getOffsetX, getOffsetY, getPageSizeX, getPageSizeY, getPreferredInnerHeight, getPreferredInnerWidth, getRowEndPosition, getRowFromPosition, getRowHeight, getRowStartPosition, getRowUnderMouse, getSelectionManager, getTooltipContentAt, handleDragEvent, handleEvent, handleKeyStrokeAction, handleMouseEvent, insertCellRenderer, isCellSelected, isDropMarkerBeforeRow, isFixedWidthMode, isMouseInColumnHeader, isRowSelected, isVariableRowHeight, layout, modelAllChanged, modelCellChanged, modelColumnHeaderChanged, modelColumnsDeleted, modelColumnsInserted, modelRowChanged, modelRowsChanged, modelRowsDeleted, modelRowsInserted, paintWidget, positionChanged, registerCellRenderer, removeAllCellWidgets, removeAllChildren, removeCallback, removeCellWidget, scrollToRow, setColumnDefaultCellRenderer, setColumnSortOrderAnimationState, setColumnWidth, setDefaultSelectionManager, setDragListener, setDropMarker, setDropMarker, setKeyboardSearchHandler, setScrollPosition, setSelectionManager, setVaribleRowHeight, sizeChanged, updateAll, updateAllCellWidgets, updateAllColumnWidth, updateCellWidget, updateColumnHeader, updateColumnHeaderNumbers
 
Methods inherited from class de.matthiasmann.twl.Widget
add, addActionMapping, addPropertyChangeListener, addPropertyChangeListener, adjustSize, afterAddToGUI, allChildrenRemoved, applyThemeBackground, applyThemeBorder, applyThemeInputMap, applyThemeMaxSize, applyThemeMinSize, applyThemeOffscreenExtra, applyThemeOverlay, applyThemeTooltip, beforeRemoveFromGUI, borderChanged, canAcceptKeyboardFocus, childInvalidateLayout, childVisibilityChanged, computeSize, destroy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, focusFirstChild, focusLastChild, focusNextChild, focusPrevChild, getActionMap, getAnimationState, getBackground, getBorderBottom, getBorderHorizontal, getBorderLeft, getBorderRight, getBorderTop, getBorderVertical, getBottom, getChild, getChildAt, getChildIndex, getGUI, getHeight, getInnerBottom, getInnerHeight, getInnerRight, getInnerWidth, getInnerX, getInnerY, getInputMap, getKeyboardFocusOrder, getMaxHeight, getMaxWidth, getMinWidth, getMouseCursor, getNumChildren, getOffscreenExtraBottom, getOffscreenExtraLeft, getOffscreenExtraRight, getOffscreenExtraTop, getOrCreateActionMap, getOverlay, getParent, getPreferredHeight, getPreferredWidth, getRenderOffscreen, getRight, getRootWidget, getTheme, getThemePath, getThemeTooltipContent, getTintAnimator, getTooltipContent, getWidgetAt, getWidth, getX, getY, giveupKeyboardFocus, hasKeyboardFocus, hasOpenPopups, hasSharedAnimationState, insertChild, invalidateLayout, invalidateLayoutLocally, isAbsoluteTheme, isClip, isDepthFocusTraversal, isEnabled, isFocusKeyEnabled, isInside, isLocallyEnabled, isMouseInside, isVisible, keyboardFocusChildChanged, keyboardFocusGained, keyboardFocusGained, keyboardFocusLost, layoutChildFullInnerArea, layoutChildrenFullInnerArea, moveChild, paint, paintBackground, paintChild, paintChildren, paintDragOverlay, paintOverlay, reapplyTheme, removeChild, removeChild, removePropertyChangeListener, removePropertyChangeListener, requestKeyboardFocus, requestKeyboardFocus, resetTooltip, setActionMap, setBackground, setBorderSize, setBorderSize, setBorderSize, setBorderSize, setCanAcceptKeyboardFocus, setClip, setDepthFocusTraversal, setEnabled, setFocusKeyEnabled, setInnerSize, setInputMap, setMaxSize, setMinSize, setMouseCursor, setOffscreenExtra, setOffscreenExtra, setOverlay, setPosition, setRenderOffscreen, setSize, setTheme, setTintAnimator, setTooltipContent, setVisible, updateTintAnimation, updateTooltip, validateLayout, widgetDisabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeTable

public TreeTable()

TreeTable

public TreeTable(TreeTableModel model)
Method Detail

setModel

public void setModel(TreeTableModel model)

addExpandListener

public void addExpandListener(TreeTable.ExpandListener listener)

removeExpandListener

public void removeExpandListener(TreeTable.ExpandListener listener)

applyTheme

protected void applyTheme(ThemeInfo themeInfo)
Description copied from class: Widget
Apply the given theme. This method also calls invalidateLayout()

Overrides:
applyTheme in class TableBase
Parameters:
themeInfo - The theme info for this widget

applyThemeTreeTable

protected void applyThemeTreeTable(ThemeInfo themeInfo)

getRowFromNode

public int getRowFromNode(TreeTableNode node)
Computes the row for the given node in the TreeTable.

Parameters:
node - the node to locate
Returns:
the row in the table or -1 if the node is not visible

getRowFromNodeExpand

public int getRowFromNodeExpand(TreeTableNode node)

getNodeFromRow

public TreeTableNode getNodeFromRow(int row)
Specified by:
getNodeFromRow in class TableBase

collapseAll

public void collapseAll()

isRowExpanded

public boolean isRowExpanded(int row)

setRowExpanded

public void setRowExpanded(int row,
                           boolean expanded)

setLeadRowExpanded

public void setLeadRowExpanded(boolean expanded)

getOrCreateNodeState

protected TreeTable.NodeState getOrCreateNodeState(TreeTableNode node)

createNodeState

protected TreeTable.NodeState createNodeState(TreeTableNode node)

expandedChanged

protected void expandedChanged(TreeTable.NodeState ns)

computeNumRows

protected int computeNumRows()

getCellData

protected java.lang.Object getCellData(int row,
                                       int column,
                                       TreeTableNode node)
Specified by:
getCellData in class TableBase

getCellRenderer

protected TableBase.CellRenderer getCellRenderer(int row,
                                                 int col,
                                                 TreeTableNode node)
Overrides:
getCellRenderer in class TableBase

getTooltipContentFromRow

protected java.lang.Object getTooltipContentFromRow(int row,
                                                    int column)
Specified by:
getTooltipContentFromRow in class TableBase

modelNodesAdded

protected void modelNodesAdded(TreeTableNode parent,
                               int idx,
                               int count)

recursiveRemove

protected void recursiveRemove(TreeTable.NodeState ns)

modelNodesRemoved

protected void modelNodesRemoved(TreeTableNode parent,
                                 int idx,
                                 int count)

isVisible

protected boolean isVisible(TreeTable.NodeState ns)

modelNodesChanged

protected void modelNodesChanged(TreeTableNode parent,
                                 int idx,
                                 int count)