SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoBandFormatBase

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoBandFormatBase
Direct Known Subclasses:
AgoBandFormat

public abstract class AgoBandFormatBase
extends Object

The base class for band formats


Constructor Summary
AgoBandFormatBase()
           
 
Method Summary
 Color getBackgroundColor()
          Returns the Color object which describes the band's background color
 String getColumnName(int columnIndex)
          Returns the text associated with or displayed by this column
 int getIndent()
          Returns the number of pixels by which this band is indented
 String getName()
          Returns the name of the band
 boolean getTransparent()
          Return the band transparency property
 void setBackgroundColor(Color backgroundcolor)
          Sets the band background color
 boolean setColumnName(int columnIndex, String columnName)
          Sets the text value to be displayed in the specified column
 void setIndent(int indent)
          Set the number of pixels by which this band is to be indented
 void setName(String name)
          Sets the band name
 void setTransparent(boolean transparent)
          Sets the band transparency property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoBandFormatBase

public AgoBandFormatBase()
Method Detail

getName

public String getName()
Returns the name of the band
Example:

This example searches for a band with a specific name

	int bandCount = viewFmt.getBandCount();
	for (int i = 0; i < bandCount; i++)
	{
		AgoBandFormatBase bandFmt = viewFmt.getBandFormat(i);
		String name = bandFmt.getName();
		if (name.equals("CustomerBand"))
		{
			// do something useful with the band we've found
		}
	}
See Also:
AgoBandFormatBase.setName(String name)

setName

public void setName(String name)
Sets the band name
Parameters:
name - the name for the band
Example:
	bandFmt.setName("CustomerBand");
See Also:
AgoBandFormatBase.getName()

getIndent

public int getIndent()
Returns the number of pixels by which this band is indented
Example:
	int pixelIndent = bandFmt.getIndent();
See Also:
AgoBandFormatBase.setIndent(int indent)

setIndent

public void setIndent(int indent)
Set the number of pixels by which this band is to be indented
Parameters:
indent - the indent margin, in pixels
Example:
	bandFmt.setIndent(20);
See Also:
AgoBandFormatBase.getIndent()

getTransparent

public boolean getTransparent()
Return the band transparency property
Usage:

Returns true if column is transparent

Example:
	boolean isTransparent = bandFmt.getTransparent();
See Also:
AgoBandFormatBase.setTransparent(boolean transparent)

setTransparent

public void setTransparent(boolean transparent)
Sets the band transparency property
Parameters:
transparent - set to true to make column transparent
Usage:

Note that if the band is transparent, the background color will not be shown

Example:
	bandFmt.setTransparent(true);
See Also:
AgoBandFormatBase.getTransparent()

getBackgroundColor

public final Color getBackgroundColor()
Returns the Color object which describes the band's background color
Example:

This example illustrates how to obtain the background Color of a band.

Color bgColor;
bgColor = bandFmt.getBackgroundColor();
See Also:
AgoBandFormatBase.setBackgroundColor(Color backgroundcolor)

setBackgroundColor

public void setBackgroundColor(Color backgroundcolor)
Sets the band background color
Parameters:
backgroundcolor - the background color, as defined in java.awt.Color.
Usage:

The Transparent property must be false for the background color to show.

Example:

The following example illustrates how to set the background color on a band using one of the Color constants:

     bandFmt.setBackgroundColor(Color.white);
This example illustrates how to create a new Color and then use it to set the background color:
     Color col = new Color(247, 247, 222);
     bandFmt.setBackgroundColor(col);
See Also:
AgoBandFormatBase.getBackgroundColor()

setColumnName

public boolean setColumnName(int columnIndex,
                             String columnName)
Sets the text value to be displayed in the specified column
Parameters:
columnIndex - the (0-based) index of the column whose name is to be set
columnName - the name to use for the text of the column
Usage:

The name parameter passed to this method is equivalent to the string passed in to initColumnTextHeader, and is appropriate only if this column is to contain a constant value, which normally means it has to be a column of a header band. It returns true if it is able to set the property -- if this column has not yet been initialized, or has been initialized with initColumnTextHeader(), It returns false if it is not able to set the property -- if this column has been initialized with initColumnTextProperty()

Example:
     bandFmt.setColumnName(2, "CustomerID");
See Also:
AgoColumnText.initColumnTextProperty(String propertyName, AgoFontIdentifier fontid, Color textColor, int alignment), AgoColumnText.initColumnTextHeader(String headerText, AgoFontIdentifier fontid, Color textColor, int alignment)

getColumnName

public String getColumnName(int columnIndex)
Returns the text associated with or displayed by this column
Parameters:
columnIndex - the (0-based) index of the column whose name is to be returned
Usage:

The name returned by this method is equivalent to the string passed in to initColumnTextHeader, and is available only if this column contains a constant value, which normally means it has to be a column of a header band. It returns the text of the header if it is able to get the name (i.e. if this column has been initialized either with setColumnName or with initColumnTextHeader), and it returns null if it is not able to get the name (i.e. if this column has been initialized with initColumnTextProperty)

Example:
     String name = bandFmt.getColumnName(2);
See Also:
AgoColumnText.initColumnTextProperty(String propertyName, AgoFontIdentifier fontid, Color textColor, int alignment), AgoColumnText.initColumnTextHeader(String headerText, AgoFontIdentifier fontid, Color textColor, int alignment)

SilverStream
Application Server 3.5