|
|||||||||
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.JTable PIRL.TreeTable.JTreeTable
public class JTreeTable
This example shows how to create a simple JTreeTable component, by using a JTree as a renderer (and editor) for the cells in a particular column in the JTable.
Nested Class Summary | |
---|---|
class |
JTreeTable.TreeTableCellEditor
TreeTableCellEditor implementation. |
class |
JTreeTable.TreeTableCellRenderer
A TreeCellRenderer that displays a JTree. |
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JTreeTable.TreeTableCellRenderer |
The_Tree
A subclass of JTree. |
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(TreeTableModel treeTableModel)
|
Method Summary | |
---|---|
boolean |
editCellAt(int row,
int column,
EventObject event)
Overridden to invoke repaint for the particular location if the column contains the tree. |
int |
getEditingRow()
Workaround for BasicTableUI anomaly. |
JTree |
getTree()
Get the tree that is being shared between the model. |
Object |
getTreeNode(int row)
Gets the Object at a row of the Tree. |
void |
setRowHeight(int rowHeight)
Overridden to pass the new rowHeight to the tree. |
void |
sizeColumnsToFit(int resizingColumn)
This is overridden to invoke super's implementation, and then, if the receiver is editing a Tree column, the editor's bounds is reset. |
void |
updateUI()
Overridden to message super and forward the method to the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JTreeTable.TreeTableCellRenderer The_Tree
Constructor Detail |
---|
public JTreeTable(TreeTableModel treeTableModel)
Method Detail |
---|
public Object getTreeNode(int row)
public void updateUI()
updateUI
in class JTable
public int getEditingRow()
getEditingRow
in class JTable
public void sizeColumnsToFit(int resizingColumn)
getEditingRow
returns
-1, and therefore doesn't automatically resize the editor for us.
sizeColumnsToFit
in class JTable
public void setRowHeight(int rowHeight)
setRowHeight
in class JTable
public boolean editCellAt(int row, int column, EventObject event)
editCellAt
in class JTable
public JTree getTree()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |