public class TreeTable extends JPanel implements PropertyChangeListener, TreeSelectionListener, MouseListener, MouseMotionListener, MouseWheelListener, TreeWillExpandListener, TreeExpansionListener, ITreeTableModelListener, RowMapper, CellEditorListener, IColumnModelListener, Autoscroll, IEditable
INodeEditPolicy
and INodeDragAndDropPolicy
.ITreeTableModel
,
ITreeTableNode
,
DefaultMutableTreeTableNode
,
INodeEditPolicy
,
INodeDragAndDropPolicy
,
IRowPolicy
,
Serialized FormModifier and Type | Class and Description |
---|---|
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...).
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static Cursor |
INDENT_CURSOR
The cursor that will be shown when the user wants to manually indent a
tree node.
|
static String |
PROPERTY_ALT_BACKGROUND_COLOR
Constant used for the property change event that gets fired when the
alternating background color changes.
|
static String |
PROPERTY_ALT_FOREGROUND_COLOR
Constant used for the property change event that gets fired when the
alternating background color changes.
|
static 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 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 String |
PROPERTY_DELETION_ENABLED
Constant used for the property change event that gets fired when the
support for deleting nodes (directly inside the table) gets enabled or
disabled.
|
static String |
PROPERTY_DRAGGING_ENABLED
Constant used for the property change event that gets fired when the drag
& drop support gets enabled/disabled.
|
static String |
PROPERTY_DROPPING_ENABLED
Constant used for the property change event that gets fired when the
support for dropping nodes gets enabled or disabled.
|
static String |
PROPERTY_EDITING_ENABLED
Constant used for the property change event that gets fired when the
support for editing nodes gets enabled or disabled.
|
static String |
PROPERTY_HORIZONTAL_GRID_COLOR
Constant used for the property change event that gets fired when the
horizontal grid color changes.
|
static String |
PROPERTY_HORIZONTAL_LINES_VISIBLE
Constant used for the property change event that gets fired when the
visibility of the horizontal lines changes.
|
static String |
PROPERTY_INDENT_ENABLED
Constant used for the property change event that gets fired when the
indentation feature gets enabled/disabled.
|
static String |
PROPERTY_MODEL
Constant used for the property change event that gets fired when the tree
table model changes.
|
static 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 String |
PROPERTY_RESIZING_ENABLED
Constant used for the property change event that gets fired when the
resizing support gets enabled/disabled.
|
static String |
PROPERTY_ROOT_VISIBLE
Constant used for the property change event that gets fired when the
visibility of the root node changes.
|
static String |
PROPERTY_ROW_NUMBERS_VISIBLE
Constant used for the property change event that gets fired when the
visibility of the row numbers changes.
|
static String |
PROPERTY_SELECTION_BACKGROUND_COLOR
Constant used for the property change event that gets fired when the
selection background color changes.
|
static String |
PROPERTY_SELECTION_FOREGROUND_COLOR
Constant used for the property change event that gets fired when the
selection foreground color changes.
|
static String |
PROPERTY_SELECTION_MODEL
Constant used for the property change event that gets fired when the
selection model changes.
|
static String |
PROPERTY_VERTICAL_GRID_COLOR
Constant used for the property change event that gets fired when the
vertical grid color changes.
|
static String |
PROPERTY_VERTICAL_LINES_VISIBLE
Constant used for the property change event that gets fired when the
visibility of the vertical lines changes.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TreeTable(AbstractGanttChart ganttChart,
ITreeTableModel model)
Constructs a new tree table.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionInterval(int start,
int end)
Adds all rows within the given interval to the current selection.
|
void |
addSelectionPath(TreePath path)
Adds another path to the current selection.
|
void |
addSelectionPaths(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(TreeExpansionListener l)
Adds a tree expansion listener that will receive events after a
tree node has been expanded.
|
void |
addTreeSelectionListener(TreeSelectionListener l)
Adds a tree selection listener to the table.
|
void |
addTreeWillExpandListener(TreeWillExpandListener l)
Adds a tree expansion listener that will be informed before a tree
node expands.
|
void |
autoscroll(Point cursorLocation) |
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(TreePath path)
Collapses the tree node that matches the given path.
|
void |
collapsePathAnimated(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 |
collapseRowAnimated(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.
|
boolean |
containsPath(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.
|
void |
deleteSelectedNodes()
Deletes all nodes/paths that are currently selected.
|
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,
EventObject e)
Programatically 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(InputEvent evt)
Starts the editing of the currently focused table cell.
|
void |
editingCanceled(ChangeEvent e) |
void |
editingStopped(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(TreePath path)
Expands the tree node that matches the given path.
|
void |
expandPathAnimated(TreePath path)
Expands the tree node that matches the given path.
|
void |
expandRow(int row)
Expands the tree node located in the given row.
|
void |
expandRowAnimated(int row)
Expands the tree node located in the given row.
|
protected void |
fireTreeCollapsed(TreePath path)
Fires a tree expansion event after a node collapsed.
|
protected void |
fireTreeExpanded(TreePath path)
Fires a tree expansion event after a node expanded.
|
protected void |
fireTreeWillCollapse(TreePath path)
Fires a tree expansion event before a node collapses.
|
protected void |
fireTreeWillExpand(TreePath path)
Fires a tree expansion event before a node expands.
|
float |
getAlpha()
Returns the alpha channel value (default is 1).
|
Color |
getAlternatingBackground()
Returns the alternating background color.
|
Color |
getAlternatingForeground()
Returns the alternating foreground color.
|
TreeTableNode |
getAnimationNode()
Returns the internal node that is currently being toggled and animated.
|
double |
getAnimationPercentage()
Returns the animation progress in percentage.
|
Insets |
getAutoscrollInsets() |
Color |
getBackground(int row)
Returns the background color for the given row.
|
Color |
getBackground(int row,
boolean includeSelection)
Returns the background color for the given row.
|
ITreeTableCellEditor |
getCellEditor()
Returns the currently used cell editor.
|
ITreeTableCellEditor |
getCellEditor(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.
|
Rectangle |
getCellRect(int row,
int column)
Returns the cell rectangle for the cell at the given row and column.
|
ITreeTableCellRenderer |
getCellRenderer(Class cl)
Returns a cell renderer for the given object type.
|
TreeTableColumn |
getColumn(int index)
Returns the column for the given index.
|
TreeTableColumn |
getColumnAt(int x)
Returns the column at the given x coordinate.
|
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.
|
Color |
getDropColorInvalid()
Returns the color that will be used to show where an invalid drop can
occure.
|
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.
|
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.
|
int |
getFocusedColumn()
Returns the column of the focused cell.
|
int |
getFocusedRow()
Returns the row of the focused cell.
|
Color |
getForeground(int row)
Returns the foreground color for the given row.
|
Color |
getForeground(int row,
boolean includeSelection)
Returns the foreground color for the given row.
|
AbstractGanttChart |
getGanttChart()
Returns the parent Gantt chart of the table.
|
Color |
getHorizontalGridColor()
Returns the color used for drawing the vertical 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.
|
NodeAnimationController |
getNodeAnimationController()
Returns the node animation controller class that stores all settings
relevant for animating the expansion / collapse of a tree node.
|
INodeFilter |
getNodeFilter()
Returns the currently used node filter.
|
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.
|
Dimension |
getPreferredSize()
Returns the preferred size.
|
Map<Class,ITreeTableCellRenderer> |
getRendererMap()
Returns the map, which is storing the mappings between cell value types
and tree table cell renderers.
|
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(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(TreePath[] paths) |
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.
|
Color |
getSelectionForeground()
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.
|
TreePath |
getSelectionPath()
Returns the current selection path.
|
TreePath[] |
getSelectionPaths()
Returns the current selection paths.
|
Image |
getTexture()
Returns the image that is being used to fill the background of the table
with a texture.
|
String |
getToolTipText(MouseEvent evt)
Returns the text for a tooltip that is appropriate for the given mouse
event and its location.
|
TreePath |
getTreePath(int row)
Returns a tree path object for the given row.
|
TreePath |
getTreePathAt(int y)
Returns a tree path object for the given y coordinate.
|
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.
|
List<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.
|
Color |
getVerticalGridColor()
Returns the color used for drawing the vertical lines of the grid.
|
int |
getVisibleRowCount()
Returns the number of rows currently shown in the visible part of the
tree table.
|
void |
indentNodes(TreePath[] paths)
The reverse operation of
outdentNodes(TreePath[]) . |
void |
insertNode(int row)
Inserts a new row at the given location.
|
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 |
isDeletionEnabled()
Returns TRUE if the table allows the user to delete nodes from the tree
table's data model.
|
boolean |
isDraggingEnabled()
Returns TRUE if the table supports dragging nodes as part of a DnD
operation.
|
boolean |
isDroppingEnabled()
Returns TRUE if the table supports dropping nodes as part of a DnD
operations.
|
boolean |
isEditing()
Returns TRUE if a cell is currently being edited.
|
boolean |
isEditingEnabled()
Returns TRUE if the table allows the user to edit the node keys and
values.
|
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(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(TreePath path)
Determines whether the tree node specified by the given tree path is
exapanded (its children are visible).
|
boolean |
isTreePathExpanded(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 |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e) |
void |
outdentNodes(TreePath[] paths)
The reverse operation of
indentNodes(TreePath[]) . |
protected void |
paintBackground(Graphics g)
Paints the table's background.
|
protected void |
paintCell(Graphics g,
TreeTableColumn column,
TreeTableNode node,
int x,
int y,
int width,
int height,
int row,
int columnIndex,
int modelIndex,
Class columnClass,
boolean fillerColumn)
Paints a single cell into the given graphics context for the given node
and the given column.
|
protected void |
paintColumn(Graphics g,
TreeTableColumn column,
int row,
int x,
Rectangle clip,
boolean dragged,
boolean filler)
Draws a column into the given graphics context.
|
protected void |
paintColumns(Graphics g)
Renders the columns.
|
protected void |
paintComponent(Graphics g)
Renders the tree table user interface.
|
protected void |
paintDragAndDrop(Graphics g)
Visualizes the drag and drop user operation.
|
protected void |
paintIndentationLine(Graphics g,
int x)
Draws the line for the visual feedback of an indentation operation in
progress.
|
void |
propertyChange(PropertyChangeEvent evt) |
void |
removeEditor()
Discards the editor object and frees the real estate it used for cell
rendering.
|
void |
removeNotify()
Overriden to ensure that the table disconnects from the
KeyboardFocusManager class.
|
void |
removeSelectionInterval(int start,
int end)
Removes all rows within the given interval from the current selection.
|
void |
removeSelectionPath(TreePath path)
Removes a path from the current selection.
|
void |
removeSelectionPaths(TreePath[] paths)
Removes the given paths from the current selection.
|
void |
removeTreeExpansionListener(TreeExpansionListener l)
Removes a tree expansion listener.
|
void |
removeTreeSelectionListener(TreeSelectionListener l)
Removes a tree selection from the table.
|
void |
removeTreeWillExpandListener(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(int row,
boolean showInFirstRow)
Scrolls the table inside its viewport so that the given row becomes
visible.
|
void |
scrollTo(TreePath path)
Scrolls the table inside its viewport so that the last path component
becomes visible.
|
void |
scrollTo(TreePath path,
boolean showInFirstRow)
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(Color color)
Sets the alternating background color.
|
void |
setAlternatingForeground(Color color)
Sets the alternating foreground color.
|
void |
setCellEditor(Class cl,
ITreeTableCellEditor editor)
Specifies a cell editor for the given object type.
|
void |
setCellRenderer(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 |
setDeletionEnabled(boolean enabled)
Enables/disables the deletion of nodes.
|
void |
setDraggingEnabled(boolean enabled)
Specifies whether or not the table supports drag & drop (DND).
|
void |
setDropColorInvalid(Color color)
Sets the color that will be used to show where an invalid drop can
occure.
|
void |
setDropColorValid(Color color)
Sets the color that will be used to show where a valid drop can occure.
|
void |
setDroppingEnabled(boolean enabled)
Specifies whether or not the table supports drop operations as part of a
drag & drop (DND) sequence.
|
void |
setEditingColumn(int col)
Sets the column in which editing currently takes place.
|
void |
setEditingEnabled(boolean enabled)
Enables/disables the editing of nodes.
|
void |
setEditingRow(int row)
Sets the row in which editing currently takes place.
|
void |
setGridColor(Color color)
Sets a new color used for drawing the vertical and horizontal lines of
the table's grid.
|
void |
setHorizontalGridColor(Color color)
Sets a new color used for drawing the vertical 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 |
setNodeAnimationController(NodeAnimationController settings)
Sets a new node animation controller on the table.
|
void |
setNodeFilter(INodeFilter filter)
Sets a node filter on the tree table.
|
void |
setPolicyProvider(IPolicyProvider provider)
Specifies a new policy provider to be used by the table to lookup policy
implementations.
|
void |
setRendererMap(Map<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(Color color)
Sets the color used for the background of currently selected rows.
|
void |
setSelectionForeground(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(TreePath path)
Sets the current selection to the given path.
|
void |
setSelectionPaths(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(Image texture)
Sets the image that is being used to fill the background of the table
with a texture.
|
void |
setVerticalGridColor(Color color)
Sets a new color used for drawing the vertical lines of the table's grid.
|
void |
setVerticalLinesVisible(boolean visible)
Determines whether the grid's vertical lines will be shown or not.
|
void |
treeCollapsed(TreeExpansionEvent event) |
void |
treeExpanded(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(TreeModelEvent e) |
void |
treeNodesInserted(TreeModelEvent e) |
void |
treeNodesRemoved(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(TreeModelEvent e) |
void |
treeWillCollapse(TreeExpansionEvent event) |
void |
treeWillExpand(TreeExpansionEvent event) |
void |
updateNodes()
Updates the array of tree table nodes used by the table to store its
current state.
|
void |
valueChanged(TreeSelectionEvent e) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public static final String PROPERTY_MODEL
setModel(ITreeTableModel)
,
Constant Field Valuespublic static final String PROPERTY_SELECTION_MODEL
setSelectionModel(ITreeTableSelectionModel)
,
Constant Field Valuespublic static final String PROPERTY_ROOT_VISIBLE
setRootVisible(boolean)
,
Constant Field Valuespublic static final String PROPERTY_HORIZONTAL_LINES_VISIBLE
setHorizontalLinesVisible(boolean)
,
Constant Field Valuespublic static final String PROPERTY_VERTICAL_LINES_VISIBLE
setVerticalLinesVisible(boolean)
,
Constant Field Valuespublic static final String PROPERTY_ALT_FOREGROUND_COLOR
setAlternatingForeground(Color)
,
Constant Field Valuespublic static final String PROPERTY_ALT_BACKGROUND_COLOR
setAlternatingBackground(Color)
,
Constant Field Valuespublic static final String PROPERTY_ROW_NUMBERS_VISIBLE
setRowNumbersVisible(boolean)
,
Constant Field Valuespublic static final String PROPERTY_SELECTION_BACKGROUND_COLOR
setSelectionBackground(Color)
,
Constant Field Valuespublic static final String PROPERTY_SELECTION_FOREGROUND_COLOR
setSelectionForeground(Color)
,
Constant Field Valuespublic static final String PROPERTY_VERTICAL_GRID_COLOR
setVerticalGridColor(Color)
,
Constant Field Valuespublic static final String PROPERTY_HORIZONTAL_GRID_COLOR
setHorizontalGridColor(Color)
,
Constant Field Valuespublic static final String PROPERTY_INDENT_ENABLED
setIndentEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_DRAGGING_ENABLED
setDraggingEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_DROPPING_ENABLED
setDroppingEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_RESIZING_ENABLED
setResizingEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_CREATION_ENABLED
setCreationEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_DELETION_ENABLED
setDeletionEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_EDITING_ENABLED
setEditingEnabled(boolean)
,
Constant Field Valuespublic static final String PROPERTY_POLICY_PROVIDER
setPolicyProvider(IPolicyProvider)
,
Constant Field Valuespublic static final String PROPERTY_DEFAULT_ROW_HEIGHT
setDefaultRowHeight(int)
,
Constant Field Valuespublic static Cursor INDENT_CURSOR
INodeEditPolicy
,
ITreeTableNode.isReassignable(Object)
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)
public void removeNotify()
removeNotify
in class JComponent
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 returngetKeyColumn()
,
getColumnIndex(TreeTableColumn)
public int getColumnIndex(TreeTableColumn col)
IColumnModel.getColumnIndex(TreeTableColumn)
.col
- the column for which to return the indexpublic 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 columnDefaultTreeTableCellEditor
,
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 void setDeletionEnabled(boolean enabled)
PROPERTY_DELETION_ENABLED
.enabled
- if TRUE the table will allow the user to delete nodesisDeletionEnabled()
public boolean isDeletionEnabled()
setDeletionEnabled(boolean)
,
INodeEditPolicy.isDeletable(Object, ITreeTableModel)
public void setEditingEnabled(boolean enabled)
PROPERTY_EDITING_ENABLED
.enabled
- if TRUE the table will allow the user to edit node keys and
valuesisEditingEnabled()
public boolean isEditingEnabled()
setEditingEnabled(boolean)
,
INodeEditPolicy.isKeyEditable(Object, ITreeTableModel)
,
INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int)
public boolean isCellEditable(int row, int column)
INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int)
.row
- the table rowcolumn
- the table columnpublic 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 Rectangle getCellRect(int row, int column)
row
- the row of the cellcolumn
- the column of the cellpublic 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 columnpublic int getFocusedRow()
CellFocusManager.getFocusedRow()
.getFocusedColumn()
public int getFocusedColumn()
CellFocusManager.getFocusedColumn()
.getFocusedRow()
public boolean editCellFocused(InputEvent evt)
editCellFocused
in interface IEditable
evt
- the input event, which triggered the editing operationeditCellAt(int, int)
public boolean editCellAt(int row, int column, EventObject 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 madepublic void removeEditor()
getCellEditor()
public Component getEditorComponent()
getEditorComponent
in interface IEditable
public boolean isEditing()
public ITreeTableCellEditor getCellEditor()
TreeTableColumn.getColumnClass()
.setCellEditor(Class, ITreeTableCellEditor)
,
getCellEditor(Class)
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(TreeExpansionListener l)
l
- the tree expansion listeneraddTreeWillExpandListener(TreeWillExpandListener)
public void removeTreeExpansionListener(TreeExpansionListener l)
l
- the listener to removeremoveTreeWillExpandListener(TreeWillExpandListener)
public void addTreeWillExpandListener(TreeWillExpandListener l)
l
- the tree expansion listenerremoveTreeWillExpandListener(TreeWillExpandListener)
,
addTreeExpansionListener(TreeExpansionListener)
public void removeTreeWillExpandListener(TreeWillExpandListener l)
l
- the tree expansion listeneraddTreeWillExpandListener(TreeWillExpandListener)
public void addTreeSelectionListener(TreeSelectionListener l)
TreeSelectionModel.addTreeSelectionListener(javax.swing.event.TreeSelectionListener)
.l
- the tree selection listenerremoveTreeSelectionListener(TreeSelectionListener)
public void removeTreeSelectionListener(TreeSelectionListener l)
l
- the listener to removeaddTreeSelectionListener(TreeSelectionListener)
protected void fireTreeWillExpand(TreePath path) throws ExpandVetoException
ExpandVetoException
, thus terminating the
node expansion.path
- the tree path that will get expandedExpandVetoException
- if one of the tree expansion listeners threw an exception
like thisTreeExpansionEvent
protected void fireTreeWillCollapse(TreePath path) throws ExpandVetoException
ExpandVetoException
, thus terminating the
node collapse.path
- the tree path that will get collapsedExpandVetoException
- if one of the tree expansion listeners threw an exception
like thisTreeExpansionEvent
protected void fireTreeExpanded(TreePath path)
path
- the tree path location of the node that got expandedTreeExpansionEvent
protected void fireTreeCollapsed(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
- if TRUE the user is generally allowed to drag tree nodes of
the tableisDraggingEnabled()
,
INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)
,
Object, ITreeTableModel,
int)
,
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
ITreeTableModel, int, Object, ITreeTableModel, int, int)
public boolean isDraggingEnabled()
setDraggingEnabled(boolean)
public void setDroppingEnabled(boolean enabled)
INodeDragAndDropPolicy
to determine whether or
not an individual tree node can be dropped and where it can be dropped.
The method will trigger a property change event where the property name
will be PROPERTY_DROPPING_ENABLED
.enabled
- if TRUE the user is generally allowed to drop tree nodes onto
the tableisDroppingEnabled()
,
INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)
,
Object, ITreeTableModel,
int)
,
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
ITreeTableModel, int, Object, ITreeTableModel, int, int)
public boolean isDroppingEnabled()
setDroppingEnabled(boolean)
public void setIndentEnabled(boolean enabled)
PROPERTY_INDENT_ENABLED
.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(TreePath path)
path
- the new selectionsetSelectionRow(int)
,
setSelectionPaths(TreePath[])
,
selectAll()
public void setSelectionPaths(TreePath[] paths)
paths
- the new selectionsetSelectionPath(TreePath)
,
setSelectionRows(int[])
,
selectAll()
public void addSelectionPath(TreePath path)
path
- another selected pathsetSelectionPath(TreePath)
,
addSelectionPath(TreePath)
,
clearSelection()
public void removeSelectionPath(TreePath path)
path
- the path to removeremoveSelectionInterval(int, int)
,
clearSelection()
public void addSelectionPaths(TreePath[] paths)
paths
- the paths to add to the selectionsetSelectionPaths(TreePath[])
,
addSelectionInterval(int, int)
,
addSelectionRows(int[])
,
selectAll()
public void removeSelectionPaths(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 TreePath getSelectionPath()
getSelectionPaths()
public 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(TreePath path)
path
- the tree path to check for selectionisRowSelected(int)
public boolean isRowSelected(int row)
row
- the row to checkisPathSelected(TreePath)
public void setSelectionMode(int mode)
mode
- the selection modelgetSelectionMode()
public int getSelectionMode()
setSelectionMode(int)
public int getSelectionCount()
public TreePath[] getPathsBetweenRows(int start, int end)
start
- the start row indexend
- the end row indexpublic boolean isTreePathExpanded(TreePath path)
path
- the path to checkpublic boolean isTreeNodeExpanded(TreePath path)
path
- the tree path leading to the node to check for its expansion
statepublic TreePath getTreePath(int row)
row
- the row for which to return a pathgetTreePaths(int[])
public TreePath getTreePathAt(int y)
y
- the y coordinate for which to return a pathgetRowAt(int)
public TreePath[] getTreePaths(int[] rows)
rows
- the row for which to return pathsgetTreePath(int)
public boolean containsPath(TreePath path)
path
- the path to checkpublic void expandAll()
TreeTableNode.expand()
on each visited node.expandPath(TreePath)
,
expandRow(int)
public void expandPath(TreePath path)
path
- the path of the tree node to expandexpandAll()
,
expandRow(int)
public void expandPathAnimated(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 expandRowAnimated(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(TreePath path)
path
- the path of the tree node to collapsecollapseAll()
,
collapseRow(int)
public void collapsePathAnimated(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 void collapseRowAnimated(int row)
row
- the row to collapsecollapseAll()
,
collapseRow(int)
public List<TreeTableNode> getTreeTableNodes()
public void setGridColor(Color color)
setVerticalGridColor(Color)
and
setHorizontalGridColor(Color)
.color
- the color used for drawing the vertical and horizontal grid
linessetVerticalGridColor(Color)
,
setHorizontalGridColor(Color)
public void setVerticalGridColor(Color color)
PROPERTY_VERTICAL_GRID_COLOR
.color
- the color used for drawing the vertical and horizontal grid
linesgetVerticalGridColor()
public Color getVerticalGridColor()
setVerticalGridColor(Color)
public void setHorizontalGridColor(Color color)
PROPERTY_VERTICAL_GRID_COLOR
.color
- the color used for drawing the vertical and horizontal grid
linesgetHorizontalGridColor()
public Color getHorizontalGridColor()
setVerticalGridColor(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 Color getAlternatingForeground()
setAlternatingForeground(Color)
public void setAlternatingForeground(Color color)
PROPERTY_ALT_FOREGROUND_COLOR
.color
- the alternating foreground color (second foreground color)getAlternatingForeground()
public Color getAlternatingBackground()
setAlternatingBackground(Color)
public void setAlternatingBackground(Color color)
PROPERTY_ALT_BACKGROUND_COLOR
.color
- the alternating background color (second background color)getAlternatingBackground()
public void setSelectionBackground(Color color)
PROPERTY_SELECTION_BACKGROUND_COLOR
.color
- the selection background colorgetSelectionBackground()
,
setSelectionForeground(Color)
public Color getSelectionBackground()
setSelectionBackground(Color)
,
getSelectionForeground()
public Color getSelectionForeground()
setSelectionForeground(Color)
,
getSelectionBackground()
public void setSelectionForeground(Color color)
PROPERTY_SELECTION_FOREGROUND_COLOR
.color
- the selection foreground colorgetSelectionForeground()
,
setSelectionBackground(Color)
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the graphics context used for drawingpaintColumns(Graphics)
,
paintDragAndDrop(Graphics)
protected void paintIndentationLine(Graphics g, int x)
g
- the graphics context into which to drawx
- the location of the lineprotected void paintBackground(Graphics g)
g
- the graphics context into which to drawgetAlternatingBackground()
,
getBackground(int, boolean)
protected void paintColumns(Graphics g)
ColumnModelIterator
to iterate over the columns.g
- the graphics context used for drawingprotected void paintColumn(Graphics g, TreeTableColumn column, int row, int x, 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(Graphics g)
g
- the graphics context used for drawingprotected void paintCell(Graphics g, TreeTableColumn column, TreeTableNode node, int x, int y, int width, int height, int row, int columnIndex, int modelIndex, Class columnClass, boolean fillerColumn)
g
- the graphics context used for drawingcolumn
- the column where the cell is locatednode
- 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 locatedcolumnIndex
- 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 rowpublic 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 selectedpublic Color getForeground(int row)
row
- the row for which to determine the foreground colorgetForeground(int, boolean)
public 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 selectedpublic Color getBackground(int row)
row
- the row for which to determine the background colorgetBackground(int, boolean)
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void scrollTo(int row, boolean showInFirstRow)
row
- the row to make visibleshowInFirstRow
- if TRUE the table will "try" to show the row at the top of the
table, so that as much of its children will be visible (this
can only work if there are still enough rows below the
requested row, which have to fill up the table)scrollFocusToVisible()
,
JComponent.scrollRectToVisible(Rectangle)
public void scrollTo(int row)
row
- the row to make visiblescrollFocusToVisible()
,
JComponent.scrollRectToVisible(Rectangle)
public void scrollTo(TreePath path, boolean showInFirstRow)
path
- the path for which to show the last componentshowInFirstRow
- if TRUE the table will "try" to show the row at the top of the
table, so that as much of its children will be visible (this
can only work if there are still enough rows below the
requested row, which have to fill up the table)scrollFocusToVisible()
,
JComponent.scrollRectToVisible(Rectangle)
,
scrollTo(int)
public void scrollTo(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 checkTreeTableHeader.getColumn(int)
public int getRowAt(int y)
y
- the y-coordinate of the row to returnpublic TreeTableColumn getColumnAt(int x)
TreeTableHeader.getColumnAt(int)
.x
- the x coordinate for which to return the column at that
locationpublic int getVisibleRowCount()
public TreeTableNode getTreeTableNodeAt(int y)
y
- the y-coordinatepublic TreeTableNode[] getTreeTableNodesBetween(int y1, int y2)
y1
- the start y-coordinatey2
- the end y-coordinatepublic 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(TreeModelEvent e)
treeNodesChanged
in interface TreeModelListener
public void treeNodesInserted(TreeModelEvent e)
treeNodesInserted
in interface TreeModelListener
public void treeNodesRemoved(TreeModelEvent e)
treeNodesRemoved
in interface TreeModelListener
public void treeStructureChanged(TreeModelEvent e)
treeStructureChanged
in interface TreeModelListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public String getToolTipText(MouseEvent evt)
IRowPolicy
for the actual text to display.getToolTipText
in class JComponent
evt
- the mouse eventIRowPolicy.getRowToolTip(Object, ITreeTableModel, TreeTableColumn)
public void valueChanged(TreeSelectionEvent e)
valueChanged
in interface TreeSelectionListener
public int[] getRowsForPaths(TreePath[] paths)
getRowsForPaths
in interface RowMapper
public int getRowForPath(TreePath path)
path
- the tree path for which to return the rowpublic Class getColumnClass(int columnIndex)
columnIndex
- the column indexpublic void editingStopped(ChangeEvent e)
editingStopped
in interface CellEditorListener
public void editingCanceled(ChangeEvent e)
editingCanceled
in interface CellEditorListener
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void treeExpanded(TreeExpansionEvent event)
treeExpanded
in interface TreeExpansionListener
public void treeCollapsed(TreeExpansionEvent event)
treeCollapsed
in interface TreeExpansionListener
public void treeWillCollapse(TreeExpansionEvent event)
treeWillCollapse
in interface TreeWillExpandListener
public void treeWillExpand(TreeExpansionEvent event)
treeWillExpand
in interface TreeWillExpandListener
public void deleteSelectedNodes()
public void insertNode(int row)
INodeEditPolicy
to look up the appropriate command, which will
then perform the necessary model changes.row
- INodeEditPolicy.getInsertNodeCommand(Object, int, ITreeTableModel)
public CellFocusManager getCellFocusManager()
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 Image getTexture()
setTexture(Image)
public void setTexture(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 ITreeTableMenuProvider getMenuProvider()
public void setMenuProvider(ITreeTableMenuProvider provider)
provider
- the table's menu providerpublic void setCellRenderer(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(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(Class cl)
TreeTableColumn.getColumnClass()
will be used
to look up a renderer.cl
- the object type for which to return a matching cell renderersetCellRenderer(Class, ITreeTableCellRenderer)
public ITreeTableCellEditor getCellEditor(Class cl)
TreeTableColumn.getColumnClass()
will be used to look up an
edtior.cl
- the object type for which to return a matching cell editorsetCellEditor(Class, ITreeTableCellEditor)
public Map<Class,ITreeTableCellRenderer> getRendererMap()
public void setRendererMap(Map<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(Point cursorLocation)
autoscroll
in interface Autoscroll
public Insets getAutoscrollInsets()
getAutoscrollInsets
in interface Autoscroll
public CellRendererPane getRendererPane()
public TreeTableDragAndDropManager getDragAndDropManager()
protected TreeTableDragAndDropManager createDragAndDropManager()
public Color getDropColorValid()
public void setDropColorValid(Color color)
color
- the 'valid drop' colorpublic Color getDropColorInvalid()
public void setDropColorInvalid(Color color)
color
- the 'invalid drop' colorpublic void outdentNodes(TreePath[] paths)
indentNodes(TreePath[])
. It reassigns
the nodes specified by the paths to the parent of their current parent.
This will make them go "up one level". The word "outdent" does not exist
in the English language but was chosen for symmetry.paths
- the paths specifying the nodes that will be outdentedindentNodes(TreePath[])
,
INodeEditPolicy
,
OutdentNodeAction
,
DefaultReassignNodesCommand
public void indentNodes(TreePath[] paths)
outdentNodes(TreePath[])
. It reassigns
the nodes specified by the paths to the nodes above them (if possible).
This will make them go "down one level".paths
- the paths specifying the nodes that will be indentedoutdentNodes(TreePath[])
,
INodeEditPolicy
,
IndentNodeAction
,
DefaultReassignNodesCommand
public TreeTableNode getAnimationNode()
public double getAnimationPercentage()
public NodeAnimationController getNodeAnimationController()
public void setNodeAnimationController(NodeAnimationController settings)
settings
- the animation settingspublic INodeFilter getNodeFilter()
public void setNodeFilter(INodeFilter filter)
filter
- the node filter to use for filtering the rows shown in the
tableCopyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.