unbbayes.gui.table
Class ColumnGroup

java.lang.Object
  extended by unbbayes.gui.table.ColumnGroup

public class ColumnGroup
extends Object


Field Summary
protected  int margin
          The margin to use for renderering.
protected  TableCellRenderer renderer
          Cell renderer for group header.
protected  String text
          The ColumnGroup instance name.
protected  Vector v
          Holds the TableColumn or ColumnGroup objects contained within this ColumnGroup instance.
 
Constructor Summary
ColumnGroup(String text)
          Standard ColumnGroup constructor.
ColumnGroup(TableCellRenderer renderer, String text)
          Standard ColumnGroup constructor.
 
Method Summary
 void add(Object obj)
          Add a TableColumn or ColumnGroup object to the ColumnGroup instance.
 Vector getColumnGroups(TableColumn c, Vector g)
          Get the ColumnGroup list containing the required table column.
 TableCellRenderer getHeaderRenderer()
          Returns the TableCellRenderer for the ColumnGroup.
 Object getHeaderValue()
          Get the ColumnGroup header value.
 Dimension getSize(JTable table)
          Get the dimension of this ColumnGroup.
 void setColumnMargin(int margin)
          Sets the margin that ColumnGroup instance will use and all held TableColumns and/or ColumnGroups.
 void setHeaderRenderer(TableCellRenderer renderer)
          Set the TableCellRenderer for this ColumnGroup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renderer

protected TableCellRenderer renderer
Cell renderer for group header.


v

protected Vector v
Holds the TableColumn or ColumnGroup objects contained within this ColumnGroup instance.


text

protected String text
The ColumnGroup instance name.


margin

protected int margin
The margin to use for renderering.

Constructor Detail

ColumnGroup

public ColumnGroup(String text)
Standard ColumnGroup constructor.

Parameters:
text - Name of the ColumnGroup which will be displayed when the ColumnGroup is renderered.

ColumnGroup

public ColumnGroup(TableCellRenderer renderer,
                   String text)
Standard ColumnGroup constructor.

Parameters:
renderer - a TableCellRenderer for the group.
text - Name of the ColumnGroup which will be displayed when the ColumnGroup is renderered.
Method Detail

add

public void add(Object obj)
Add a TableColumn or ColumnGroup object to the ColumnGroup instance.

Parameters:
obj - TableColumn or ColumnGroup

getColumnGroups

public Vector getColumnGroups(TableColumn c,
                              Vector g)
Get the ColumnGroup list containing the required table column.

Parameters:
g - vector to populate with the ColumnGroup/s
c - TableColumn
Returns:
Vector containing the ColumnGroup/s

getHeaderRenderer

public TableCellRenderer getHeaderRenderer()
Returns the TableCellRenderer for the ColumnGroup.

Returns:
the TableCellRenderer

setHeaderRenderer

public void setHeaderRenderer(TableCellRenderer renderer)
Set the TableCellRenderer for this ColumnGroup.

Parameters:
renderer - the renderer to use

getHeaderValue

public Object getHeaderValue()
Get the ColumnGroup header value.

Returns:
the value.

getSize

public Dimension getSize(JTable table)
Get the dimension of this ColumnGroup.

Parameters:
table - the table the header is being rendered in
Returns:
the dimension of the ColumnGroup

setColumnMargin

public void setColumnMargin(int margin)
Sets the margin that ColumnGroup instance will use and all held TableColumns and/or ColumnGroups.

Parameters:
margin - the margin


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.