SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoBandFormat

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoBandFormatBase
       |
       +--com.sssw.rt.tview.AgoBandFormat

public class AgoBandFormat
extends AgoBandFormatBase

Defines a band (row) format for a Java-based view control. A band format consists of one or more columns appended to it. Columns are displayed in the order in which they are added to the band using appendColumnFormat(). You can create multiple band formats for a single view. You specify that a band format is a header band (after instantiating it) by calling the AgoBandFormatBase.setHeaderBandFormat() method.


Constructor Summary
AgoBandFormat(String name)
           
 
Method Summary
 void adjustToDisplayDimensions(int displaywidth, int displayheight)
          Adjusts the band format to fit the screen dimensions.
 void appendColumnFormat(AgoColumnBase columnformat)
          Appends a column to the band
 int getColumnCount()
          Returns the number of columns in the band.
 AgoColumnBase getColumnFormat(int column)
          Returns the format object for the specified column.
 int getColumnSpacer()
          Returns the band's inter-column spacing, in pixels.
 int getDefaultWidth()
          Returns the band's default dispay width, in pixels.
 int getFixedRowHeight()
          Returns the the row height, in pixels.
 int getFontScalePointDelta()
          Returns the amount (in points) by which the font size is to be increased (a positive number) or decreased (a negative number) for each level of indent in the hierarchy.
 Object getGridIdentifier()
          Returns an Object that identifies the group of bands with which this band must align itself.
 int getInterRowSpacer()
          Returns the inter-row spacing, in pixels
 boolean getUseFixedRowHeight()
          Returns the property that specifies whether or not rows using this band format have a fixed height
 void insertColumnFormat(AgoColumnBase columnformat, AgoColumnBase insertbefore)
          Inserts a column format.
 boolean isHierarchical()
          Returns a value indicating whether this band has a hierarchical column or not.
 void removeColumnFormat(AgoColumnBase columnformat)
          Removes a column format.
 void setColumnSpacer(int columnspacer)
          Sets the inter-column spacing, in pixels.
 void setFixedRowHeight(int rowheight)
          Sets the row height.
 void setFontScalePointDelta(int fontscalepointdelta)
          Sets the amount (in points) by which the font size is to be increased (a positive number) or decreased (a negative number) for each level of indent in the hierarchy.
 void setGridIdentifier(Object grididentifier)
          Sets the Object which identifies the group of bands with which this band must align itself.
 void setInterRowSpacer(int interrowspacer)
          Sets the inter-row spacing, in pixels.
 void setUseFixedRowHeight(boolean fixedrowheight)
          Specify whether or not rows in this band are to have a fixed height.
 
Methods inherited from class com.sssw.rt.tview.AgoBandFormatBase
getBackgroundColor, getColumnName, getIndent, getName, getTransparent, setBackgroundColor, setColumnName, setIndent, setName, setTransparent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoBandFormat

public AgoBandFormat(String name)
Parameters:
name - a string containing the band format name
Example:
  AgoBandFormat hdrBandFmt = new AgoBandFormat("hdrBandFmt");
 
Method Detail

adjustToDisplayDimensions

public void adjustToDisplayDimensions(int displaywidth,
                                      int displayheight)
Adjusts the band format to fit the screen dimensions.
Parameters:
displaywidth - display width, in pixels
displayheight - display height, in pixels
Example:
	bandFmt.adjustToDisplayDimensions(600, 400);
 

getDefaultWidth

public int getDefaultWidth()
Returns the band's default dispay width, in pixels.
Example:
    int width = bandFmt.getDefaultWidth();

getColumnSpacer

public final int getColumnSpacer()
Returns the band's inter-column spacing, in pixels.
Usage:
The spacer is the number of extra pixels to be placed on each side of the column for spacing. The columns are, in effect, twice the spacer distance apart.
Example:
	int spacing =bandFmt.getColumnSpacer() * 2;
See Also:
AgoBandFormat.setColumnSpacer(int columnspacer)

setColumnSpacer

public void setColumnSpacer(int columnspacer)
Sets the inter-column spacing, in pixels.
Parameters:
columnspacer - the space between columns, in pixels
Usage:

The spacer is the number of extra pixels to be placed on each side of the column for spacing. The columns are, in effect, twice the spacer distance apart. If the columns are to be separated by x, x/2 should be specified as the spacer distance. The default value is 2, so columns are 4 pixels apart.

Example:
	int actualSpace = 6;
	bandFmt.setColumnSpacer(actualSpace/2);
See Also:
AgoBandFormat.getColumnSpacer()

getInterRowSpacer

public final int getInterRowSpacer()
Returns the inter-row spacing, in pixels
Usage:

The spacer is the number of extra pixels to be placed above and below each row. The rows are, in effect, twice the spacer distance apart.

Example:
	int spacing =bandFmt.getInterRowSpacer() * 2;
See Also:
AgoBandFormat.setInterRowSpacer(int interrowspacer)

setInterRowSpacer

public void setInterRowSpacer(int interrowspacer)
Sets the inter-row spacing, in pixels.
Parameters:
interrowspacer - space between rows, in pixels
Usage:

The spacer is the number of extra pixels to be placed above and below each row. The rows are, in effect, twice the spacer distance apart. If the rows are to be separated by x, x/2 should be specified as the spacer distance. The default value is 2, so rows are 4 pixels apart.

Example:
	int actualSpace = 6;
	bandFmt.setInterRowSpacer(actualSpace/2);
See Also:
AgoBandFormat.getInterRowSpacer()

getFontScalePointDelta

public final int getFontScalePointDelta()
Returns the amount (in points) by which the font size is to be increased (a positive number) or decreased (a negative number) for each level of indent in the hierarchy.
Example:
	int delta;
	delta = bandFmt.getFontScalePointDelta();
See Also:
AgoBandFormat.setFontScalePointDelta(int fontscalepointdelta)

setFontScalePointDelta

public void setFontScalePointDelta(int fontscalepointdelta)
Sets the amount (in points) by which the font size is to be increased (a positive number) or decreased (a negative number) for each level of indent in the hierarchy.
Parameters:
fontscalepointdelta - the amount (in points) by which the font size is to be increased or decreased for each indent level.
Example:
	// specify that the font size decreases by 2 points for each indent level
	bandFmt.setFontScalePointDelta(-2);
See Also:
AgoBandFormat.getFontScalePointDelta()

getGridIdentifier

public final Object getGridIdentifier()
Returns an Object that identifies the group of bands with which this band must align itself.
Usage:

The grid group identifier object may be any object - an Integer, a String, or any other class. Its sole purpose is to identify members of a group of bands which must be kept in alignment. Normally this group will consist only of a header band and a data band, but depending on the application, more bands may be included.

Example:
	// make sure the header band and the data band line up
	Object grid = hdrBandFmt.getGridIdentifier();
	if (grid == null)
	{
		grid = new String("customerGrid");
		hdrBandFmt.setGridIdentifier(grid);
	}
	bandFmt.setGridIdentifier(grid);
See Also:
AgoBandFormat.setGridIdentifier(Object grididentifier)

setGridIdentifier

public void setGridIdentifier(Object grididentifier)
Sets the Object which identifies the group of bands with which this band must align itself.
Parameters:
grididentifier - Object identifying the group of bands which must be aligned with each other
Usage:

The grid group identifier object may be any object - an Integer, a String, or any other class. Its sole purpose is to identify members of a group of bands which must be kept in alignment. Normally this group will consist only of a header band and a data band, but depending on the application, more bands may be included

Example:
	Integer grid = new Integer(99);
	hdrBandFmt.setGridIdentifier(grid);
	bandFmt.setGridIdentifier(grid);
See Also:
AgoBandFormat.getGridIdentifier()

getUseFixedRowHeight

public final boolean getUseFixedRowHeight()
Returns the property that specifies whether or not rows using this band format have a fixed height
Usage:

Returns true if rows have a fixed height. Otherwise, row height is set dynamically to the height of the tallest cell in the row.

Example:
	int height;
	// find out the fixed row height, if we are using one
	if (bandFmt.getUseFixedRowHeight())
		height = bandFmt.getFixedRowHeight();
	else
		height = -1;	// indicate that height is variable
See Also:
AgoBandFormat.setUseFixedRowHeight(boolean fixedrowheight), AgoBandFormat.getFixedRowHeight(), AgoBandFormat.adjustToDisplayDimensions(int displaywidth, int displayheight)

setUseFixedRowHeight

public void setUseFixedRowHeight(boolean fixedrowheight)
Specify whether or not rows in this band are to have a fixed height.
Parameters:
fixedrowheight - True means rows in this band are to have a fixed height. Otherwise, row height is set to the height of the tallest cell in the row.
Example:
	// specify that we are using fixed row height
	bandFmt.setUseFixedRowHeight(true);

	// and specify the height
	bandFmt.setFixedRowHeight(35);
See Also:
AgoBandFormat.getFixedRowHeight(), AgoBandFormat.setFixedRowHeight(int rowheight), AgoBandFormat.adjustToDisplayDimensions(int displaywidth, int displayheight)

getFixedRowHeight

public final int getFixedRowHeight()
Returns the the row height, in pixels.
Usage:

This value is relevant only if the row height has been specified as fixed using setFixedRowHeight().

Example:
	int height;
	// find out the fixed row height, if we are using one
	if (bandFmt.getUseFixedRowHeight())
		height = bandFmt.getFixedRowHeight();
	else
		height = -1;	// indicate that height is variable
See Also:
AgoBandFormat.setFixedRowHeight(int rowheight), AgoBandFormat.setUseFixedRowHeight(boolean fixedrowheight)

setFixedRowHeight

public void setFixedRowHeight(int rowheight)
Sets the row height.
Parameters:
rowheight - the fixed row height, in pixels
Usage:

This value is relevant only if the row height has been specified as fixed using setFixedRowHeight()

Example:
	// specify that we are using fixed row height
	bandFmt.setUseFixedRowHeight(true);

	// and specify the height
	bandFmt.setFixedRowHeight(35);
See Also:
AgoBandFormat.getFixedRowHeight(), AgoBandFormat.setUseFixedRowHeight(boolean fixedrowheight)

getColumnCount

public final int getColumnCount()
Returns the number of columns in the band.
Example:
	int colCount = bandFmt.getColumnCount();

getColumnFormat

public final AgoColumnBase getColumnFormat(int column)
Returns the format object for the specified column.
Parameters:
column - the (0-based) integer index of a column
Example:

This example searches for text columns and does something to them

	AgoColumnBase colFmt = null;
	int colCount = bandFmt.getColumnCount();

	for (int i = 0; i < colCount; i++)
	{
		colFmt = bandFmt.getColumnFormat(i);
		if (colFmt instanceof AgoColumnText)
		{
			// do something useful with the column
		}
	}
See Also:
AgoBandFormat.appendColumnFormat(AgoColumnBase columnformat)

appendColumnFormat

public void appendColumnFormat(AgoColumnBase columnformat)
Appends a column to the band
Parameters:
columnformat - the column object to append
Example:
	AgoColumnText colFmt = new AgoColumnText();
	bandFmt.appendColumnFormat(colFmt);
See Also:
AgoBandFormat.getColumnFormat(int column), AgoBandFormat.insertColumnFormat(AgoColumnBase columnformat, AgoColumnBase insertbefore), AgoColumnBase

insertColumnFormat

public void insertColumnFormat(AgoColumnBase columnformat,
                               AgoColumnBase insertbefore)
Inserts a column format.
Parameters:
columnformat - the column object to insert
insertbefore - inserts the object before this AgoColumnBase object. If this parameter is null, the specified column is appended at the end.
Example:
	// insert a column before column three
	AgoColumnBase prevColFmt = bandFmt.getColumnFormat(2);
	AgoColumnText colFmt = new AgoColumnText();
	bandFmt.insertColumnFormat(colFmt, prevColFmt);
See Also:
AgoBandFormat.appendColumnFormat(AgoColumnBase columnformat), AgoBandFormat.getColumnFormat(int column)

removeColumnFormat

public void removeColumnFormat(AgoColumnBase columnformat)
Removes a column format.
Parameters:
columnformat - the column object to remove
Example:
	// remove column three
	AgoColumnBase colFmt = bandFmt.getColumnFormat(2);
	bandFmt.removeColumnFormat(colFmt);

isHierarchical

public final boolean isHierarchical()
Returns a value indicating whether this band has a hierarchical column or not.

SilverStream
Application Server 3.5