|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.table.group.AbstractTreeTableColumnModelAdapter
com.citra.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.citra.table.group.AbstractTreeTableColumnModelAdapter |
---|
changeEvent, changeSupport, columnMargin, columnSelectionAllowed, listenerList, selectionModel, totalColumnWidth |
Fields inherited from interface com.citra.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. |
void |
columnsInvalidated()
Method that is called when the columns of a TreeTableColumnModel have changed in some
way via additions or removals. |
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)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireColumnRemoved(TableColumnModelEvent e)
Notify all listeners that have registered interest for notification on this event type. |
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.
addColumn
in interface TableColumnModel
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 addedprotected void columnRemoved(TableColumn tc, int index)
tc
- the table column that was removedindex
- the index at which the column was removedpublic void columnsInvalidated()
TreeTableColumnModel
have changed in some
way via additions or removals.
columnsInvalidated
in interface ColumnInvalidatorListener
protected JTree createDefaultTree()
protected TreeTableColumnModel createDefaultTreeColumnModel()
By default, this method returns a DefaultTreeTableColumnModel
.
public void expandAll()
protected void fireColumnAdded(TableColumnModelEvent e)
fireColumnAdded
in class AbstractTreeTableColumnModelAdapter
e
- the event that is propagated to listenersprotected void fireColumnRemoved(TableColumnModelEvent e)
fireColumnRemoved
in class AbstractTreeTableColumnModelAdapter
e
- the event that is propagated to listenerspublic TableColumn getColumn(int columnIndex)
TableColumn
object for the column at
columnIndex
.
getColumn
in interface TableColumnModel
columnIndex
- the index of the desired column
TableColumn
object for
the column at columnIndex
public int getColumnCount()
getColumnCount
in interface TableColumnModel
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.
getColumns
in interface TableColumnModel
Enumeration
of all the columns in the modelprotected int getPreviousColumnCount()
public JTree getTree()
getTree
in interface TreeTableColumnModelAdapter
public TreeTableColumnModel getTreeTableColumnModel()
getTreeTableColumnModel
in interface TreeTableColumnModelAdapter
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.
moveColumn
in interface TableColumnModel
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
rowIndex
protected 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.
removeColumn
in interface TableColumnModel
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 © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |