nl.tudelft.simulation.introspection.sortable
Class SortingTableModel

java.lang.Object
  extended by nl.tudelft.simulation.introspection.sortable.SortingTableModel
All Implemented Interfaces:
TableModel, Sortable
Direct Known Subclasses:
SortingObjectTableModel

public class SortingTableModel
extends Object
implements TableModel, Sortable

The SortingTableModel.

(c) copyright 2002-2005-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
1.1 Apr 15, 2004
Author:
Niels Lang Peter Jacobs

Nested Class Summary
 
Nested classes/interfaces inherited from interface nl.tudelft.simulation.introspection.sortable.Sortable
Sortable.Definition
 
Field Summary
protected  Integer[] expandedIndex
          expandedIndex
protected  Map proxyListeners
          the listeners
protected  TableModel source
          the source
 
Constructor Summary
SortingTableModel(TableModel source)
          constructs a new SortingTableModel
 
Method Summary
 void addTableModelListener(TableModelListener l)
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 Sortable.Definition[] getDefinitions()
           
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void removeTableModelListener(TableModelListener l)
           
 void setDefinitions(Sortable.Definition[] definitions)
          Sets the current definitions defined for this Sortable.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void sort()
          Instructs this Sortable to sort based on currently set sorting definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxyListeners

protected Map proxyListeners
the listeners


source

protected TableModel source
the source


expandedIndex

protected Integer[] expandedIndex
expandedIndex

Constructor Detail

SortingTableModel

public SortingTableModel(TableModel source)
constructs a new SortingTableModel

Parameters:
source - the sorce
Method Detail

getDefinitions

public Sortable.Definition[] getDefinitions()
Specified by:
getDefinitions in interface Sortable
Returns:
Returns the current definitions defined for this Sortable. The sequence of the definitions matches the sorting sequence, in that a definition will be performed before another definition if having a lower index.
See Also:
Sortable.getDefinitions()

setDefinitions

public void setDefinitions(Sortable.Definition[] definitions)
Description copied from interface: Sortable
Sets the current definitions defined for this Sortable. The sequence of the definitions matches the sorting sequence, in that a definition will be performed before another definition if having a lower index.

Specified by:
setDefinitions in interface Sortable
Parameters:
definitions - An array of sort definitions. If multiple definitions for the same field are included, the one with highest index will be applied.
See Also:
#setDefinitions(Definition[])

sort

public void sort()
Description copied from interface: Sortable
Instructs this Sortable to sort based on currently set sorting definitions.

Specified by:
sort in interface Sortable
See Also:
Sortable.sort()

addTableModelListener

public void addTableModelListener(TableModelListener l)
Specified by:
addTableModelListener in interface TableModel
See Also:
TableModel.addTableModelListener(TableModelListener)

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel
See Also:
TableModel.getColumnClass(int)

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel
See Also:
TableModel.getColumnCount()

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel
See Also:
TableModel.getColumnName(int)

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel
See Also:
TableModel.getRowCount()

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel
See Also:
TableModel.getValueAt(int, int)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
See Also:
TableModel.isCellEditable(int, int)

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Specified by:
removeTableModelListener in interface TableModel
See Also:
TableModel.removeTableModelListener(TableModelListener)

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
See Also:
TableModel.setValueAt(Object, int, int)


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.