Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table
Class DefaultGroupTableColumnModel

java.lang.Object
  extended by com.citra.table.DefaultGroupTableColumnModel
All Implemented Interfaces:
GroupTableColumnModel, Serializable

public class DefaultGroupTableColumnModel
extends Object
implements GroupTableColumnModel, Serializable

DefaultGroupTableColumnModel is the default implementation of a GroupTableColumnModel.

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
          the listenerlist of GroupTableColumnModelListeners
protected  GroupTableColumn root
          the group table column used as the root.
 
Constructor Summary
DefaultGroupTableColumnModel()
          Constructs a DefaultGroupTableColumnModel.
DefaultGroupTableColumnModel(GroupTableColumn root)
          Constructs a DefaultGroupTableColumnModel.
 
Method Summary
 void addGroupColumnModelListener(GroupTableColumnModelListener l)
          Adds a GroupTableColumnModelListener that is notified each time a group column is added or removed from the model.
protected  void fireGroupColumnsInserted(GroupTableColumnModelEvent e)
          Notifies listeners that a group column has been added to the model.
protected  void fireGroupColumnsRemoved(GroupTableColumnModelEvent e)
          Notifies listeners that a group column has been removed from the model.
 TableColumn getChildColumn(GroupTableColumn parent, int index)
          Returns the child column of a group column at the specified location.
 int getChildColumnCount(GroupTableColumn parent)
          Returns the number of children columns in a group column.
 GroupTableColumn getGroupColumn(TableColumn column)
          Returns the parent group column of the specified column.
 int getIndexOfChildColumn(GroupTableColumn parent, TableColumn child)
          Returns the index of a child column in its parent group column.
 GroupTableColumn getRootGroupColumn()
          Returns the root group column.
 void insertColumnInto(TableColumn child, GroupTableColumn parent, int index)
          Inserts a column as child of a group column at the specified index.
 void removeColumnFromParent(TableColumn aColumn)
          Removes a column from the model.
 void removeGroupColumnModelListener(GroupTableColumnModelListener l)
          Removes a GroupTableColumnModelListener from the list that is notified each time a group column is added or removed from the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
the listenerlist of GroupTableColumnModelListeners


root

protected GroupTableColumn root
the group table column used as the root.

Constructor Detail

DefaultGroupTableColumnModel

public DefaultGroupTableColumnModel()
Constructs a DefaultGroupTableColumnModel.


DefaultGroupTableColumnModel

public DefaultGroupTableColumnModel(GroupTableColumn root)
Constructs a DefaultGroupTableColumnModel.

Method Detail

addGroupColumnModelListener

public void addGroupColumnModelListener(GroupTableColumnModelListener l)
Adds a GroupTableColumnModelListener that is notified each time a group column is added or removed from the model.

Specified by:
addGroupColumnModelListener in interface GroupTableColumnModel
Parameters:
l - the GroupTableColumnModelListener to add

fireGroupColumnsInserted

protected void fireGroupColumnsInserted(GroupTableColumnModelEvent e)
Notifies listeners that a group column has been added to the model.

Parameters:
e - the event to forward

fireGroupColumnsRemoved

protected void fireGroupColumnsRemoved(GroupTableColumnModelEvent e)
Notifies listeners that a group column has been removed from the model.

Parameters:
e - the event to forward

getChildColumn

public TableColumn getChildColumn(GroupTableColumn parent,
                                  int index)
Returns the child column of a group column at the specified location.

Specified by:
getChildColumn in interface GroupTableColumnModel
Parameters:
parent - a group column
index - the location of the child column
Returns:
the child column of parent at index

getChildColumnCount

public int getChildColumnCount(GroupTableColumn parent)
Returns the number of children columns in a group column.

Specified by:
getChildColumnCount in interface GroupTableColumnModel
Parameters:
parent - a group column
Returns:
the number of the group column's children

getGroupColumn

public GroupTableColumn getGroupColumn(TableColumn column)
Returns the parent group column of the specified column. If the column is not part of a group, null is returned.

Specified by:
getGroupColumn in interface GroupTableColumnModel
Parameters:
column - the column being part of a group column
Returns:
the enclosing group column or null, if the column is not part of a group

getIndexOfChildColumn

public int getIndexOfChildColumn(GroupTableColumn parent,
                                 TableColumn child)
Returns the index of a child column in its parent group column.

Specified by:
getIndexOfChildColumn in interface GroupTableColumnModel
Parameters:
parent - a group column in the model
child - the child column
Returns:
the index of the child column in the group column

getRootGroupColumn

public GroupTableColumn getRootGroupColumn()
Returns the root group column.

Specified by:
getRootGroupColumn in interface GroupTableColumnModel
Returns:
the root group column

insertColumnInto

public void insertColumnInto(TableColumn child,
                             GroupTableColumn parent,
                             int index)
Inserts a column as child of a group column at the specified index.

Specified by:
insertColumnInto in interface GroupTableColumnModel
Parameters:
child - the column to add
parent - the group column to add the child column to
index - the location of the added child column

removeColumnFromParent

public void removeColumnFromParent(TableColumn aColumn)
Removes a column from the model.

Specified by:
removeColumnFromParent in interface GroupTableColumnModel
Parameters:
aColumn - the column to remove

removeGroupColumnModelListener

public void removeGroupColumnModelListener(GroupTableColumnModelListener l)
Removes a GroupTableColumnModelListener from the list that is notified each time a group column is added or removed from the model.

Specified by:
removeGroupColumnModelListener in interface GroupTableColumnModel
Parameters:
l - the GroupTableColumnModelListener to remove

Copyright © 2011 Citra Technologies. All Rights Reserved.