|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
org.openbp.swing.components.treetable.JTreeTable
public class JTreeTable
This JTreeTable is based on the same concept (placing a JTree into a column of a JTable)
as the JTreeTable provided by Sun Microsystems, with the exception that the individual JTree
nodes will adapt to the height of JTables row in which they have been placed. This
functionality is brought about by providing a new type of TreeNode, the TreeTableNode,
that contains methods that will deliver the maximum preferred height of the row to the tree
and the table. Further, to enable provision of such information, it is expected that all cell
objects for a row are kept inside the individual node.
As on the standard Java API, the JTreeTable requires a model for data provision, the
TreeTableModel This interface actually brings the TreeModel and TableModel interfaces
together in one, with a few extra added methods. In order not to have to implement the entire
model, a partially implemented model, the SimpleTreeTableModel with most generic methods
provided. If the user wishes not to implement the model at all, then the
DefaultTreeTableModel is provided the can be used with the DefaultTreeTableNode
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode |
| 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected javax.swing.ActionMap |
actionMap
Action map of the tree table |
static int |
CMD_BACKTAB
Command: Backtab |
static int |
CMD_BOTTOM
Command: To the bottom |
static int |
CMD_CODE_MASK
Command modifier mask: Code mask |
static int |
CMD_DOWN
Command: Cursor down |
static int |
CMD_END
Command: End |
static int |
CMD_ENTER
Command: Enter |
static int |
CMD_ESC
Command: Escape |
static int |
CMD_EXTEND_SELECTION
Command modifier: Extend selection |
static int |
CMD_HOME
Command: Home |
static int |
CMD_LEFT
Command: Cursor left |
static int |
CMD_MOUSE
Command: Mouse key |
static int |
CMD_NONE
Command: No key |
static int |
CMD_PGDN
Command: Page down |
static int |
CMD_PGUP
Command: Page up |
static int |
CMD_RIGHT
Command: Cursor right |
static int |
CMD_SELECTION_MASK
Command modifier mask: Selection mask |
static int |
CMD_SET_SELECTION
Command modifier: Set selection |
static int |
CMD_SPACE
Command: Space |
static int |
CMD_SWITCH_TREE
Command modifier: Switch from tree to table and vice versa |
static int |
CMD_TAB
Command: Tab |
static int |
CMD_TOGGLE_SELECTION
Command modifier: Toggle selection |
static int |
CMD_TOP
Command: To the top |
static int |
CMD_UP
Command: Cursor up |
protected int |
currentCol
Current colum |
protected int |
currentRow
Current row |
protected javax.swing.InputMap |
focusAncestorInputMap
Input map for ancestor-focused keys of the tree table |
protected javax.swing.InputMap |
focusInputMap
Input map for focused keys of the tree table |
protected ListenerSupport |
listenerSupport
Listener support object holding the listeners |
static int |
SELECTION_MULTI
Selection mode: Multiple selection |
static int |
SELECTION_NONE
Selection mode: No selection |
static int |
SELECTION_SINGLE
Selection mode: Single selection |
| Fields inherited from class javax.swing.JTable |
|---|
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader |
| 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 | |
|---|---|
JTreeTable()
Default Constructor. |
|
JTreeTable(TreeTableModel treeTableModel)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addTreeTableListener(TreeTableListener listener)
Adds a tree table listener to the listener list. |
void |
addWeakTreeTableListener(TreeTableListener listener)
Adds a tree table listener to the listener list as weak listener. |
void |
changeSelection(int newRow,
int newCol,
boolean toggle,
boolean extend)
JTable override. |
void |
collapsePath(javax.swing.tree.TreePath path)
Ensures that the node identified by the specified path is collapsed and viewable. |
void |
collapseRow(int row)
Ensures that the node in the specified row is collapsed. |
void |
configureSubComponent(javax.swing.JComponent comp)
Configures a component that shall be used in a tree table cell for usage in the tree. |
static java.lang.Object |
createDescriptionCellValue(java.lang.String text)
Creates a text value for display in a text-only cell (e\. g\. a description cell). |
void |
doLayout()
Handle the layout of the rows and columns. |
boolean |
editCellAt(int row,
int col)
JTable override. |
boolean |
editCellAt(int row,
int col,
java.util.EventObject e)
Overriden method. |
void |
expandAll(boolean expand)
Expands all tree nodes or collapse these. |
void |
expandAll(javax.swing.tree.TreePath parent,
boolean expand)
Expands all tree nodes or collapse these. |
void |
expandPath(javax.swing.tree.TreePath path)
Ensures that the node identified by the specified path is expanded and viewable. |
void |
expandRow(int row)
Ensures that the node in the specified row is expanded and viewable. |
void |
expandTreeLevels(boolean expand,
int numberOfLevelThatAreNeededToBeExpanded)
Expands all tree nodes or collapse these level by level. |
void |
expandTreeLevels(javax.swing.tree.TreePath parent,
boolean expand,
int numberOfLevelThatAreNeededToBeExpanded)
Expands all tree nodes or collapse these level by level. |
protected boolean |
fireCommand(int command)
Fires a 'command' event to all registered tree table listeners. |
int |
getDefaultRowHeight()
Gets the default row height. |
int |
getEditingRow()
Workaround for BasicTableUI anomaly. |
int |
getFirstVisibleRow()
Gets the first row that is fully visible in the scroll pane. |
int |
getLastVisibleRow()
Gets the last row that is fully visible in the scroll pane. |
TreeTableNode |
getNodeByPath(javax.swing.tree.TreePath path)
Gets the tree table node by a given tree path. |
TreeTableNode |
getNodeByPoint(java.awt.Point point)
Gets the tree table node located at the specified position relative to the table. |
TreeTableNode |
getNodeByRow(int row)
Gets the tree node by a given row. |
javax.swing.tree.TreePath |
getPathByNode(javax.swing.tree.TreeNode treeNode)
Gets the TreePath for a specified TreeTableNode in the visible tree table. |
javax.swing.tree.TreePath |
getPathByPoint(java.awt.Point point)
Gets the tree path located at the specified position relative to the table. |
javax.swing.tree.TreePath |
getPathByRow(int row)
Gets the tree path by a given row. |
int |
getRowByPath(javax.swing.tree.TreePath path)
Determines the row by the tree path. |
protected javax.swing.JScrollPane |
getScrollPane()
Gets the scroll pane that is associated with the table. |
javax.swing.tree.TreePath[] |
getSelection()
Gets the selection. |
int |
getSelectionMode()
Gets the selection mode. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent me)
Override of the super method that takes special considerations for tree cell renderers. |
javax.swing.JTree |
getTree()
Returns the tree used by the TreeTable. |
int |
getTreeCol()
Gets the we assume the tree column to be column 0. |
TreeTableModel |
getTreeTableModel()
Returns the TreeTableModel that provides the data displayed by this
JTreeTable |
java.lang.Object |
getValueAt(int row,
int column)
Override to prevent NPE in default cut/copy/paste transfer handler when copying table data. |
int |
getVisibleRowCount()
Gets the number of visible rows in the scroll pane. |
void |
handleKeyEvent(java.awt.event.KeyEvent e)
Processses a key event. |
boolean |
isCellSelectable(int row,
int col)
Checks of a cell is selectable. |
void |
mouseClicked(java.awt.event.MouseEvent me)
Delegates any mouse event that occurred on the tree column and was not Button 1 to the tree with new pointer coordinates relative to the tree. |
void |
mouseEntered(java.awt.event.MouseEvent me)
Invoked when the mouse pointer enteres a region. |
void |
mouseExited(java.awt.event.MouseEvent me)
Invoked when the mouse pointer exits a region. |
void |
mousePressed(java.awt.event.MouseEvent me)
Invoked when the mouse button is pressed. |
void |
mouseReleased(java.awt.event.MouseEvent me)
Invoked when the mouse button is released. |
protected void |
processCommand(int command)
Handles a command. |
void |
removeTreeTableListener(TreeTableListener listener)
Removes a tree table listener from the listener list. |
protected void |
repaintCell(int row,
int col)
Repaints the given cell. |
void |
restoreCurrentPosition()
Restores the current position (i\.e\. the currently selected cell). |
void |
saveCurrentPosition()
Saves the current position (i\.e\. the currently selected cell). |
void |
selectCell(int newRow,
int newCol)
Selects the specified cell. |
boolean |
selectDefaultCell()
Selects the default cell. |
boolean |
selectDefaultCell(boolean treeCell)
Selects the first cell that is selectable. |
boolean |
selectNode(javax.swing.tree.TreeNode node)
Sets the selection to a specified node. |
void |
setColumnSizeConstraint(ColumnSizeConstraint csc)
Set the constraint for the column size. |
void |
setDefaultRowHeight(int defaultRowHeight)
Sets the default row height. |
void |
setModel(TreeTableModel model)
Sets the tree table model. |
void |
setRootVisible(boolean visible)
Sets the root visible in the tree. |
void |
setSelectionMode(int selectionMode)
Sets the selection mode. |
void |
sizeColumnsToFit()
Resizes all cells in the table to adjust to the width of the the components contained in the individual cells. |
void |
sizeColumnsToFit(int resizingColumn)
Resizes all cells in the table to adjust to the width of the the components contained in the individual cells. |
void |
sizeRowsToFit()
Resizes all rows in the table to adjust to the height of the the components contained in the individual cells. |
void |
togglePath(javax.swing.tree.TreePath path)
Ensures that the node in the specified path is either collapsed or expanded depending on the state or the node. |
void |
toggleRow(int row)
Ensures that the node in the specified row is either collapsed or expanded depending on the state or the node. |
void |
updateUI()
This was overridden to message super and forward the method to the tree. |
| Methods inherited from class javax.swing.JTable |
|---|
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, valueChanged |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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 |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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 int SELECTION_NONE
public static final int SELECTION_SINGLE
public static final int SELECTION_MULTI
public static final int CMD_NONE
public static final int CMD_MOUSE
public static final int CMD_TAB
public static final int CMD_BACKTAB
public static final int CMD_ENTER
public static final int CMD_SPACE
public static final int CMD_LEFT
public static final int CMD_RIGHT
public static final int CMD_UP
public static final int CMD_DOWN
public static final int CMD_PGUP
public static final int CMD_PGDN
public static final int CMD_TOP
public static final int CMD_BOTTOM
public static final int CMD_HOME
public static final int CMD_END
public static final int CMD_ESC
public static final int CMD_SET_SELECTION
public static final int CMD_EXTEND_SELECTION
public static final int CMD_TOGGLE_SELECTION
public static final int CMD_SWITCH_TREE
public static final int CMD_CODE_MASK
public static final int CMD_SELECTION_MASK
protected javax.swing.InputMap focusInputMap
protected javax.swing.InputMap focusAncestorInputMap
protected javax.swing.ActionMap actionMap
protected ListenerSupport listenerSupport
protected int currentCol
protected int currentRow
| Constructor Detail |
|---|
public JTreeTable()
DefaultTreeTableNode for a root node,
and adds this to a DefaultTreeTableModel which it registers with this JTreeTable.
public JTreeTable(TreeTableModel treeTableModel)
treeTableModel - The TreeTableModel to be used with this JTreeTable| Method Detail |
|---|
public java.lang.Object getValueAt(int row,
int column)
getValueAt in class javax.swing.JTableJTable.getValueAt(int, int)public void updateUI()
updateUI in class javax.swing.JTable
public boolean editCellAt(int row,
int col)
editCellAt in class javax.swing.JTablerow - Row of the cellcol - Column of the cell
public boolean editCellAt(int row,
int col,
java.util.EventObject e)
editCellAt in class javax.swing.JTablerow - Row of the cellcol - Column of the celle - Event object of the event that caused the call
public void changeSelection(int newRow,
int newCol,
boolean toggle,
boolean extend)
changeSelection in class javax.swing.JTablenewRow - Index of the row to selectnewCol - Index of the column to selecttoggle - See description aboveextend - If true, extend the current selection
protected void repaintCell(int row,
int col)
row - Row of the cellcol - Column of the cellpublic int getEditingRow()
getEditingRow in class javax.swing.JTablepublic void setModel(TreeTableModel model)
model - The model to be set for the tree tablepublic java.lang.String getToolTipText(java.awt.event.MouseEvent me)
getToolTipText in class javax.swing.JTablepublic javax.swing.JTree getTree()
public TreeTableModel getTreeTableModel()
TreeTableModel that provides the data displayed by this
JTreeTable
TreeTableModel that provides the data displayed by this JTreeTableprotected javax.swing.JScrollPane getScrollPane()
public void setRootVisible(boolean visible)
visible - true To show the rootpublic int getTreeCol()
public int getDefaultRowHeight()
public void setDefaultRowHeight(int defaultRowHeight)
public void sizeRowsToFit()
public void sizeColumnsToFit()
public void sizeColumnsToFit(int resizingColumn)
sizeColumnsToFit in class javax.swing.JTableresizingColumn - Column index of the column that has been resized if the request
originates from a column header being dragged. If this value is != -1, the request
will be delegated to the super method.public void setColumnSizeConstraint(ColumnSizeConstraint csc)
csc - The constraint classpublic void doLayout()
doLayout in class javax.swing.JTablepublic javax.swing.tree.TreePath getPathByRow(int row)
row - Row index
public javax.swing.tree.TreePath getPathByNode(javax.swing.tree.TreeNode treeNode)
TreeTableNode in the visible tree table.
treeNode - The TreeTableNode for which the TreePath is desired
public javax.swing.tree.TreePath getPathByPoint(java.awt.Point point)
point - Location in table component coordinates
public TreeTableNode getNodeByRow(int row)
row - Row index
public TreeTableNode getNodeByPath(javax.swing.tree.TreePath path)
path - Tree path or null
public TreeTableNode getNodeByPoint(java.awt.Point point)
point - Location in table component coordinates
public int getRowByPath(javax.swing.tree.TreePath path)
path - Tree path
public int getFirstVisibleRow()
public int getLastVisibleRow()
public int getVisibleRowCount()
public void configureSubComponent(javax.swing.JComponent comp)
comp - Comp
public boolean isCellSelectable(int row,
int col)
row - Row whose value is to be queriedcol - Column whose value is to be queried
public void selectCell(int newRow,
int newCol)
newRow - Index of the row to selectnewCol - Index of the column to selectpublic boolean selectDefaultCell()
public boolean selectDefaultCell(boolean treeCell)
treeCell - true The cell to select must be a tree cell.
false The cell to select must be a content cell.
public boolean selectNode(javax.swing.tree.TreeNode node)
node - The node to set the selection to
public javax.swing.tree.TreePath[] getSelection()
public int getSelectionMode()
SELECTION_NONE/SELECTION_SINGLE/SELECTION_MULTIpublic void setSelectionMode(int selectionMode)
setSelectionMode in class javax.swing.JTableselectionMode - SELECTION_NONE/SELECTION_SINGLE/SELECTION_MULTIpublic void saveCurrentPosition()
public void restoreCurrentPosition()
public void expandTreeLevels(boolean expand,
int numberOfLevelThatAreNeededToBeExpanded)
expand - true expands all nodes in the treenumberOfLevelThatAreNeededToBeExpanded - The number of level that
are needed to be expand. The value '-1' expands all levels.public void expandAll(boolean expand)
expand - true expands all nodes in the tree
public void expandAll(javax.swing.tree.TreePath parent,
boolean expand)
parent - The parent tree pathexpand - true expands all nodes in the tree
public void expandTreeLevels(javax.swing.tree.TreePath parent,
boolean expand,
int numberOfLevelThatAreNeededToBeExpanded)
parent - The parent tree pathexpand - true expands all nodes in the treenumberOfLevelThatAreNeededToBeExpanded - The number of level that
are needed to be expand. The value '-1' expands all levels.public void toggleRow(int row)
row - An integer specifying a display row, where 0 is the first row in the displaypublic void togglePath(javax.swing.tree.TreePath path)
path - the TreePath identifying a nodepublic void collapseRow(int row)
If row is < 0 or >= getRowCount this will have no effect.
row - An integer specifying a display row, where 0 is the first row in the displaypublic void expandRow(int row)
row - An integer specifying a display row, where 0 is the first row in the displaypublic void collapsePath(javax.swing.tree.TreePath path)
path - the TreePath identifying a nodepublic void expandPath(javax.swing.tree.TreePath path)
path - the TreePath identifying a nodepublic void handleKeyEvent(java.awt.event.KeyEvent e)
e - Event to processprotected void processCommand(int command)
command - Command to processprotected boolean fireCommand(int command)
command - Command to execute
public void addTreeTableListener(TreeTableListener listener)
listener - The listener to be addedpublic void addWeakTreeTableListener(TreeTableListener listener)
listener - The listener to be addedpublic void removeTreeTableListener(TreeTableListener listener)
listener - The listener to be removedpublic void mouseClicked(java.awt.event.MouseEvent me)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent me)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent me)
mouseExited in interface java.awt.event.MouseListenerpublic static java.lang.Object createDescriptionCellValue(java.lang.String text)
DefaultTableCellRenderer which will create
a formatted tool tip from the full text.
text - Text to display
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||