All Packages This Package Class Hierarchy Class Search Index
Class grendel.widgets.TreeTable
java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----com.sun.java.swing.JComponent | +----grendel.widgets.TreeTable
A outliner view similar to those used in previous versions of mail and news.
public class TreeTable extends com.sun.java.swing.JComponent implements com.sun.java.swing.Scrollable, grendel.dnd.DropTargetComponent { // Fields 35 TreeNode fAnchor; TreeNode fCaret; CellRendererPane fCellRendererPane; ColumnHeader fColumnHeader; ColumnModel fColumnModel; TreeTableDataModel fDataModel; TreeModelListener fDataModelListener; boolean fDragging; boolean fDrawPipes; DropTarget fDropTarget; Column fEditedColumn; TreeNode fEditedNode; boolean fEditing; CellEditor fEditor; boolean fFixed; int fHeight; Color fHighlightColor; Point fHitPoint; int fHitX; int fHitY; int fIndentLevel; boolean fJustSelected; Icon fMinusIcon; boolean fMousinessAfoot; static int fPaintedRows; Icon fPlusIcon; TreeNode fRoot; int fRowHeight; int fRowMargin; SelectionManager fSelection; Point fTooltipPoint; Object fTreeColumn; TreeTable fTreeTable; Color fWindowColor; static final int kGap; // Constructors 1 public TreeTable(TreeTableDataModel); // Methods 77 public void addColumn(Column); public void addColumnAt(Column, int); TreePath buildTreePath(TreeNode); synchronized void clearDataModel(); void collapse(TreeNode); int drawPipes(Graphics, TreeNode, int, int, int, int); public void ensureVisible(TreePath); void ensureVisible(TreeNode); void expand(TreeNode); TreeNode findLastVisible(); synchronized TreeNode findTreeNode(TreePath); TreeNode findTreeNodeRecurse(TreeNode, Object[], int, int); public boolean getAutoscrolls(); public TreePath getCaret(); public ColumnHeader getColumnHeader(); public synchronized ColumnModel getColumnModel(); public int getColumnX(Column); public synchronized TreeTableDataModel getDataModel(); public DropTarget getDropTarget(); int getIndent(Column, TreeNode); public int getIndentLevel(); public Dimension getMaximumSize(); public Dimension getMinimumSize(); public int getNodeHeight(TreePath); public int getNodeY(TreePath); int getNodeY(TreeNode); public Dimension getPreferredScrollableViewportSize(); public Dimension getPreferredSize(); public int getRowHeight(); public int getRowMargin(); public int getScrollableBlockIncrement(Rectangle, int, int); public boolean getScrollableTracksViewportHeight(); public boolean getScrollableTracksViewportWidth(); public int getScrollableUnitIncrement(Rectangle, int, int); public SelectionManager getSelectionManager(); Enumeration getShiftRange(TreePath); public Point getToolTipLocation(MouseEvent); public String getToolTipText(MouseEvent); public Object getTreeColumn(); TreeNode getVisibleRoot(); Column hitTestColumn(int); synchronized TreeNode hitTestNode(int); TreeNode hitTestNodeRecurse(TreeNode, int, int); void initializeCached(); void initializeKeys(); public boolean isFixedHeight(); public boolean isOpaque(); public boolean isVisible(TreePath); public void navigateDown(); void navigateDown(int); void navigateEnd(int); void navigateHome(int); void navigateLeft(int); void navigateRight(int); public void navigateUp(); void navigateUp(int); public synchronized void paintComponent(Graphics); void paintRecurse(Graphics, TreeNode, int); public void reload(); public void repaint(TreePath); void repaint(TreeNode); public void repaintFrom(TreePath); synchronized void resizeAndRepaint(); synchronized void resizeAndRepaintFrom(TreePath); public void select(TreePath); void select(TreePath, int); public void setCaret(TreePath); void setCaret(TreeNode); public synchronized void setDataModel(TreeTableDataModel); public void setDropTarget(DropTarget) throws IllegalArgumentException; public void setFixedHeight(boolean); public void setIndentLevel(int); public void setRowHeight(int); public void setRowMargin(int); public void setTreeColumn(Object); synchronized void updateDataModel(TreeTableDataModel); public void updateUI(); // Inner Classes 14 class TreeMouseListener class TreeCellEditorListener class TreeColumnModelListener class TreeModelListener class TreeSelectionListener class TreeFocusListener class NavigateUpAction class NavigateDownAction class NavigateLeftAction class NavigateRightAction class NavigateHomeAction class NavigateEndAction class OpenAction class TreeNode }
Fields
fTreeTable
TreeTable fTreeTable
fCellRendererPane
CellRendererPane fCellRendererPane
fColumnModel
ColumnModel fColumnModel
fColumnHeader
ColumnHeader fColumnHeader
fDataModel
TreeTableDataModel fDataModel
fHeight
int fHeight
fRoot
TreeNode fRoot
fDataModelListener
TreeModelListener fDataModelListener
fCaret
TreeNode fCaret
fAnchor
TreeNode fAnchor
fSelection
SelectionManager fSelection
fHitX
int fHitX
fHitY
int fHitY
fHitPoint
Point fHitPoint
fDragging
boolean fDragging
fTooltipPoint
Point fTooltipPoint
fEditing
boolean fEditing
fEditor
CellEditor fEditor
fEditedNode
TreeNode fEditedNode
fEditedColumn
Column fEditedColumn
fMousinessAfoot
boolean fMousinessAfoot
fJustSelected
boolean fJustSelected
fDropTarget
DropTarget fDropTarget
fTreeColumn
Object fTreeColumn
fIndentLevel
int fIndentLevel
fRowHeight
int fRowHeight
fRowMargin
int fRowMargin
fFixed
boolean fFixed
kGap
static final int kGap
fDrawPipes
boolean fDrawPipes
fPlusIcon
Icon fPlusIcon
fMinusIcon
Icon fMinusIcon
fWindowColor
Color fWindowColor
fHighlightColor
Color fHighlightColor
fPaintedRows
static int fPaintedRows
Recursive part ofpaint()
.
Constructors
TreeTable
public TreeTable(TreeTableDataModel aDataModel)
Constructs a TreeTable with the given data model.
Methods
setDataModel
public synchronized void setDataModel(TreeTableDataModel aDataModel)
Sets the current data model. A null value (should be) acceptable.
getDataModel
public synchronized TreeTableDataModel getDataModel()
Returns the current data model.
See Also: TreeTableDataModel
getColumnModel
public synchronized ColumnModel getColumnModel()
Retuns the column model
See Also: ColumnModel
addColumn
public void addColumn(Column aColumn)
Adds a column to the tree table. The column is added at the end.
addColumnAt
public void addColumnAt(Column aColumn, int aIndex)
Adds a column at the given position. Existing columns may be shifted to the right.
getColumnHeader
public ColumnHeader getColumnHeader()
Returns the ColumnHeader widget that allows the user to view and manipulate column properties.
getCaret
public TreePath getCaret()
Returns the last object on which the user clicked. This object is used for keyboard navigation.
setCaret
void setCaret(TreeNode aNode)
setCaret
public void setCaret(TreePath aPath)
Sets the last object on which the user clicked. This object is used for keyboard navigation.
getSelectionManager
public SelectionManager getSelectionManager()
Returns the interface for the tree table's selection manager
setTreeColumn
public void setTreeColumn(Object aID)
Sets which column in which the tree indention and (eventually) icons appear.
getTreeColumn
public Object getTreeColumn()
Returns which column in which the tree indention and (eventually) icons appear.
setIndentLevel
public void setIndentLevel(int aIndent)
Sets the number of pixels each level of the tree is indented (16 or more is currently recommended.)
getIndentLevel
public int getIndentLevel()
Returns the number of pixels each level of the tree is indented.
setRowHeight
public void setRowHeight(int aHeight)
Sets a fixed row height. Overrides the per-row sizing feature. A height of 0 enables the per-row sizing feature.
getRowHeight
public int getRowHeight()
Returns the fixed row height
See Also: setRowHeight
setFixedHeight
public void setFixedHeight(boolean aFixed)
Sets whether all rows have the same height. Saves a tremendous amount of time if true. Defaults to true.
See Also: isFixedHeight
isFixedHeight
public boolean isFixedHeight()
Returns whether all rows have the same height. Saves a tremendous amount of time if true.
See Also: setFixedHeight
setRowMargin
public void setRowMargin(int aMargin)
Does nothing, yet.
getRowMargin
public int getRowMargin()
Does nothing, yet.
getShiftRange
Enumeration getShiftRange(TreePath aPath)
select
void select(TreePath aPath, int aModifiers)
select
public void select(TreePath aPath)
Selects the given TreePath.
navigateUp
void navigateUp(int aModifiers)
Navigation used for up arrow key. Does reverse in-order traversal, skipping children of collapsed nodes.
navigateDown
void navigateDown(int aModifiers)
Navigation used for down arrow key. Does in-order traversal, skipping children of collapsed nodes.
navigateLeft
void navigateLeft(int aModifiers)
Navigation used for left arrow key. First collapses node, then moves to parent
navigateRight
void navigateRight(int aModifiers)
Navigation used for right arrow key. First expands node, then moves to first child
navigateHome
void navigateHome(int aModifiers)
findLastVisible
TreeNode findLastVisible()
navigateEnd
void navigateEnd(int aModifiers)
navigateUp
public void navigateUp()
Moves the caret up one position, and selects that object. (currently doesn't support scrolling)
navigateDown
public void navigateDown()
Moves the caret down one position, and selects that object. (currently doesn't support scrolling)
isVisible
public boolean isVisible(TreePath aPath)
Returns whether or not the give path is visible. If the path points to the root, and the root is not shown, the method still returns true.
ensureVisible
void ensureVisible(TreeNode aNode)
Attempts to tweek parent into displaying the given node.
ensureVisible
public void ensureVisible(TreePath aPath)
getNodeY
int getNodeY(TreeNode aNode)
getNodeY
public int getNodeY(TreePath aPath)
Returns the Y location of the give node
getNodeHeight
public int getNodeHeight(TreePath aPath)
getColumnX
public int getColumnX(Column column)
getVisibleRoot
TreeNode getVisibleRoot()
buildTreePath
TreePath buildTreePath(TreeNode aNode)
findTreeNodeRecurse
TreeNode findTreeNodeRecurse(TreeNode aNode, Object[] aPath, int aFirst, int aLast)
findTreeNode
synchronized TreeNode findTreeNode(TreePath aPath)
Finds a TreeNode given a path. If null is returned, either the path is invalid, or the path isn't fully visible.
resizeAndRepaint
synchronized void resizeAndRepaint()
resizeAndRepaintFrom
synchronized void resizeAndRepaintFrom(TreePath aPath)
clearDataModel
synchronized void clearDataModel()
updateDataModel
synchronized void updateDataModel(TreeTableDataModel aDataModel)
reload
public void reload()
Forces the tree to rebuild itself from scratch. Doesn't repaint.
initializeCached
void initializeCached()
initializeKeys
void initializeKeys()
expand
void expand(TreeNode aNode)
collapse
void collapse(TreeNode aNode)
getIndent
int getIndent(Column aColumn, TreeNode aNode)
drawPipes
int drawPipes(Graphics g, TreeNode aNode, int x, int y, int w, int h)
paintRecurse
void paintRecurse(Graphics g, TreeNode aRoot, int y)
hitTestNodeRecurse
TreeNode hitTestNodeRecurse(TreeNode aFirst, int aTop, int aY)
Recursive part of
hitTestNode()
See Also: hitTestNode
hitTestNode
synchronized TreeNode hitTestNode(int aY)
Determines what node is under the given coordinate
hitTestColumn
Column hitTestColumn(int aX)
Determines what column is under the given coordinate
paintComponent
public synchronized void paintComponent(Graphics g)
- Overrides:
- paintComponent in class JComponent
repaint
void repaint(TreeNode aNode)
repaint
public void repaint(TreePath aPath)
repaintFrom
public void repaintFrom(TreePath aPath)
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class JComponent
getMaximumSize
public Dimension getMaximumSize()
- Overrides:
- getMaximumSize in class JComponent
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
updateUI
public void updateUI()
- Overrides:
- updateUI in class JComponent
isOpaque
public boolean isOpaque()
- Overrides:
- isOpaque in class JComponent
getAutoscrolls
public boolean getAutoscrolls()
- Overrides:
- getAutoscrolls in class JComponent
getToolTipLocation
public Point getToolTipLocation(MouseEvent aEvent)
- Overrides:
- getToolTipLocation in class JComponent
getToolTipText
public String getToolTipText(MouseEvent aEvent)
- Overrides:
- getToolTipText in class JComponent
getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize()
- Implements:
- getPreferredScrollableViewportSize in interface Scrollable
getScrollableBlockIncrement
public int getScrollableBlockIncrement(Rectangle aVisible, int aOrient, int aDirection)
- Implements:
- getScrollableBlockIncrement in interface Scrollable
getScrollableUnitIncrement
public int getScrollableUnitIncrement(Rectangle aVisible, int aOrient, int aDirection)
- Implements:
- getScrollableUnitIncrement in interface Scrollable
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()
- Implements:
- getScrollableTracksViewportHeight in interface Scrollable
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()
- Implements:
- getScrollableTracksViewportWidth in interface Scrollable
setDropTarget
public void setDropTarget(DropTarget dt) throws IllegalArgumentException
- Implements:
- setDropTarget in interface DropTargetComponent
getDropTarget
public DropTarget getDropTarget()
- Implements:
- getDropTarget in interface DropTargetComponent
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4