|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--ix.iface.ui.table.AbstractIXTableModel | +--ix.iface.ui.table.AbstractTreeTableModel
An abstract class for tree table models. Requires data objects to be TreeTable objects. Creates IXTreeTableNode objects to wrap around the data objects. These IXTreeTableNode objects hold id information (base-object and parent line) and expansion information (indentation of the node and whether it is expanded or not). By default, the children of nodes are not displayed When clicking on the node, the following happens:
As an example, see ix.iview.table.ActionTreeTableModel
Field Summary | |
static char |
CLOSEDC
the character used to indicate an un-expanded node |
static javax.swing.ImageIcon |
CLOSEDI
|
static java.lang.String |
imageDir
|
static int |
INDENT_STEP
the indentation steps used to indent children |
static char |
LEAFC
the character used to indicate a leaf (no children) |
static javax.swing.ImageIcon |
LEAFI
|
java.util.HashMap |
nodeMap
A map for looking up a TreeNode for a Object. |
protected java.util.ArrayList |
nodes
a collection of IXTreeTableNodes that have been generated |
static char |
OPENC
the character used to indicate an expanded node |
static javax.swing.ImageIcon |
OPENI
|
Fields inherited from class ix.iface.ui.table.AbstractIXTableModel |
columnClasses, columnFields, columnNames, objectClass, rows |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
AbstractTreeTableModel()
Makes an empty model. |
|
AbstractTreeTableModel(javax.swing.tree.TreeNode[] theNodes)
Makes a model that contains the given nodes at top level. |
Method Summary | |
void |
addData(java.lang.Object data)
Adds the given TreeNode object to the table's rows and notifies listeners. |
void |
addTreeNode(java.lang.Object object,
javax.swing.tree.TreeNode tNode)
Associate the given TreeNode to the given AgendaItem |
void |
cellClicked(java.awt.event.MouseEvent me,
int rowIndex,
int columnIndex)
If the left button was clicked on the tree-column, expand/collapse node. |
void |
clearData()
Removes all data objects from the table's rows and notifies listeners. |
void |
clearTable()
|
java.lang.String |
defaultGetNameString(javax.swing.tree.TreeNode node)
Looks up the value in the first columnField. |
protected void |
deriveColumnFields()
Collects usable fields from the objectClass |
void |
expandNode(IXTreeTableNode eNode,
int rowIndex)
Gathers the node's children and splices them into the table. |
void |
fireObjectChanged(java.lang.Object o)
The given object changed - find its tree node, fire that and redo children |
abstract java.lang.Object |
getCellValueAt(java.lang.Object node,
int columnIndex)
Gets the object's value for the given column index. |
abstract java.lang.String |
getNameString(javax.swing.tree.TreeNode node)
Gets the string to use for the tree-column (the name of the node). |
int |
getObjectRow(java.lang.Object object)
Gets the row index of the given object |
java.lang.Object |
getRowNode(int rowIndex)
|
java.lang.Object |
getRowObject(int rowIndex)
Gets the object that is in the given row. |
javax.swing.tree.TreeNode |
getTreeNode(java.lang.Object object)
Get the (possibly new) TreeNode that is associlated with the given Object. |
javax.swing.tree.TreeNode |
getTreeNode(java.lang.Object object,
java.util.List parents,
int indentation)
|
java.lang.Object |
getTreeNodeType(IXTreeTableNode eNode)
Gets a character or icon to use as a reflection of the node's tree-status. |
protected java.lang.Object |
getTreeValueAt(IXTreeTableNode eNode)
Gets the value that indicates the tree-position (indented name). |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Get the value for a cell in the table defined by the parameters. |
abstract IXTreeTableNode |
makeIXTreeTableNode(java.lang.Object node)
|
IXTreeTableNode |
makeIXTreeTableNode(java.lang.Object node,
java.util.List parents,
int indentation)
indentation is number of blanks to put in front of node (n*INDENT_STEP) |
void |
removeData(java.lang.Object data)
Removes the given TreeNode object from the table's rows and notifies listeners. |
void |
removeNodes(int number,
int place)
Removes the given number of nodes from the given index place in the table. |
void |
setColumnFields(java.lang.Class objectClass,
java.lang.String[] fieldNames)
Sets the fields to be used as columns in the table |
void |
setColumnNames(java.lang.String[] fieldNames)
Sets the column titles to be used in the table |
void |
setData(java.util.Collection theNodes)
Sets the table's rows to the given TreeNode objects and notifies listeners. |
void |
setData(java.lang.Object[] theNodes)
Sets the table's rows to the given TreeNode objects and notifies listeners. |
void |
unexpandNode(IXTreeTableNode eNode,
int index)
Removes the node's children from the table and notes it as unexpanded. |
Methods inherited from class ix.iface.ui.table.AbstractIXTableModel |
defaultGetCellValueAt, defaultSetColumnFields, getColumnClass, getColumnCount, getColumnName, getColumnNames, getRowCount, setColumnClasses |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int INDENT_STEP
public static final char LEAFC
public static final char OPENC
public static final char CLOSEDC
public static final java.lang.String imageDir
public static final javax.swing.ImageIcon LEAFI
public static final javax.swing.ImageIcon OPENI
public static final javax.swing.ImageIcon CLOSEDI
protected java.util.ArrayList nodes
public java.util.HashMap nodeMap
Constructor Detail |
public AbstractTreeTableModel()
public AbstractTreeTableModel(javax.swing.tree.TreeNode[] theNodes)
Method Detail |
public void setData(java.util.Collection theNodes)
public void setData(java.lang.Object[] theNodes)
setData
in class AbstractIXTableModel
public void clearData()
AbstractIXTableModel
clearData
in class AbstractIXTableModel
public void clearTable()
public void addData(java.lang.Object data)
addData
in class AbstractIXTableModel
public void removeData(java.lang.Object data)
removeData
in class AbstractIXTableModel
public void removeNodes(int number, int place)
public void setColumnNames(java.lang.String[] fieldNames)
setColumnNames
in class AbstractIXTableModel
public void setColumnFields(java.lang.Class objectClass, java.lang.String[] fieldNames)
setColumnFields
in class AbstractIXTableModel
public java.lang.Object getRowObject(int rowIndex)
AbstractIXTableModel
getRowObject
in class AbstractIXTableModel
ix.iface.ui.table.AbstractIXTableModel
public java.lang.Object getRowNode(int rowIndex)
public int getObjectRow(java.lang.Object object)
AbstractIXTableModel
getObjectRow
in class AbstractIXTableModel
ix.iface.ui.table.AbstractIXTableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in class AbstractIXTableModel
protected java.lang.Object getTreeValueAt(IXTreeTableNode eNode)
public void expandNode(IXTreeTableNode eNode, int rowIndex)
public void unexpandNode(IXTreeTableNode eNode, int index)
public java.lang.Object getTreeNodeType(IXTreeTableNode eNode)
public void cellClicked(java.awt.event.MouseEvent me, int rowIndex, int columnIndex)
cellClicked
in interface TableMouseListener
ix.iface.ui.table.TableMouseListener
me
- the original MouseEvent.rowIndex
- the index of the row that has been clickedcolumnIndex
- the index of the column that has been clickedpublic abstract java.lang.Object getCellValueAt(java.lang.Object node, int columnIndex)
getCellValueAt
in class AbstractIXTableModel
public abstract java.lang.String getNameString(javax.swing.tree.TreeNode node)
public void fireObjectChanged(java.lang.Object o)
public java.lang.String defaultGetNameString(javax.swing.tree.TreeNode node)
protected void deriveColumnFields()
deriveColumnFields
in class AbstractIXTableModel
public javax.swing.tree.TreeNode getTreeNode(java.lang.Object object)
public javax.swing.tree.TreeNode getTreeNode(java.lang.Object object, java.util.List parents, int indentation)
public void addTreeNode(java.lang.Object object, javax.swing.tree.TreeNode tNode)
public abstract IXTreeTableNode makeIXTreeTableNode(java.lang.Object node)
public IXTreeTableNode makeIXTreeTableNode(java.lang.Object node, java.util.List parents, int indentation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |