org.xnap.gui.table
Class DefaultColumnTreeTableModel

java.lang.Object
  extended by org.xnap.gui.table.AbstractTreeTableModel
      extended by org.xnap.gui.table.AbstractColumnTreeTableModel
          extended by org.xnap.gui.table.DefaultColumnTreeTableModel
All Implemented Interfaces:
javax.swing.tree.TreeModel, ColumnModel, SortableModel, TreeTableModel
Direct Known Subclasses:
OpenNapServerTableModel, PircBotServerTableModel, SearchTableModel, TransferTableModel

public class DefaultColumnTreeTableModel
extends AbstractColumnTreeTableModel
implements SortableModel


Field Summary
 
Fields inherited from class org.xnap.gui.table.AbstractColumnTreeTableModel
columns
 
Fields inherited from class org.xnap.gui.table.AbstractTreeTableModel
listenerList, root
 
Constructor Summary
DefaultColumnTreeTableModel()
           
 
Method Summary
 void add(TreeTableNode node)
           
 java.lang.Object getChild(java.lang.Object node, int index)
           
 int getChildCount(java.lang.Object node)
           
 int getSortedColumn()
          Returns the index of the column that was sorted last.
 java.lang.Object getValueAt(java.lang.Object node, int column)
          Returns the value to be displayed for node node, at column number column.
 int indexOfByData(java.lang.Object data)
          Returns the node that stores data.
 boolean isSortedAscending()
          Returns true, if the table is sorted in ascending order.
 java.util.Iterator iterator()
           
 void remove(int index)
           
 void remove(TreeTableNode node)
           
 void setMaintainSortOrder(boolean newValue)
          Sets the maintain sort order flag.
 boolean sortByColumn(int column, boolean ascending, boolean revert)
          Sorts the table by column.
 
Methods inherited from class org.xnap.gui.table.AbstractColumnTreeTableModel
addColumn, addColumns, createColumnMenu, createTreeTable, getColumnAt, getColumnClass, getColumnCount, getColumnName, isLeaf
 
Methods inherited from class org.xnap.gui.table.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getRoot, isCellEditable, removeTreeModelListener, setValueAt, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xnap.gui.table.SortableModel
getColumnClass
 

Constructor Detail

DefaultColumnTreeTableModel

public DefaultColumnTreeTableModel()
Method Detail

add

public void add(TreeTableNode node)

getChild

public java.lang.Object getChild(java.lang.Object node,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel

getChildCount

public int getChildCount(java.lang.Object node)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel

indexOfByData

public int indexOfByData(java.lang.Object data)
Returns the node that stores data.

Returns:
-1, if data could not be found

getValueAt

public java.lang.Object getValueAt(java.lang.Object node,
                                   int column)
Description copied from interface: TreeTableModel
Returns the value to be displayed for node node, at column number column.

Specified by:
getValueAt in interface TreeTableModel

iterator

public java.util.Iterator iterator()

remove

public void remove(TreeTableNode node)

remove

public void remove(int index)

getSortedColumn

public int getSortedColumn()
Description copied from interface: SortableModel
Returns the index of the column that was sorted last.

Specified by:
getSortedColumn in interface SortableModel

isSortedAscending

public boolean isSortedAscending()
Description copied from interface: SortableModel
Returns true, if the table is sorted in ascending order.

Specified by:
isSortedAscending in interface SortableModel

setMaintainSortOrder

public void setMaintainSortOrder(boolean newValue)
Sets the maintain sort order flag.

Specified by:
setMaintainSortOrder in interface SortableModel

sortByColumn

public boolean sortByColumn(int column,
                            boolean ascending,
                            boolean revert)
Sorts the table by column.

Specified by:
sortByColumn in interface SortableModel
Parameters:
column - the column to sort
ascending - true, if table needs to be sorted in ascending order; false, if in descending order
revert - automatically revert sort order
Returns:
true, if table was sorted ascending; false, if descending


Copyright © 2001-2005 XNap Team. All Rights Reserved.