SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoViewFormat

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoViewFormat

public final class AgoViewFormat
extends Object

Every AgcView and AgcViewDownloadable control is composed of a view format, that is the physical structure of the view's bands and columns, and data. The AgoViewFormat class represents view's physical format. When you define a view using the View designer (AgcViewDownloadable objects), SilverStream constructs the AgoViewFormat for you. When you build a dynamic view (AgcView), you must programmatically construct and manipulate the AgoViewFormat. You can programmatically manipulate the view format of an AgcViewDownloadable control, by first obtaining its AgoViewFormat object and traversing its children. You define a view by defining the columns (using one of the AgoColumnxxxx classes) and bands then appending them to the AgoViewFormat object.

You can use the view format object to obtain information about its component bands. You can also use it to specify or change the overall characteristics of the view. For example, you might specify whether or not the view's caret is visible (setNoCaret()), or whether all of the rows of a hierarchical view are are visible (expanded) when the view is first displayed to the user.


Constructor Summary
AgoViewFormat()
          AgoViewFormat constructor.
 
Method Summary
 void adjustToDisplayDimensions(int displaywidth, int displayheight)
          Adjust the view format to fit the screen dimensions.
 void appendBandFormat(AgoBandFormatBase bandformat)
          Appends a band format.
 boolean getAdjustToDisplayDimensions()
          Get the state of the property that specifies that the view should automatically adjust to changes in the display dimensions
 Color getBackgroundColor()
          Get the Color object which describes the view's background color.
 String getBackgroundImageSpec()
          Get the name of the file containing the background image specification.
 int getBandCount()
          Return the number of bands in the view.
 AgoBandFormatBase getBandFormat(int bandIndex)
          Return the band format specified by the index 0..nBands-1.
 AgoBandFormatBase getBandFormat(String bandName)
          Return the band format specified by the name.
 Color getCaretColor()
          Gets caret color.
 AgoBandFormatBase getHeaderBandFormat()
          Get the header band format.
 boolean getHoverCaretChange()
          Get the property that specifies whether or not the caret changes when the cursor is just moved over a row without clicking on the row The caret is the rectangle that marks selected items.
 boolean getInitiallyExpanded()
          Get the property which specifies whether or not the view will be expanded when it is first made visible.
 boolean getNoCaret()
          Get the value of the property which specifies that the caret is not to be displayed.
 boolean getResizable()
          Get property which determines whether the view is resizable or not.
 boolean getShowInitialSelection()
          Get the property which specifies whether a selected item is to be displayed when the view is initialized or not.
 boolean getTransparent()
          Get the transparent property.
 void removeBandFormat(AgoBandFormatBase bandformat)
          Removes a band format.
 void setAdjustToDisplayDimensions(boolean adjusttodisplaydimensions)
          Set the state of the property that specifies that the view should automatically adjust to changes in the display dimensions
 void setBackgroundColor(Color backgroundcolor)
          Set the background color of the view.
 void setBackgroundImageSpec(String backgroundimagespec)
          Set the background image specification for the view.
 void setCaretColor(Color caretcolor)
          Set the color for the caret.
 void setHeaderBandFormat(AgoBandFormatBase headerbandformat)
          Sets the header band format.
 void setHoverCaretChange(boolean hovercaretchange)
          Set the property that specifies whether or not the caret changes when the cursor is just moved over a row without clicking on the row The caret is the rectangle that marks selected items.
 void setInitiallyExpanded(boolean initiallyexpanded)
          Set the property which specifies whether or not the view will be expanded when it is first made visible.
 void setNoCaret(boolean nocaret)
          Set the value of the property which specifies that the caret is not to be displayed.
 void setResizable(boolean resizable)
          Sets the resizable property.
 void setShowInitialSelection(boolean showinitialselection)
          Set the property which specifies whether a selected item is to be displayed when the view is initialized or not.
 void setTransparent(boolean transparent)
          Set the transparent property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoViewFormat

public AgoViewFormat()
AgoViewFormat constructor. Sets up the default view format.
Example:
	AgoViewFormat vFmt = new AgoViewFormat();
Method Detail

adjustToDisplayDimensions

public void adjustToDisplayDimensions(int displaywidth,
                                      int displayheight)
Adjust the view format to fit the screen dimensions.
Parameters:
displaywidth - display width in pixel units
displayheight - display height in pixel units
Example:
	vFmt.adjustToDisplayDimensions(600, 400);
See Also:
AgoViewFormat.getAdjustToDisplayDimensions(), AgoViewFormat.setAdjustToDisplayDimensions(boolean adjusttodisplaydimensions)

getCaretColor

public final Color getCaretColor()
Gets caret color. The caret is the rectangle that marks the current item.
Example:
	Color caretColor = vFmt.getCaretColor();

setCaretColor

public void setCaretColor(Color caretcolor)
Set the color for the caret. The caret is the rectangle that marks the current item.
Parameters:
caretcolor - as defined in java.awt.Color
Example:
	vFmt.setcaretColor(Color.blue);
See Also:
AgoViewFormat.getCaretColor()

getBackgroundColor

public final Color getBackgroundColor()
Get the Color object which describes the view's background color.
Example:
This example illustrates how to obtain the background Color of a view.
Color bgColor;
bgColor = viewFmt.getBackgroundColor();
See Also:
AgoViewFormat.setBackgroundColor(Color backgroundcolor)

setBackgroundColor

public void setBackgroundColor(Color backgroundcolor)
Set the background color of the view.
Parameters:
backgroundcolor - 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 view using one of the Color constants:
     viewFmt.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);
     viewFmt.setBackgroundColor(col);
See Also:
AgoViewFormat.getBackgroundColor()

getBackgroundImageSpec

public final String getBackgroundImageSpec()
Get the name of the file containing the background image specification.
Example:
	String imageFileName = vFmt.getBackgroundImageSpec();

setBackgroundImageSpec

public void setBackgroundImageSpec(String backgroundimagespec)
Set the background image specification for the view.
Parameters:
backgroundimagespec - the name of the file containing the image specification
See Also:
AgoViewFormat.getBackgroundImageSpec()

getHoverCaretChange

public final boolean getHoverCaretChange()
Get the property that specifies whether or not the caret changes when the cursor is just moved over a row without clicking on the row The caret is the rectangle that marks selected items.
Usage:

Returns true if hover change mode is on (the caret changes when the user moves the mouse over the column).

Example:
	boolean caretWillChange = vFmt.getHoverCaretChange();

setHoverCaretChange

public void setHoverCaretChange(boolean hovercaretchange)
Set the property that specifies whether or not the caret changes when the cursor is just moved over a row without clicking on the row The caret is the rectangle that marks selected items.
Parameters:
hovercaretchange - if set to true the caret changes when the user moves the mouse over the column
Example:
	vFmt.setHoverCaretChange(true);
See Also:
AgoViewFormat.getHoverCaretChange()

getNoCaret

public final boolean getNoCaret()
Get the value of the property which specifies that the caret is not to be displayed. The caret is the rectangle that marks the current item.
Usage:

Returns true if the caret is not being displayed.

Example:
	boolean caretBeingShown = ! vFmt.getNoCaret();

setNoCaret

public void setNoCaret(boolean nocaret)
Set the value of the property which specifies that the caret is not to be displayed. The caret is the rectangle that marks the current item.
Parameters:
nocaret - set to true to deactivate the caret
Example:
	vFmt.setNoCaret(false);
See Also:
AgoViewFormat.getNoCaret()

getTransparent

public final boolean getTransparent()
Get the transparent property.
Usage:

Returns true if the view is transparent.

Example:
	boolean isTransparent = vFmt.getTransparent();
See Also:
AgoViewFormat.setTransparent(boolean transparent)

setTransparent

public void setTransparent(boolean transparent)
Set the transparent property.
Parameters:
transparent - set to true to make the view transparent
Example:
	vFmt.setTransparent(true);
See Also:
AgoViewFormat.getTransparent()

getShowInitialSelection

public final boolean getShowInitialSelection()
Get the property which specifies whether a selected item is to be displayed when the view is initialized or not.
Usage:

Returns true if a selected item is to be displayed when the view is initialized.

Example:
	boolean willShowSelection = vFmt.getShowInitialSelection();
See Also:
AgoViewFormat.setShowInitialSelection(boolean showinitialselection)

setShowInitialSelection

public void setShowInitialSelection(boolean showinitialselection)
Set the property which specifies whether a selected item is to be displayed when the view is initialized or not.
Parameters:
showinitialselection - if set to true a selected item is displayed when the view is initialized
Example:
	vFmt.setShowInitialSelection(false);
See Also:
AgoViewFormat.setShowInitialSelection(boolean showinitialselection)

getInitiallyExpanded

public final boolean getInitiallyExpanded()
Get the property which specifies whether or not the view will be expanded when it is first made visible.
Usage:

Returns true if the view will be expanded when it is first made visible.

Example:
	boolean willBeVisible = vFmt.getInitiallyExpanded();
See Also:
AgoViewFormat.setInitiallyExpanded(boolean initiallyexpanded)

setInitiallyExpanded

public void setInitiallyExpanded(boolean initiallyexpanded)
Set the property which specifies whether or not the view will be expanded when it is first made visible.
Parameters:
initiallyexpanded -  
Example:
	vFmt.setInitiallyExpanded(false);
See Also:
AgoViewFormat.getInitiallyExpanded()

getAdjustToDisplayDimensions

public final boolean getAdjustToDisplayDimensions()
Get the state of the property that specifies that the view should automatically adjust to changes in the display dimensions
Example:
	boolean willAdjust = vFmt.getAdjustToDisplayDimensions();
See Also:
AgoViewFormat.setAdjustToDisplayDimensions(boolean adjusttodisplaydimensions)

setAdjustToDisplayDimensions

public void setAdjustToDisplayDimensions(boolean adjusttodisplaydimensions)
Set the state of the property that specifies that the view should automatically adjust to changes in the display dimensions
Parameters:
adjusttodisplaydimensions - set to true to activate the property
Example:
	vFmt.setAdjustToDisplayDimensions(true);
See Also:
AgoViewFormat.getAdjustToDisplayDimensions()

getResizable

public final boolean getResizable()
Get property which determines whether the view is resizable or not.
Usage:

Returns true if view is resizable. This applies to all bands, unless overridden at the band level.

Example:
	boolean isResizable = vFmt.getResizable();

setResizable

public void setResizable(boolean resizable)
Sets the resizable property.
Parameters:
resizable - set to true to make the view resizable by the user
Example:
	vFmt.setResizable(true);
See Also:
AgoViewFormat.getResizable()

getBandCount

public final int getBandCount()
Return the number of bands in the view.
Usage:

The header band does not count as one of the bands.

Example:
	int bandCount = vFmt.getBandCount();

getBandFormat

public final AgoBandFormatBase getBandFormat(int bandIndex)
Return the band format specified by the index 0..nBands-1.
Parameters:
bandindex - the band index
Usage:

The header band does not count as one of the bands. To get the header band format, use getHeaderBandFormat

Example:
	// get the band format from the first band in the view (excluding the header band)
	AgoBandFormat bFmt = (AgoBandFormat)vFmt.getBandFormat(0);
See Also:
AgoViewFormat.getHeaderBandFormat()

getBandFormat

public final AgoBandFormatBase getBandFormat(String bandName)
Return the band format specified by the name.
Parameters:
bandName - the name of the band
Usage:

The header band does not count as one of the bands. To get the header band format, use getHeaderBandFormat

Example:
	// get the band format from the band called "CustomerBand"
	AgoBandFormat bFmt = (AgoBandFormat)vFmt.getBandFormat("CustomerBand");
See Also:
AgoViewFormat.getHeaderBandFormat()

appendBandFormat

public void appendBandFormat(AgoBandFormatBase bandformat)
Appends a band format.
Parameters:
bandformat - the AgoBandFormat object to be added
Usage:
If the band format has a name that is the same as an existing band format, the existing band format will be removed before the new band format is added. If the band format doesn't have a name, we assign the name Unnamedxxx
Example:
	AgoBandFormat bFmt = new AgoBandFormat("customerBand");
	vFmt.appendBandFormat(bFmt);

removeBandFormat

public void removeBandFormat(AgoBandFormatBase bandformat)
Removes a band format.
Parameters:
bandformat - the band format object to remove
Example:
	// remove the first band format (excluding the header band)
	AgoBandFormat bFmt = bandFmt.getBandFormat(0);
	vFmt.removeBandFormat(bFmt);

getHeaderBandFormat

public AgoBandFormatBase getHeaderBandFormat()
Get the header band format.
Example:
	AgoBandFormat hdrBand = (AgoBandFormat)vFmt.getHeaderBandFormat();
See Also:
AgoViewFormat.getBandFormat(int bandIndex), AgoViewFormat.setHeaderBandFormat(AgoBandFormatBase headerbandformat), AgoBandFormatBase

setHeaderBandFormat

public void setHeaderBandFormat(AgoBandFormatBase headerbandformat)
Sets the header band format.
Parameters:
headerbandformat - the AgoBandFormat object specifying the header band
Example:
	AgoBandFormat bFmt = new AgoBandFormat("Customerheader");
	vFmt.setHeaderBandFormat(bFmt);
See Also:
AgoViewFormat.getHeaderBandFormat(), AgoBandFormatBase

SilverStream
Application Server 3.5