|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel org.bibalex.daf.handlers.dbhandler.DataTable org.bibalex.daf.commongui.datamodels.TreeDataModel
public class TreeDataModel
This class is an implementation of the TreeModel, that also supports (extends) DataTable. Used as a DataModel for the JTree(s) that are filled through DataTables. This data model supports only a 3 levels tree a Root, parents and children.
Nested Class Summary | |
---|---|
class |
TreeDataModel.TreeObject
Represents an A tree Node object, maintains the node Type, DB ID representing this node, and value to be displayed. |
protected static class |
TreeDataModel.TreeObjectTypes
Defines the 3 Types of nodes (levels) suported by this tree model. |
Field Summary | |
---|---|
protected DataTable |
childrenDataTable
The DataTable of the last level of the tree. |
protected java.lang.String |
childrenSP
The Stored Procedure used to compose and retrieve the 3rd level of the tree. |
protected int |
colID
The Column indicating the ID in the DataTable. |
protected int |
colVisible
The Column to be displayed in the tree. |
protected int |
lastElementID
The last expanded element ID. |
protected TreeDataModel.TreeObject |
rootObject
The root object of the tree. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
TreeDataModel(java.lang.String rootName,
DataTable dataTable,
int colID,
int colVisible,
java.lang.String childrenSP)
Constructor |
Method Summary | |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener l)
(not implemented) |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Retreives the child object for a given parent at a given index. |
int |
getChildCount(java.lang.Object parent)
Retrieves the Child Count for a specific parent. |
TreeDataModel.TreeObject[] |
getChildren(javax.swing.tree.TreePath treePath)
Returnd the children at a specific tree path. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
(not implemented) |
java.lang.Object |
getRoot()
Retrieves the Root element of the tree. |
boolean |
isLeaf(java.lang.Object node)
Indicates if this item is leaf or not. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l)
(not implemented) |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
|
Methods inherited from class org.bibalex.daf.handlers.dbhandler.DataTable |
---|
addRow, addRow, addRowAt, addRowAt, deleteRow, elementAt, elementAt, ExportToExcel, getColumnCount, getColumnName, getDynamicColumnIndices, getNameOfColumn, getNoOfColumns, getNoOfRows, getRow, getRowCount, getValueAt, setArchivingMatrix, setDynamicColumnIndices, setDynamicTable, setNameOfColumn, setNoOfColumn, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TreeDataModel.TreeObject rootObject
protected DataTable childrenDataTable
protected int colID
protected int colVisible
protected int lastElementID
protected java.lang.String childrenSP
Constructor Detail |
---|
public TreeDataModel(java.lang.String rootName, DataTable dataTable, int colID, int colVisible, java.lang.String childrenSP)
rootName
- The tree Root namedataTable
- The DataTable representing the 2nd level of the tree.colID
- The Column indicating the ID in the DataTable.colVisible
- The Column to be displayed in the tree.childrenSP
- The Stored Procedure used to compose and retrieve the 3rd level of the tree.Method Detail |
---|
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
parent
- The parent TreeObjectindex
- The index within the children of the given parent.
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
parent
- The parent we need to get the child count for.
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
node
- The Object
to check for if Leaf or not.
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
(not implemented)
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
parent
- child
- (not implemented)
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
addTreeModelListener
in interface javax.swing.tree.TreeModel
l
- public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
l
- public TreeDataModel.TreeObject[] getChildren(javax.swing.tree.TreePath treePath)
treePath
- The tree path used to find the children.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |