Package ucar.ui.table
Class TreeTableModelSorted
- java.lang.Object
-
- ucar.ui.table.TreeTableModelAbstract
-
- ucar.ui.table.TreeTableModelSorted
-
- All Implemented Interfaces:
TreeModel
,TreeTableModel
public class TreeTableModelSorted extends TreeTableModelAbstract
-
-
Field Summary
-
Fields inherited from class ucar.ui.table.TreeTableModelAbstract
listenerList, root
-
-
Constructor Summary
Constructors Constructor Description TreeTableModelSorted(String[] colName, ArrayList rows)
This uses the mode where the selected column becomes the root of the tree.TreeTableModelSorted(ThreadSorter threadSorter, String[] colName, ArrayList rows)
This is the mode that adds a column for threads.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRowsToSetFromPath(JTree tree, TreePath path, Set set)
Object
getChild(Object parent, int index)
int
getChildCount(Object parent)
Class
getColumnClass(int column)
Returns the type for column numbercolumn
.int
getColumnCount()
Returns the number ofs availible column.String
getColumnName(int col)
Returns the name for column numbercolumn
.TreePath
getPath(TableRow row)
boolean
getReverse()
TableRow
getRow(int rowno)
TableRow
getRow(Object node)
TableRow
getRow(TreePath path)
int
getRowCount()
ArrayList
getRows()
int
getSortCol()
Object
getValueAt(Object node, int col)
Returns the value to be displayed for nodenode
, at column numbercolumn
.boolean
isThreadsOn()
boolean
isTreeSort()
void
setReverse(boolean reverse)
void
setRows(ArrayList rows)
Set a new rowlist.void
setSortCol(int sortCol)
void
setSorter(RowSorter sorter)
void
setThreadsOn(boolean threadsOn)
void
sort()
sort using the current sortCol and reverseboolean
sort(int sortCol)
sort using the current sortCol; toggle reversevoid
sort(int sortCol, boolean reverse)
sort using the named sortCol and reverseString
toString()
boolean
useThreads()
-
Methods inherited from class ucar.ui.table.TreeTableModelAbstract
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getRoot, isCellEditable, isLeaf, removeTreeModelListener, setValueAt, valueForPathChanged
-
-
-
-
Constructor Detail
-
TreeTableModelSorted
public TreeTableModelSorted(String[] colName, ArrayList rows)
This uses the mode where the selected column becomes the root of the tree.- Parameters:
colName
- list of column names, must have length > 0.rows
- array of rows that implement TableRow interface, may be empty but not null.
-
TreeTableModelSorted
public TreeTableModelSorted(ThreadSorter threadSorter, String[] colName, ArrayList rows)
This is the mode that adds a column for threads.- Parameters:
threadSorter
- if non-null, add thread column.colName
- list of column names, must have length > 0.rows
- array of rows that implement TableRow interface, may be empty but not null. We make a copy of the Array, but these point to the original objects.
-
-
Method Detail
-
isTreeSort
public boolean isTreeSort()
-
useThreads
public boolean useThreads()
-
isThreadsOn
public boolean isThreadsOn()
-
setThreadsOn
public void setThreadsOn(boolean threadsOn)
-
getReverse
public boolean getReverse()
-
setReverse
public void setReverse(boolean reverse)
-
getSortCol
public int getSortCol()
-
setSortCol
public void setSortCol(int sortCol)
-
setSorter
public void setSorter(RowSorter sorter)
-
getRows
public ArrayList getRows()
-
setRows
public void setRows(ArrayList rows)
Set a new rowlist. This will automaticaly sort. We make a copy of the Array, but these point to the original objects.- Parameters:
rows
- array of rows that implement TableRow interface
-
getRowCount
public int getRowCount()
-
sort
public void sort()
sort using the current sortCol and reverse
-
sort
public boolean sort(int sortCol)
sort using the current sortCol; toggle reverse
-
sort
public void sort(int sortCol, boolean reverse)
sort using the named sortCol and reverse
-
getChildCount
public int getChildCount(Object parent)
-
getColumnCount
public int getColumnCount()
Description copied from interface:TreeTableModel
Returns the number ofs availible column.
-
getColumnName
public String getColumnName(int col)
Description copied from interface:TreeTableModel
Returns the name for column numbercolumn
.
-
getValueAt
public Object getValueAt(Object node, int col)
Description copied from interface:TreeTableModel
Returns the value to be displayed for nodenode
, at column numbercolumn
.
-
getColumnClass
public Class getColumnClass(int column)
Description copied from interface:TreeTableModel
Returns the type for column numbercolumn
.- Specified by:
getColumnClass
in interfaceTreeTableModel
- Overrides:
getColumnClass
in classTreeTableModelAbstract
-
getRow
public TableRow getRow(int rowno)
-
-