|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.dlsc.flexgantt.swing.treetable.TreeTable
public class TreeTable
The left-hand side of any Gantt chart is represented by a tree table
component, which allows the user to drill down the data provided by a tree
table model. A tree table supports complex user interaction such as cell
editing and drag and drop operations. Pluggable editors and renderers allow
for total customization of the visual appearance and editing capabilities.
Several aspects of the tree table's behaviour can be customized by policies
such as INodeEditPolicy
and INodeDragAndDropPolicy
.
ITreeTableModel
,
ITreeTableNode
,
DefaultMutableTreeTableNode
,
INodeEditPolicy
,
INodeDragAndDropPolicy
,
IRowPolicy
,
Serialized FormNested Class Summary | |
---|---|
static class |
TreeTable.BooleanEditor
An editor for values of type Boolean . |
static class |
TreeTable.BooleanRenderer
A renderer for drawing values of type Boolean . |
static class |
TreeTable.CalendarEditor
An editor for values of type Calendar . |
static class |
TreeTable.CalendarRenderer
A renderer for values of type Calendar . |
static class |
TreeTable.ColorEditor
An editor for values of type Color . |
static class |
TreeTable.ColorRenderer
A renderer for values of type Color . |
static class |
TreeTable.DateEditor
An editor for values of type Date . |
static class |
TreeTable.DateRenderer
A renderer for values of type Date . |
static class |
TreeTable.DoubleRenderer
A renderer for values of type Double . |
static class |
TreeTable.EnumEditor
An editor for enumerations. |
static class |
TreeTable.EnumRenderer
A renderer for values of type Enum . |
static class |
TreeTable.IconRenderer
A renderer for drawing icons. |
static class |
TreeTable.NumberEditor
An editor for numbers (double, float, ...). |
static class |
TreeTable.NumberRenderer
A tree table cell renderer for numbers (double, float, etc...). |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ALT_BACKGROUND_COLOR
Constant used for the property change event that gets fired when the alternating background color changes. |
static java.lang.String |
PROPERTY_ALT_FOREGROUND_COLOR
Constant used for the property change event that gets fired when the alternating background color changes. |
static java.lang.String |
PROPERTY_CREATION_ENABLED
Constant used for the property change event that gets fired when the support for creating new nodes (directly inside the table) gets enabled or disabled. |
static java.lang.String |
PROPERTY_DEFAULT_ROW_HEIGHT
Constant used for the property change event that gets fired when the value for the default row height changes. |
static java.lang.String |
PROPERTY_DRAGGING_ENABLED
Constant used for the property change event that gets fired when the drag & drop support gets enabled/disabled. |
static java.lang.String |
PROPERTY_GRID_COLOR
Constant used for the property change event that gets fired when the grid color changes. |
static java.lang.String |
PROPERTY_HORIZONTAL_LINES_VISIBLE
Constant used for the property change event that gets fired when the visibility of the horizontal lines changes. |
static java.lang.String |
PROPERTY_INDENT_ENABLED
Constant used for the property change event that gets fired when the indentation feature gets enabled/disabled. |
static java.lang.String |
PROPERTY_MODEL
Constant used for the property change event that gets fired when the tree table model changes. |
static java.lang.String |
PROPERTY_POLICY_PROVIDER
Constant used for the property change event that gets fired when the policy provider for the tree table gets replaced. |
static java.lang.String |
PROPERTY_RESIZING_ENABLED
Constant used for the property change event that gets fired when the resizing support gets enabled/disabled. |
static java.lang.String |
PROPERTY_ROOT_VISIBLE
Constant used for the property change event that gets fired when the visibility of the root node changes. |
static java.lang.String |
PROPERTY_ROW_NUMBERS_VISIBLE
Constant used for the property change event that gets fired when the visibility of the row numbers changes. |
static java.lang.String |
PROPERTY_SELECTION_BACKGROUND_COLOR
Constant used for the property change event that gets fired when the selection background color changes. |
static java.lang.String |
PROPERTY_SELECTION_FOREGROUND_COLOR
Constant used for the property change event that gets fired when the selection foreground color changes. |
static java.lang.String |
PROPERTY_SELECTION_MODEL
Constant used for the property change event that gets fired when the selection model changes. |
static java.lang.String |
PROPERTY_VERTICAL_LINES_VISIBLE
Constant used for the property change event that gets fired when the visibility of the vertical lines changes. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TreeTable(AbstractGanttChart ganttChart,
ITreeTableModel model)
Constructs a new tree table. |
Method Summary | |
---|---|
void |
addSelectionInterval(int start,
int end)
Adds all rows within the given interval to the current selection. |
void |
addSelectionPath(javax.swing.tree.TreePath path)
Adds another path to the current selection. |
void |
addSelectionPaths(javax.swing.tree.TreePath[] paths)
Adds several paths at once to the selection model. |
void |
addSelectionRow(int row)
Adds a row to the current selection. |
void |
addSelectionRows(int[] rows)
Adds several rows at once to the selection model. |
void |
addTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
Adds a tree expansion listener that will receive events after a tree node has been expanded. |
void |
addTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
Adds a tree selection listener to the table. |
void |
addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener l)
Adds a tree expansion listener that will be informed before a tree node expands. |
void |
animateDropPath(javax.swing.tree.TreePath path)
Causes a fade-in effect for the given path, which gets used by the DnD manager to visualize where a node is located after a drop. |
void |
autoscroll(java.awt.Point cursorLocn)
|
void |
clearSelection()
Clears the current tree table selection. |
void |
collapseAll()
Collapses all tree nodes by starting at the root node, recursively traversing the tree hierarchy and calling TreeTableNode.collapse() on each visited node. |
void |
collapsePath(javax.swing.tree.TreePath path)
Collapses the tree node that matches the given path. |
void |
collapseRow(int row)
Collapses the tree node located in the given row. |
void |
columnModelChanged(ColumnModelEvent evt)
The listener's callback method that will be invoked when columns get added, removed, inserted. |
void |
commandStackChanged(CommandStackEvent evt)
Gets called whenever the command stack changed. |
boolean |
containsPath(javax.swing.tree.TreePath path)
Determines if the given tree path exists in the tree table. |
protected TreeTableDragAndDropManager |
createDragAndDropManager()
Creates the drag and drop manager (DnD manager) that will be used to control the tree table's drag and drop operations. |
boolean |
editCellAt(int row,
int column)
Programmatically starts editing the cell at row and
column , if those indices are in the valid range, and the
cell at those indices is editable. |
boolean |
editCellAt(int row,
int column,
java.awt.event.InputEvent e)
Programmatically starts editing the cell at row and
column , if those indices are in the valid range, and the
cell at those indices is editable. |
boolean |
editCellFocused(java.awt.event.InputEvent evt)
Starts the editing of the currently focused table cell. |
void |
editingCanceled(javax.swing.event.ChangeEvent e)
|
void |
editingStopped(javax.swing.event.ChangeEvent e)
|
void |
expandAll()
Expands all tree nodes by starting at the root node, recursively traversing the tree hierarchy and calling TreeTableNode.expand()
on each visited node. |
void |
expandPath(javax.swing.tree.TreePath path)
Expands the tree node that matches the given path. |
void |
expandRow(int row)
Expands the tree node located in the given row. |
protected void |
fireTreeCollapsed(javax.swing.tree.TreePath path)
Fires a tree expansion event after a node collapsed. |
protected void |
fireTreeExpanded(javax.swing.tree.TreePath path)
Fires a tree expansion event after a node expanded. |
protected void |
fireTreeWillCollapse(javax.swing.tree.TreePath path)
Fires a tree expansion event before a node collapses. |
protected void |
fireTreeWillExpand(javax.swing.tree.TreePath path)
Fires a tree expansion event before a node expands. |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
float |
getAlpha()
Returns the alpha channel value (default is 1). |
java.awt.Color |
getAlternatingBackground()
Returns the alternating background color. |
java.awt.Color |
getAlternatingForeground()
Returns the alternating foreground color. |
java.awt.Insets |
getAutoscrollInsets()
|
java.awt.Color |
getBackground(int row)
Returns the background color for the given row. |
java.awt.Color |
getBackground(int row,
boolean includeSelection)
Returns the background color for the given row. |
ITreeTableCellEditor |
getCellEditor()
Returns the currently used cell editor. |
ITreeTableCellEditor |
getCellEditor(java.lang.Class cl)
Returns a cell editor for the given object type. |
ITreeTableCellEditor |
getCellEditor(int row,
int column)
Returns a cell editor for the given row and column. |
CellFocusManager |
getCellFocusManager()
Returns the cell focus manager, a specialized class that only deals with managing the table's focus. |
java.awt.Rectangle |
getCellRect(int row,
int column)
Returns the cell rectangle for the cell at the given row and column. |
ITreeTableCellRenderer |
getCellRenderer(java.lang.Class cl)
Returns a cell renderer for the given object type. |
TreeTableColumn |
getColumn(int index)
Returns the column for the given index. |
java.lang.Class |
getColumnClass(int columnIndex)
Returns the object type of the values shown in the column at the given index. |
int |
getColumnCount()
Returns the number of columns in the column model. |
int |
getColumnIndex(TreeTableColumn col)
Returns the index of the given column. |
int |
getColumnIndexAt(int x)
Returns the column at the given x-coordinate. |
IColumnModel |
getColumnModel()
Returns the tree table's column model. |
int |
getDefaultRowHeight()
Returns the default row height that will be applied for such rows where the IRowPolicy is not used to determine the height. |
TreeTableDragAndDropManager |
getDragAndDropManager()
Returns the drag and drop manager used by the tree table to control its drag and drop capabilities. |
java.awt.Color |
getDropColorInvalid()
Returns the color that will be used to show where an invalid drop can occure. |
java.awt.Color |
getDropColorValid()
Returns the color that will be used to show where a valid drop can occure. |
int |
getEditingColumn()
Returns the column in which editing currently takes place. |
int |
getEditingRow()
Returns the row in which editing currently takes place. |
java.awt.Component |
getEditorComponent()
Returns the user interface component that is currently being used to edit a cell value. |
int |
getFirstVisibleRow()
Returns the index of the first visible row based on the internal tree table node array used to store the state of the tree table. |
java.awt.Color |
getFocusColor()
Returns the color used for drawing the focus rectangle. |
int |
getFocusedColumn()
Returns the column of the focused cell. |
int |
getFocusedRow()
Returns the row of the focused cell. |
java.awt.Color |
getForeground(int row)
Returns the foreground color for the given row. |
java.awt.Color |
getForeground(int row,
boolean includeSelection)
Returns the foreground color for the given row. |
AbstractGanttChart |
getGanttChart()
Returns the parent Gantt chart of the table. |
java.awt.Color |
getGridColor()
Returns the color used for drawing the vertical and horizontal lines of the grid. |
int |
getInset()
Returns the number of pixels used to inset sub-nodes. |
KeyColumn |
getKeyColumn()
Returns the column model's key column. |
int |
getKeyColumnPosition()
Returns the position of the key column in the table. |
int |
getLastVisibleRow()
Returns the index of the last visible row based on the internal tree table node array used to store the state of the tree table. |
LayerContainer |
getLayerContainer()
Returns the layer container mapped to this table. |
ITreeTableMenuProvider |
getMenuProvider()
Returns the menu provider used by the tree table to lookup a popup menu based on the location and context of the popup trigger event. |
ITreeTableModel |
getModel()
Returns the model that is being used as a data source for the tree table. |
javax.swing.tree.TreePath[] |
getPathsBetweenRows(int start,
int end)
Returns an array of tree paths that matches rows within the given interval. |
IPolicyProvider |
getPolicyProvider()
Returns the policy provider used by the table to lookup policy implementations. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size. |
java.util.Map<java.lang.Class,ITreeTableCellRenderer> |
getRendererMap()
Returns the map, which is storing the mappings between cell value types and tree table cell renderers. |
javax.swing.CellRendererPane |
getRendererPane()
Returns the renderer pane used by the tree table to render the tree table cell renderers. |
TreeTableNode |
getRootNode()
The root node. |
int |
getRowAt(int y)
Returns the row for the given y-coordinate. |
int |
getRowCount()
Returns the total number of rows, which is equal to the length of the tree table nodes array. |
int |
getRowForPath(javax.swing.tree.TreePath path)
Returns the row for the given path. |
TreeTableRowHeader |
getRowHeader()
Returns the row header that was created by the component factory and that will be used to control the tree table (expanding / collapsing nodes, row height, selection, ...). |
int |
getRowHeight(int row)
Returns the height of the given row. |
int[] |
getRowsForPaths(javax.swing.tree.TreePath[] paths)
|
java.awt.Color |
getSelectionBackground()
Returns the color used for filling the background of currently selected rows. |
int |
getSelectionCount()
Returns the number of currently selected rows / tree nodes. |
java.awt.Color |
getSelectionForegroundColor()
Returns the color used for drawing the foreground (text) of currently selected rows. |
int |
getSelectionMode()
Returns the current selection mode (SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION). |
ITreeTableSelectionModel |
getSelectionModel()
Returns the table's selection model. |
javax.swing.tree.TreePath |
getSelectionPath()
Returns the current selection path. |
javax.swing.tree.TreePath[] |
getSelectionPaths()
Returns the current selection paths. |
java.awt.Image |
getTexture()
Returns the image that is being used to fill the background of the table with a texture. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent evt)
Returns the text for a tooltip that is appropriate for the given mouse event and its location. |
javax.swing.tree.TreePath |
getTreePath(int row)
Returns a tree path object for the given row. |
javax.swing.tree.TreePath[] |
getTreePaths(int[] rows)
Returns an array of tree path objects for the given array of rows. |
TreeTableHeader |
getTreeTableHeader()
Returns the Gantt chart's tree table header. |
TreeTableNode |
getTreeTableNodeAt(int y)
Returns the tree table node for the given y-coordinate. |
TreeTableNode[] |
getTreeTableNodes()
Returns the array that is storing the tree table nodes. |
TreeTableNode[] |
getTreeTableNodesBetween(int y1,
int y2)
Returns all nodes located on or between the two given y-coordinates. |
int |
getVisibleRowCount()
Returns the number of rows currently shown in the visible part of the tree table. |
boolean |
isCellEditable(int row,
int column)
Returns TRUE if the cell at the given row and column is editable. |
boolean |
isCreationEnabled()
Returns TRUE if the table allows the user to add new nodes to the tree table's data model. |
boolean |
isDraggingEnabled()
Returns TRUE if the table supports drag & drop. |
boolean |
isEditing()
Returns TRUE if a cell is currently being edited. |
boolean |
isHorizontalLinesVisible()
Returns TRUE if the horizontal grid lines are currently visible. |
boolean |
isIndentEnabled()
Returns TRUE if the user is allowed to manually change the indentation of tree nodes. |
boolean |
isPathSelected(javax.swing.tree.TreePath path)
Returns TRUE if the given path is contained within the currently active selection. |
boolean |
isResizingEnabled()
Returns TRUE if the table generally supports row resizing. |
boolean |
isRootVisible()
Returns TRUE if the root object returned by the tree table model will be shown by the tree table. |
boolean |
isRowNumbersVisible()
Returns TRUE if the row numbers are visible. |
boolean |
isRowSelected(int row)
Returns TRUE if the given row is currently selected. |
boolean |
isTreeNodeExpanded(javax.swing.tree.TreePath path)
Determines whether the tree node specified by the given tree path is exapanded (its children are visible). |
boolean |
isTreePathExpanded(javax.swing.tree.TreePath path)
Determines whether the given tree path leads to an object where each of its parent objects is currently expanded (open node) in the tree table. |
boolean |
isVerticalLinesVisible()
Returns TRUE if the vertical lines of the table's grid will be shown. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
|
void |
optimizeColumnWidth()
Optimizes the column width of all columns without taking the cell editors into account. |
void |
optimizeColumnWidth(boolean includeEditors)
Optimizes the column width of all columns with or without taking the cell editors into account. |
void |
optimizeColumnWidth(boolean includeEditors,
int index)
Optimizes the column width of all columns with or without taking the cell editors into account. |
void |
optimizeColumnWidth(boolean includeEditors,
TreeTableColumn column,
boolean keyColumn)
Internal method that does the actual column width optimization. |
void |
optimizeColumnWidth(int index)
Optimizes the column width of all columns without taking the cell editors into account. |
protected void |
paintBackground(java.awt.Graphics g)
Paints the table's background. |
protected void |
paintCell(java.awt.Graphics g,
TreeTableNode node,
int x,
int y,
int width,
int height,
int row,
int column,
int modelIndex,
java.lang.Class columnClass,
boolean fillerColumn)
Paints a single cell into the given graphics context for the given node and the given column. |
protected void |
paintColumn(java.awt.Graphics g,
TreeTableColumn column,
int row,
int x,
java.awt.Rectangle clip,
boolean dragged,
boolean filler)
Draws a column into the given graphics context. |
protected void |
paintColumns(java.awt.Graphics g)
Renders the columns. |
protected void |
paintComponent(java.awt.Graphics g)
Renders the tree table user interface. |
protected void |
paintDragAndDrop(java.awt.Graphics g)
Visualizes the drag and drop user operation. |
java.awt.Component |
prepareEditor(ITreeTableCellEditor editor,
int row,
int column,
java.awt.event.InputEvent evt)
Pepares the given tree table cell editor for editing the cell at the location row and column . |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removeEditor()
Discards the editor object and frees the real estate it used for cell rendering. |
void |
removeSelectionInterval(int start,
int end)
Removes all rows within the given interval from the current selection. |
void |
removeSelectionPath(javax.swing.tree.TreePath path)
Removes a path from the current selection. |
void |
removeSelectionPaths(javax.swing.tree.TreePath[] paths)
Removes the given paths from the current selection. |
void |
removeTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
Removes a tree expansion listener. |
void |
removeTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
Removes a tree selection from the table. |
void |
removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener l)
Removes a tree expansion listener. |
void |
scrollFocusToVisible()
Scrolls the currently focused cell into the visible rectangle of the table's viewport. |
void |
scrollTo(int row)
Scrolls the table inside its viewport so that the given row becomes visible. |
void |
scrollTo(javax.swing.tree.TreePath path)
Scrolls the table inside its viewport so that the last path component becomes visible. |
void |
selectAll()
Selects all tree paths of the currently visible nodes. |
void |
setAlpha(float alpha)
Sets the alpha channel value (default is 1). |
void |
setAlternatingBackground(java.awt.Color color)
Sets the alternating background color. |
void |
setAlternatingForeground(java.awt.Color color)
Sets the alternating foreground color. |
void |
setCellEditor(java.lang.Class cl,
ITreeTableCellEditor editor)
Specifies a cell editor for the given object type. |
void |
setCellRenderer(java.lang.Class cl,
ITreeTableCellRenderer renderer)
Specifies a cell renderer for the given object type. |
void |
setColumnModel(IColumnModel model)
Sets a new column model for the tree table. |
void |
setCreationEnabled(boolean enabled)
Enables/disables the creation of nodes. |
void |
setDefaultRowHeight(int height)
Sets a new default row height. |
void |
setDraggingEnabled(boolean enabled)
Specifies whether or not the table supports drag & drop (DND). |
void |
setDropColorInvalid(java.awt.Color color)
Sets the color that will be used to show where an invalid drop can occure. |
void |
setDropColorValid(java.awt.Color color)
Sets the color that will be used to show where a valid drop can occure. |
void |
setEditingColumn(int col)
Sets the column in which editing currently takes place. |
void |
setEditingRow(int row)
Sets the row in which editing currently takes place. |
void |
setFocusColor(java.awt.Color color)
Sets the color used for drawing the focus rectangle. |
void |
setGridColor(java.awt.Color color)
Sets a new color used for drawing the vertical and horizontal lines of the table's grid. |
void |
setHorizontalLinesVisible(boolean visible)
Specifies whether or not the horizontal grid lines are visible. |
void |
setIndentEnabled(boolean enabled)
Enables/disables the user indentation feature. |
void |
setInset(int inset)
Sets the number of pixels used to inset sub-nodes. |
void |
setLayerContainer(LayerContainer lc)
Attaches a layer container to this table, which attaches itself as a mouse wheel listener to the layer container. |
void |
setMenuProvider(ITreeTableMenuProvider provider)
Sets the menu provider used by the tree table to lookup a popup menu based on the location and context of the popup trigger event. |
void |
setModel(ITreeTableModel model)
Sets a new tree table model. |
void |
setPolicyProvider(IPolicyProvider provider)
Specifies a new policy provider to be used by the table to lookup policy implementations. |
void |
setRendererMap(java.util.Map<java.lang.Class,ITreeTableCellRenderer> map)
Sets the map, which is storing the mappings between cell value types and tree table cell renderers. |
void |
setResizingEnabled(boolean enabled)
Enables/disables row resizing. |
void |
setRootVisible(boolean visible)
Specifies whether or not the root will be shown by the table. |
void |
setRowHeader(TreeTableRowHeader header)
Sets the row header that was created by the component factory and that will be used to control the tree table (expanding / collapsing nodes, row height, selection, ...). |
void |
setRowNumbersVisible(boolean visible)
Specifies whether or not the row numbers are visible. |
void |
setSelectionBackground(java.awt.Color color)
Sets the color used for the background of currently selected rows. |
void |
setSelectionForegroundColor(java.awt.Color color)
Sets the color used for the foreground of currently selected rows. |
void |
setSelectionInterval(int start,
int end)
Selects all rows within the given interval. |
void |
setSelectionMode(int mode)
Sets the selection mode, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION. |
void |
setSelectionModel(ITreeTableSelectionModel model)
Assigns a new selection model to the table. |
void |
setSelectionPath(javax.swing.tree.TreePath path)
Sets the current selection to the given path. |
void |
setSelectionPaths(javax.swing.tree.TreePath[] paths)
Sets the current selection to the given paths. |
void |
setSelectionRow(int row)
Sets a new selection where the only row selected is the given one. |
void |
setSelectionRows(int[] rows)
Sets a new selection with the given rows. |
void |
setTexture(java.awt.Image texture)
Sets the image that is being used to fill the background of the table with a texture. |
void |
setVerticalLinesVisible(boolean visible)
Determines whether the grid's vertical lines will be shown or not. |
void |
treeCollapsed(javax.swing.event.TreeExpansionEvent event)
|
void |
treeExpanded(javax.swing.event.TreeExpansionEvent event)
|
void |
treeNodeKeyChanged(TreeTableModelEvent e)
Callback method that gets invoked if the user edited the key value of a tree table node. |
void |
treeNodesChanged(javax.swing.event.TreeModelEvent e)
|
void |
treeNodesInserted(javax.swing.event.TreeModelEvent e)
|
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent e)
|
void |
treeNodeValueChanged(TreeTableModelEvent e)
Callback method that gets invoked if the user edited a column value of a tree table node. |
void |
treeStructureChanged(javax.swing.event.TreeModelEvent e)
|
void |
treeWillCollapse(javax.swing.event.TreeExpansionEvent event)
|
void |
treeWillExpand(javax.swing.event.TreeExpansionEvent event)
|
void |
updateNodes()
Updates the array of tree table nodes used by the table to store its current state. |
void |
updateUI()
Overrides JComponent.updateUI() in order to initialize colors
used for the background, foreground, and the selection of cells. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_MODEL
setModel(ITreeTableModel)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SELECTION_MODEL
setSelectionModel(ITreeTableSelectionModel)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_ROOT_VISIBLE
setRootVisible(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_HORIZONTAL_LINES_VISIBLE
setHorizontalLinesVisible(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_VERTICAL_LINES_VISIBLE
setVerticalLinesVisible(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_ALT_FOREGROUND_COLOR
setAlternatingForeground(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_ALT_BACKGROUND_COLOR
setAlternatingBackground(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_ROW_NUMBERS_VISIBLE
setRowNumbersVisible(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SELECTION_BACKGROUND_COLOR
setSelectionBackground(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SELECTION_FOREGROUND_COLOR
setSelectionForegroundColor(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_GRID_COLOR
setGridColor(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_INDENT_ENABLED
setIndentEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_DRAGGING_ENABLED
setDraggingEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_RESIZING_ENABLED
setResizingEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_CREATION_ENABLED
setCreationEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_POLICY_PROVIDER
setPolicyProvider(IPolicyProvider)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_DEFAULT_ROW_HEIGHT
setDefaultRowHeight(int)
,
Constant Field ValuesConstructor Detail |
---|
public TreeTable(AbstractGanttChart ganttChart, ITreeTableModel model)
DefaultNodeDragAndDropPolicy
for drag
and drop operations. DefaultNodeEditPolicy
for creating, deleting
and modifying tree nodes. DefaultRowPolicy
for determining
minimum and maximum row heights and for determining and editing actual
row heights.
ganttChart
- the Gantt chart that will contain the tree table as a child
componentmodel
- the tree table model that serves as a data source for the tree
tableIComponentFactory.createTreeTable(AbstractGanttChart,
ITreeTableModel)
Method Detail |
---|
public void updateUI()
JComponent.updateUI()
in order to initialize colors
used for the background, foreground, and the selection of cells.
updateUI
in class javax.swing.JPanel
JComponent.updateUI()
public AbstractGanttChart getGanttChart()
TreeTable(AbstractGanttChart, ITreeTableModel)
public ITreeTableModel getModel()
setModel(ITreeTableModel)
public ITreeTableSelectionModel getSelectionModel()
setSelectionModel(ITreeTableSelectionModel)
public void setSelectionModel(ITreeTableSelectionModel model)
PROPERTY_SELECTION_MODEL
.
model
- the new selection modelgetSelectionModel()
public void setModel(ITreeTableModel model)
PROPERTY_MODEL
.
model
- the new tree table modelgetModel()
public void setColumnModel(IColumnModel model)
model
- the new column model to usepublic IColumnModel getColumnModel()
public KeyColumn getKeyColumn()
AbstractGanttChart.getKeyColumn()
.
public TreeTableColumn getColumn(int index)
TreeTableHeader.getColumn(int)
.
index
- the index of the column to return
getKeyColumn()
,
getColumnIndex(TreeTableColumn)
public int getColumnIndex(TreeTableColumn col)
IColumnModel.getColumnIndex(TreeTableColumn)
.
col
- the column for which to return the index
public int getColumnCount()
AbstractGanttChart.getColumnCount()
.
public int getKeyColumnPosition()
AbstractGanttChart.getKeyColumnPosition()
.
public void setLayerContainer(LayerContainer lc)
lc
- the layer container to attachgetLayerContainer()
public LayerContainer getLayerContainer()
getLayerContainer()
public ITreeTableCellEditor getCellEditor(int row, int column)
getCellEditor(Class)
after it has determined the object type
either based on an already existing cell value or by using the column
class definied in TreeTableColumn
.
row
- the table rowcolumn
- the table column
DefaultTreeTableCellEditor
,
setCellEditor(Class, ITreeTableCellEditor)
public void setCreationEnabled(boolean enabled)
PROPERTY_CREATION_ENABLED
.
enabled
- if TRUE the table will allow the user to add new nodesisCreationEnabled()
public boolean isCreationEnabled()
INodeEditPolicy
.
setCreationEnabled(boolean)
,
INodeEditPolicy.isCreateEnabled(ITreeTableModel)
public boolean isCellEditable(int row, int column)
INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int)
.
row
- the table rowcolumn
- the table column
public int getEditingColumn()
getEditingRow()
,
getEditorComponent()
public void setEditingColumn(int col)
col
- the editing columngetEditingColumn()
,
setEditingRow(int)
public int getEditingRow()
getEditingColumn()
,
getEditorComponent()
,
setEditingRow(int)
public void setEditingRow(int row)
row
- the editing rowsetEditingColumn(int)
,
getEditingRow()
public java.awt.Rectangle getCellRect(int row, int column)
row
- the row of the cellcolumn
- the column of the cell
public boolean editCellAt(int row, int column)
row
and
column
, if those indices are in the valid range, and the
cell at those indices is editable. Note that this is a convenience method
for editCellAt(int, int, null)
.
row
- the cell's rowcolumn
- the cell's column
public int getFocusedRow()
CellFocusManager.getFocusedRow()
.
getFocusedColumn()
public int getFocusedColumn()
CellFocusManager.getFocusedColumn()
.
getFocusedRow()
public boolean editCellFocused(java.awt.event.InputEvent evt)
evt
- the input event that triggered the editing
editCellAt(int, int)
,
editCellAt(int, int, InputEvent)
public boolean editCellAt(int row, int column, java.awt.event.InputEvent e)
row
and
column
, if those indices are in the valid range, and the
cell at those indices is editable. To prevent the JTable
from editing a particular table, column or cell value, return false from
the isCellEditable
method in the TableModel
interface.
row
- the row to be editedcolumn
- the column to be editede
- event to pass into shouldSelectCell
; note that
as of Java 2 platform v1.2, the call to
shouldSelectCell
is no longer made
public void removeEditor()
getCellEditor()
public java.awt.Component getEditorComponent()
public boolean isEditing()
public ITreeTableCellEditor getCellEditor()
TreeTableColumn.getColumnClass()
.
setCellEditor(Class, ITreeTableCellEditor)
,
getCellEditor(Class)
public java.awt.Component prepareEditor(ITreeTableCellEditor editor, int row, int column, java.awt.event.InputEvent evt)
row
and column
. The edit sequence
was triggered by the given input event. The user interface component used
for editing will be initialized with the cell's value.
editor
- the editor to prepare for the next editing sequencerow
- the cell's rowcolumn
- the cell's columnevt
- the input event
public TreeTableHeader getTreeTableHeader()
public void updateNodes()
public void setInset(int inset)
inset
- the number of pixels used to inset nodesgetInset()
public int getInset()
public void addTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
l
- the tree expansion listeneraddTreeWillExpandListener(TreeWillExpandListener)
public void removeTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
l
- the listener to removeremoveTreeWillExpandListener(TreeWillExpandListener)
public void addTreeWillExpandListener(javax.swing.event.TreeWillExpandListener l)
l
- the tree expansion listenerremoveTreeWillExpandListener(TreeWillExpandListener)
,
addTreeExpansionListener(TreeExpansionListener)
public void removeTreeWillExpandListener(javax.swing.event.TreeWillExpandListener l)
l
- the tree expansion listeneraddTreeWillExpandListener(TreeWillExpandListener)
public void addTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
TreeSelectionModel.addTreeSelectionListener(javax.swing.event.TreeSelectionListener)
.
l
- the tree selection listenerremoveTreeSelectionListener(TreeSelectionListener)
public void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
l
- the listener to removeaddTreeSelectionListener(TreeSelectionListener)
protected void fireTreeWillExpand(javax.swing.tree.TreePath path) throws javax.swing.tree.ExpandVetoException
ExpandVetoException
, thus terminating the
node expansion.
path
- the tree path that will get expanded
javax.swing.tree.ExpandVetoException
- if one of the tree expansion listeners threw an exception
like thisTreeExpansionEvent
protected void fireTreeWillCollapse(javax.swing.tree.TreePath path) throws javax.swing.tree.ExpandVetoException
ExpandVetoException
, thus terminating the
node collapse.
path
- the tree path that will get collapsed
javax.swing.tree.ExpandVetoException
- if one of the tree expansion listeners threw an exception
like thisTreeExpansionEvent
protected void fireTreeExpanded(javax.swing.tree.TreePath path)
path
- the tree path location of the node that got expandedTreeExpansionEvent
protected void fireTreeCollapsed(javax.swing.tree.TreePath path)
path
- the tree path location of the node that got collapsedTreeExpansionEvent
public void setResizingEnabled(boolean enabled)
IRowPolicy
to determine
whether or not a table row can indeed be resized and if so within which
bounds (minimum, maximum height).
enabled
- if TRUE the table generally supports row resizingpublic boolean isResizingEnabled()
IRowPolicy
), which returns minimum and maximum
heights for each row.
setResizingEnabled(boolean)
,
IRowPolicy.isRowResizable(Object, ITreeTableModel)
public void setDraggingEnabled(boolean enabled)
INodeDragAndDropPolicy
to determine whether or not an individual tree node can be dragged and
where it can be dropped. The method will trigger a property change event
where the property name will be PROPERTY_DRAGGING_ENABLED
.
enabled
- isDraggingEnabled()
,
INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)
,
Object, ITreeTableModel,
int)
,
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
ITreeTableModel, int, Object, ITreeTableModel, int, int)
public boolean isDraggingEnabled()
setDraggingEnabled(boolean)
public void setIndentEnabled(boolean enabled)
PROPERTY_INDENT_ENABLED
. Indentation is basically
the same as a drag and drop operation where a tree node X gets dropped on
the next node Y above itself where Y.getDepth() equals X.getDepth().
enabled
- isIndentEnabled()
public boolean isIndentEnabled()
setIndentEnabled(boolean)
public int getFirstVisibleRow()
public int getLastVisibleRow()
public int getRowCount()
public void selectAll()
clearSelection()
,
addSelectionPath(TreePath)
,
addSelectionRow(int)
public void clearSelection()
selectAll()
,
addSelectionPath(TreePath)
,
addSelectionRow(int)
public void setSelectionPath(javax.swing.tree.TreePath path)
path
- the new selectionsetSelectionRow(int)
,
setSelectionPaths(TreePath[])
,
selectAll()
public void setSelectionPaths(javax.swing.tree.TreePath[] paths)
paths
- the new selectionsetSelectionPath(TreePath)
,
setSelectionRows(int[])
,
selectAll()
public void addSelectionPath(javax.swing.tree.TreePath path)
path
- another selected pathsetSelectionPath(TreePath)
,
addSelectionPath(TreePath)
,
clearSelection()
public void removeSelectionPath(javax.swing.tree.TreePath path)
path
- the path to removeremoveSelectionInterval(int, int)
,
clearSelection()
public void addSelectionPaths(javax.swing.tree.TreePath[] paths)
paths
- the paths to add to the selectionsetSelectionPaths(TreePath[])
,
addSelectionInterval(int, int)
,
addSelectionRows(int[])
,
selectAll()
public void removeSelectionPaths(javax.swing.tree.TreePath[] paths)
paths
- the paths to removeremoveSelectionInterval(int, int)
,
clearSelection()
public void addSelectionRow(int row)
row
- the row to addaddSelectionInterval(int, int)
,
addSelectionPath(TreePath)
,
selectAll()
public void addSelectionRows(int[] rows)
rows
- the rows to add to the selectionaddSelectionPaths(TreePath[])
,
addSelectionInterval(int, int)
,
selectAll()
public void setSelectionRow(int row)
row
- the new selectionsetSelectionRows(int[])
,
setSelectionPath(TreePath)
public void setSelectionRows(int[] rows)
rows
- the new selectionsetSelectionRow(int)
,
setSelectionPath(TreePath)
public javax.swing.tree.TreePath getSelectionPath()
getSelectionPaths()
public javax.swing.tree.TreePath[] getSelectionPaths()
getSelectionPath()
public void setSelectionInterval(int start, int end)
start
- the start row to include in the selectionend
- the end row to include in the selectionsetSelectionPaths(TreePath[])
,
setSelectionRows(int[])
public void addSelectionInterval(int start, int end)
start
- the start row to include in the selectionend
- the end row to include in the selectionaddSelectionPaths(TreePath[])
,
addSelectionRows(int[])
public void removeSelectionInterval(int start, int end)
start
- the first row to remove from the current selectionend
- the last row to remove from the current selectionremoveSelectionPaths(TreePath[])
public boolean isPathSelected(javax.swing.tree.TreePath path)
path
- the tree path to check for selection
isRowSelected(int)
public boolean isRowSelected(int row)
row
- the row to check
isPathSelected(TreePath)
public void setSelectionMode(int mode)
mode
- the selection modelgetSelectionMode()
public int getSelectionMode()
setSelectionMode(int)
public int getSelectionCount()
public javax.swing.tree.TreePath[] getPathsBetweenRows(int start, int end)
start
- the start row indexend
- the end row index
public boolean isTreePathExpanded(javax.swing.tree.TreePath path)
path
- the path to check
public boolean isTreeNodeExpanded(javax.swing.tree.TreePath path)
path
- the tree path leading to the node to check for its expansion
state
public javax.swing.tree.TreePath getTreePath(int row)
row
- the row for which to return a path
getTreePaths(int[])
public javax.swing.tree.TreePath[] getTreePaths(int[] rows)
rows
- the row for which to return paths
getTreePath(int)
public boolean containsPath(javax.swing.tree.TreePath path)
path
- the path to check
public void expandAll()
TreeTableNode.expand()
on each visited node.
expandPath(TreePath)
,
expandRow(int)
public void expandPath(javax.swing.tree.TreePath path)
path
- the path of the tree node to expandexpandAll()
,
expandRow(int)
public void expandRow(int row)
row
- the row to expandexpandAll()
,
expandPath(TreePath)
public void collapseAll()
TreeTableNode.collapse()
on each visited node.
collapsePath(TreePath)
,
collapseRow(int)
public void collapsePath(javax.swing.tree.TreePath path)
path
- the path of the tree node to collapsecollapseAll()
,
collapseRow(int)
public void collapseRow(int row)
row
- the row to collapsecollapseAll()
,
collapseRow(int)
public TreeTableNode[] getTreeTableNodes()
public void setGridColor(java.awt.Color color)
PROPERTY_GRID_COLOR
.
color
- the color used for drawing the vertical and horizontal grid
linesgetGridColor()
public java.awt.Color getGridColor()
setGridColor(Color)
public boolean isHorizontalLinesVisible()
setHorizontalLinesVisible(boolean)
public void setHorizontalLinesVisible(boolean visible)
PROPERTY_HORIZONTAL_LINES_VISIBLE
.
visible
- show/hide horizontal grid linesisHorizontalLinesVisible()
public boolean isRowNumbersVisible()
setRowNumbersVisible(boolean)
public void setRowNumbersVisible(boolean visible)
PROPERTY_ROW_NUMBERS_VISIBLE
.
visible
- show/hide row numbersisRowNumbersVisible()
public boolean isRootVisible()
setRootVisible(boolean)
public void setRootVisible(boolean visible)
PROPERTY_ROOT_VISIBLE
.
visible
- isRootVisible()
public boolean isVerticalLinesVisible()
setVerticalLinesVisible(boolean)
public void setVerticalLinesVisible(boolean visible)
PROPERTY_VERTICAL_LINES_VISIBLE
.
visible
- isVerticalLinesVisible()
public java.awt.Color getAlternatingForeground()
setAlternatingForeground(Color)
public void setAlternatingForeground(java.awt.Color color)
PROPERTY_ALT_FOREGROUND_COLOR
.
color
- the alternating foreground color (second foreground color)getAlternatingForeground()
public java.awt.Color getAlternatingBackground()
setAlternatingBackground(Color)
public void setAlternatingBackground(java.awt.Color color)
PROPERTY_ALT_BACKGROUND_COLOR
.
color
- the alternating background color (second background color)getAlternatingBackground()
public void setSelectionBackground(java.awt.Color color)
PROPERTY_SELECTION_BACKGROUND_COLOR
.
color
- the selection background colorgetSelectionBackground()
,
setSelectionForegroundColor(Color)
public java.awt.Color getSelectionBackground()
setSelectionBackground(Color)
,
getSelectionForegroundColor()
public java.awt.Color getSelectionForegroundColor()
setSelectionForegroundColor(Color)
,
getSelectionBackground()
public void setSelectionForegroundColor(java.awt.Color color)
PROPERTY_SELECTION_FOREGROUND_COLOR
.
color
- the selection foreground colorgetSelectionForegroundColor()
,
setSelectionBackground(Color)
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- the graphics context used for drawingpaintColumns(Graphics)
,
paintDragAndDrop(Graphics)
protected void paintBackground(java.awt.Graphics g)
g
- the graphics context into which to drawgetAlternatingBackground()
,
getBackground(int, boolean)
protected void paintColumns(java.awt.Graphics g)
ColumnModelIterator
to iterate over the columns.
g
- the graphics context used for drawingprotected void paintColumn(java.awt.Graphics g, TreeTableColumn column, int row, int x, java.awt.Rectangle clip, boolean dragged, boolean filler)
g
- the graphics context used for drawingcolumn
- the column to drawrow
- the row where to start renderingx
- the column x-coordinateclip
- the clipping rectangledragged
- TRUE if the column is the currently dragged columnfiller
- TRUE if the column is the filler column that always shows up
on the very right side of the tableprotected void paintDragAndDrop(java.awt.Graphics g)
g
- the graphics context used for drawingprotected void paintCell(java.awt.Graphics g, TreeTableNode node, int x, int y, int width, int height, int row, int column, int modelIndex, java.lang.Class columnClass, boolean fillerColumn)
g
- the graphics context used for drawingnode
- the node located in the cell's rowx
- the x-coordinate of the cell boundsy
- the y-coordinate of the cell boundswidth
- the width of the cell boundsheight
- the height of the cell boundsrow
- the row in which the cell is locatedcolumn
- the column in which the cell is locatedmodelIndex
- the model index used to lookup the column valuescolumnClass
- the type of the objects shown in the given columnfillerColumn
- TRUE if the column is the filler column that always shows up
on the very right side of the tableITreeTableCellRenderer
public int getRowHeight(int row)
row
- the row
public java.awt.Color getForeground(int row, boolean includeSelection)
row
- the row for which to determine the foreground colorincludeSelection
- if TRUE then the selection foreground color will be returned
if the row is currently selected
public java.awt.Color getForeground(int row)
row
- the row for which to determine the foreground color
getForeground(int, boolean)
public java.awt.Color getBackground(int row, boolean includeSelection)
row
- the row for which to determine the background colorincludeSelection
- if TRUE then the selection background color will be returned
if the row is currently selected
public java.awt.Color getBackground(int row)
row
- the row for which to determine the background color
getBackground(int, boolean)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void scrollTo(int row)
row
- the row to make visiblescrollFocusToVisible()
,
JComponent.scrollRectToVisible(Rectangle)
public void scrollTo(javax.swing.tree.TreePath path)
path
- the path for which to show the last componentscrollFocusToVisible()
,
JComponent.scrollRectToVisible(Rectangle)
,
scrollTo(int)
public void scrollFocusToVisible()
scrollTo(int)
,
JComponent.scrollRectToVisible(Rectangle)
public int getColumnIndexAt(int x)
x
- the x-coordinate to check
TreeTableHeader.getColumn(int)
public int getRowAt(int y)
y
- the y-coordinate of the row to return
public int getVisibleRowCount()
public TreeTableNode getTreeTableNodeAt(int y)
y
- the y-coordinate
public TreeTableNode[] getTreeTableNodesBetween(int y1, int y2)
y1
- the start y-coordinatey2
- the end y-coordinate
public void treeNodeKeyChanged(TreeTableModelEvent e)
ITreeTableModelListener
treeNodeKeyChanged
in interface ITreeTableModelListener
e
- the event fired by the tree table modelITreeTableModelListener.treeNodeValueChanged(TreeTableModelEvent)
public void treeNodeValueChanged(TreeTableModelEvent e)
ITreeTableModelListener
treeNodeValueChanged
in interface ITreeTableModelListener
e
- the event fired by the tree table modelITreeTableModelListener.treeNodeKeyChanged(TreeTableModelEvent)
public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
treeNodesChanged
in interface javax.swing.event.TreeModelListener
public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
treeNodesInserted
in interface javax.swing.event.TreeModelListener
public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
treeNodesRemoved
in interface javax.swing.event.TreeModelListener
public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
treeStructureChanged
in interface javax.swing.event.TreeModelListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public java.lang.String getToolTipText(java.awt.event.MouseEvent evt)
IRowPolicy
for the actual text to display.
getToolTipText
in class javax.swing.JComponent
evt
- the mouse event
IRowPolicy.getRowToolTip(Object, ITreeTableModel, TreeTableColumn)
public void optimizeColumnWidth()
optimizeColumnWidth(boolean, int)
public void optimizeColumnWidth(boolean includeEditors)
includeEditors
- if TRUE the algorithm will take the preferred width of the
cell editor for each cell into accountoptimizeColumnWidth(boolean, int)
public void optimizeColumnWidth(int index)
index
- the width of the column with the given index will be optimizedoptimizeColumnWidth(boolean, int)
public void optimizeColumnWidth(boolean includeEditors, int index)
includeEditors
- if TRUE the algorithm will take the preferred width of the
cell editor for each cell into accountindex
- the width of the column with the given index will be optimizedoptimizeColumnWidth(boolean, int)
public void optimizeColumnWidth(boolean includeEditors, TreeTableColumn column, boolean keyColumn)
includeEditors
- if TRUE the algorithm will take the preferred width of the
cell editor for each cell into accountcolumn
- the column to optimizekeyColumn
- if TRUE the given column is the key columnpublic void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged
in interface javax.swing.event.TreeSelectionListener
public int[] getRowsForPaths(javax.swing.tree.TreePath[] paths)
getRowsForPaths
in interface javax.swing.tree.RowMapper
public int getRowForPath(javax.swing.tree.TreePath path)
path
- the tree path for which to return the row
public void commandStackChanged(CommandStackEvent evt)
ICommandStackListener
commandStackChanged
in interface ICommandStackListener
evt
- the event issued by the command stackpublic java.lang.Class getColumnClass(int columnIndex)
columnIndex
- the column index
public void editingStopped(javax.swing.event.ChangeEvent e)
editingStopped
in interface javax.swing.event.CellEditorListener
public void editingCanceled(javax.swing.event.ChangeEvent e)
editingCanceled
in interface javax.swing.event.CellEditorListener
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void treeExpanded(javax.swing.event.TreeExpansionEvent event)
treeExpanded
in interface javax.swing.event.TreeExpansionListener
public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
treeCollapsed
in interface javax.swing.event.TreeExpansionListener
public void treeWillCollapse(javax.swing.event.TreeExpansionEvent event)
treeWillCollapse
in interface javax.swing.event.TreeWillExpandListener
public void treeWillExpand(javax.swing.event.TreeExpansionEvent event)
treeWillExpand
in interface javax.swing.event.TreeWillExpandListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public CellFocusManager getCellFocusManager()
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public IPolicyProvider getPolicyProvider()
public void setPolicyProvider(IPolicyProvider provider)
provider
- the policy provider to be used by the table to lookup policy
implementationspublic void setDefaultRowHeight(int height)
height
- the default height used for rowsgetDefaultRowHeight()
public int getDefaultRowHeight()
IRowPolicy
is not used to determine the height.
IRowPolicy.getRowHeight(Object, ITreeTableModel)
public TreeTableNode getRootNode()
TreeTableNode.getModelNode()
on the node.
public java.awt.Image getTexture()
setTexture(Image)
public void setTexture(java.awt.Image texture)
texture
- the background texture imagepublic float getAlpha()
public void setAlpha(float alpha)
alpha
- the alpha channel valuepublic void columnModelChanged(ColumnModelEvent evt)
IColumnModelListener
columnModelChanged
in interface IColumnModelListener
evt
- the event descriptionpublic java.awt.Color getFocusColor()
public void setFocusColor(java.awt.Color color)
color
- the color used for the focus rectanglepublic ITreeTableMenuProvider getMenuProvider()
public void setMenuProvider(ITreeTableMenuProvider provider)
provider
- the table's menu providerpublic void setCellRenderer(java.lang.Class cl, ITreeTableCellRenderer renderer)
TreeTableColumn.getColumnClass()
will be used
to look up a renderer.
cl
- the object typerenderer
- the renderer used to visualize objects of the given typegetCellRenderer(Class)
public void setCellEditor(java.lang.Class cl, ITreeTableCellEditor editor)
TreeTableColumn.getColumnClass()
will be used to look up an
editor.
cl
- the object typeeditor
- the editor used to edit objects of the given typegetCellEditor(Class)
public ITreeTableCellRenderer getCellRenderer(java.lang.Class cl)
TreeTableColumn.getColumnClass()
will be used
to look up a renderer.
cl
- the object type for which to return a matching cell renderer
setCellRenderer(Class, ITreeTableCellRenderer)
public ITreeTableCellEditor getCellEditor(java.lang.Class cl)
TreeTableColumn.getColumnClass()
will be used to look up an
edtior.
cl
- the object type for which to return a matching cell editor
setCellEditor(Class, ITreeTableCellEditor)
public java.util.Map<java.lang.Class,ITreeTableCellRenderer> getRendererMap()
public void setRendererMap(java.util.Map<java.lang.Class,ITreeTableCellRenderer> map)
map
- the renderer mappublic TreeTableRowHeader getRowHeader()
public void setRowHeader(TreeTableRowHeader header)
header
- the row header used for the tree tablepublic void autoscroll(java.awt.Point cursorLocn)
autoscroll
in interface java.awt.dnd.Autoscroll
public java.awt.Insets getAutoscrollInsets()
getAutoscrollInsets
in interface java.awt.dnd.Autoscroll
public javax.swing.CellRendererPane getRendererPane()
public TreeTableDragAndDropManager getDragAndDropManager()
protected TreeTableDragAndDropManager createDragAndDropManager()
public void animateDropPath(javax.swing.tree.TreePath path)
path
- the path to animatepublic java.awt.Color getDropColorValid()
public void setDropColorValid(java.awt.Color color)
color
- the 'valid drop' colorpublic java.awt.Color getDropColorInvalid()
public void setDropColorInvalid(java.awt.Color color)
color
- the 'invalid drop' color
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |