|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sciapp.table.group.AbstractTreeTableColumnModelAdapter
com.sciapp.table.group.DefaultTreeTableColumnModelAdapter
public class DefaultTreeTableColumnModelAdapter
DefaultTreeTableColumnModelAdapter is the default implementation of a TreeTableColumnModelAdapter.
| Field Summary | |
|---|---|
protected int |
cc
a local cache of the model's column count |
protected JTree |
tree
the tree |
protected TreeTableColumnModel |
treeColumnModel
the treetable column model |
| Fields inherited from class com.sciapp.table.group.AbstractTreeTableColumnModelAdapter |
|---|
changeEvent, changeSupport, columnMargin, columnSelectionAllowed, listenerList, selectionModel, totalColumnWidth |
| Fields inherited from interface com.sciapp.table.group.TreeTableColumnModelAdapter |
|---|
TREE_PROPERTY, TREE_TABLE_COLUMN_MODEL_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultTreeTableColumnModelAdapter()
Constructs a DefaultTreeTableColumnModelAdapter. |
|
DefaultTreeTableColumnModelAdapter(TreeTableColumnModel treeTableModel)
Constructs a DefaultTreeTableColumnModelAdapter. |
|
DefaultTreeTableColumnModelAdapter(TreeTableColumnModel treeTableModel,
JTree tree)
Constructs a DefaultTreeTableColumnModelAdapter. |
|
| Method Summary | |
|---|---|
void |
addColumn(TableColumn aColumn)
Appends aColumn to the end of the
tableColumns array. |
void |
collapseAll()
Convenience method to collapse all columns. |
protected void |
columnAdded(TableColumn tc,
int index)
Invoke this method after columns were added. |
protected void |
columnRemoved(TableColumn tc,
int index)
Invoke this method after columns were removed. |
protected JTree |
createDefaultTree()
Returns a new instance of the JTree that will be associated with this TreeTableColumnModelAdapter. |
protected TreeTableColumnModel |
createDefaultTreeColumnModel()
Creates and returns a new instance of the hierarchical column model that will be used. |
void |
expandAll()
Convenience method to expand all columns. |
protected void |
fireColumnAdded(TableColumnModelEvent e)
|
protected void |
fireColumnRemoved(TableColumnModelEvent e)
|
TableColumn |
getColumn(int columnIndex)
Returns the TableColumn object for the column at
columnIndex. |
int |
getColumnCount()
Returns the number of columns in the model. |
int |
getColumnCountFromTree()
Returns the uncached models' column count. |
TableColumn |
getColumnFromModel(int columnIndex)
Returns the column at columnIndex by delegating to the model. |
Enumeration |
getColumns()
Returns an Enumeration of all the columns in the model. |
protected int |
getPreviousColumnCount()
Called from subclasses during events to find what was the column count before the event. |
JTree |
getTree()
Returns the associated tree. |
TreeTableColumnModel |
getTreeTableColumnModel()
Returns the associated treetable column model. |
protected void |
invalidateColumns()
Invalidates the cached column store and count. |
void |
moveColumn(int columnIndex,
int newIndex)
Moves the column and its header at columnIndex to
newIndex. |
protected void |
nodeCollapsed(TreePath path)
Notification that the specified path was collapsed. |
protected void |
nodeExpanded(TreePath path)
Notification that the specified path was expanded. |
Object |
nodeForRow(int rowIndex)
Returns the node found at row rowIndex of the tree. |
protected void |
nodesChanged(TreeModelEvent e)
Notification that children nodes at the specified path have changed. |
protected void |
nodesInserted(TreeModelEvent e)
Notification that children nodes at the specified path have been added. |
protected void |
nodesRemoved(TreeModelEvent e)
Notification that children nodes at the specified path have been removed. |
void |
removeColumn(TableColumn column)
Deletes the TableColumn column from the
tableColumns array. |
void |
setTree(JTree newTree)
Sets a new tree. |
void |
setTreeTableColumnModel(TreeTableColumnModel newModel)
Sets a new treetable column model. |
protected void |
structureChanged(TreeModelEvent e)
Notification that the structure of the nodes at the specified path has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int cc
protected JTree tree
protected TreeTableColumnModel treeColumnModel
| Constructor Detail |
|---|
public DefaultTreeTableColumnModelAdapter()
public DefaultTreeTableColumnModelAdapter(TreeTableColumnModel treeTableModel)
public DefaultTreeTableColumnModelAdapter(TreeTableColumnModel treeTableModel,
JTree tree)
| Method Detail |
|---|
public void addColumn(TableColumn aColumn)
aColumn to the end of the
tableColumns array.
This method posts a columnAdded
event to its listeners.
aColumn - the TableColumn to be addedTableColumnModel.removeColumn(javax.swing.table.TableColumn)public void collapseAll()
protected void columnAdded(TableColumn tc,
int index)
tc - the table column that was addedindex - the index at which the column was added
protected void columnRemoved(TableColumn tc,
int index)
tc - the table column that was removedindex - the index at which the column was removedprotected JTree createDefaultTree()
protected TreeTableColumnModel createDefaultTreeColumnModel()
By default, this method returns a DefaultTreeTableColumnModel.
public void expandAll()
protected void fireColumnAdded(TableColumnModelEvent e)
fireColumnAdded in class AbstractTreeTableColumnModelAdapterprotected void fireColumnRemoved(TableColumnModelEvent e)
fireColumnRemoved in class AbstractTreeTableColumnModelAdapterpublic TableColumn getColumn(int columnIndex)
TableColumn object for the column at
columnIndex.
columnIndex - the index of the desired column
TableColumn object for
the column at columnIndexpublic int getColumnCount()
public int getColumnCountFromTree()
public TableColumn getColumnFromModel(int columnIndex)
columnIndex - the index of the column
public Enumeration getColumns()
Enumeration of all the columns in the model.
Enumeration of all the columns in the modelprotected int getPreviousColumnCount()
public JTree getTree()
public TreeTableColumnModel getTreeTableColumnModel()
protected void invalidateColumns()
public void moveColumn(int columnIndex,
int newIndex)
columnIndex to
newIndex. The old column at columnIndex
will now be found at newIndex. The column that used
to be at newIndex is shifted left or right
to make room. This will not move any columns if
columnIndex equals newIndex. This method
posts a columnMoved event to its listeners.
columnIndex - the index of column to be movednewIndex - index of the column's new locationprotected void nodeCollapsed(TreePath path)
path - the path that was collapsedprotected void nodeExpanded(TreePath path)
path - the path that was expandedpublic Object nodeForRow(int rowIndex)
rowIndex of the tree.
rowIndex - the row number of the tree
rowIndexprotected void nodesChanged(TreeModelEvent e)
e - the event identifying the changeprotected void nodesInserted(TreeModelEvent e)
e - the event identifying the insertionprotected void nodesRemoved(TreeModelEvent e)
e - the event identifying the removalpublic void removeColumn(TableColumn column)
TableColumn column from the
tableColumns array. This method will do nothing if
column is not in the table's column list.
This method posts a columnRemoved
event to its listeners.
column - the TableColumn to be removedTableColumnModel.addColumn(javax.swing.table.TableColumn)public void setTree(JTree newTree)
newTree - the new tree to assign.public void setTreeTableColumnModel(TreeTableColumnModel newModel)
newModel - the new treetable column model to assign.protected void structureChanged(TreeModelEvent e)
e - the event identifying the structure change
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||