SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoColumnImage

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoColumnBase
       |
       +--com.sssw.rt.tview.AgoColumnImage

public class AgoColumnImage
extends AgoColumnBase

AgoColumnImage is bound column type that you can use to display images from a database column or the Media store.


Constructor Summary
AgoColumnImage(int width, boolean visible, boolean transparent, Color backgroundColor, int borderType)
           
 
Method Summary
 boolean getAdjustWidthForContent()
          Returns the adjust width for content property.
 int getImageHeight()
          Returns the image height, in pixels.
 String getTitlePropertyName()
          Returns the name of the property that provides the text for the image title
 void setAdjustWidthForContent(boolean adjustwidthforcontent)
          Sets the property which causes the column to adjust its width according to its content
 void setCaretPropertyName(String caretpropertyname)
          Specifies the image to be used in this column when the column has the caret.
 void setImageHeight(int imageheight)
          Sets the image height in pixels.
 void setPropertyName(String propertyname)
          Sets the name of the image to display in this column, or name of the source database column.
 void setTitlePropertyName(String titlepropertyname)
          Sets the name of the property that will provide the text for the image title
 
Methods inherited from class com.sssw.rt.tview.AgoColumnBase
getAlignment, getBackgroundColor, getBorderType, getDisplayWidth, getHidden, getResizable, getSelectable, getTransparent, getVisible, getWidth, isWidthFixed, setAlignment, setBackgroundColor, setBorderType, setFixedWidth, setHidden, setProportionalWidth, setProportionalWidth, setResizable, setSelectable, setTransparent, setVisible, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoColumnImage

public AgoColumnImage(int width,
                      boolean visible,
                      boolean transparent,
                      Color backgroundColor,
                      int borderType)
Parameters:
width - column width, in pixels
visible - if set to true the image column is visible
transparent - if set to true the image column is transparent
Color - background color of image column
borderType - image column border type
Usage:

For the borderType parameter, see the AgoColumnBase.setBorderType() method.

Example:
	AgoColumnImage colImg = new AgoColumnImage(100,
                                               true,
                                               true,
                                               Color.white,
                                               AgoColumnBase.BORDER_3D);	
See Also:
AgoColumnBase.setBorderType(int borderType)
Method Detail

getImageHeight

public int getImageHeight()
Returns the image height, in pixels.
Example:
	int ht = colImg.getImageHeight();
See Also:
AgoColumnImage.setImageHeight(int imageheight)

setImageHeight

public void setImageHeight(int imageheight)
Sets the image height in pixels.
Parameters:
imageheight - the image height, in pixels
Example:
	colImg.setImageHeight(20);
See Also:
AgoColumnImage.getImageHeight()

getAdjustWidthForContent

public final boolean getAdjustWidthForContent()
Returns the adjust width for content property.
See Also:
AgoColumnImage.setAdjustWidthForContent(boolean adjustwidthforcontent)

setAdjustWidthForContent

public final void setAdjustWidthForContent(boolean adjustwidthforcontent)
Sets the property which causes the column to adjust its width according to its content
Parameters:
adjustwidthforcontent - set to true to make the width of the column adjust to the size of the image
Example:
	colImg.setAdjustWidthForContent(true);
See Also:
AgoColumnImage.getAdjustWidthForContent(), AgoColumnBase.getDisplayWidth()

getTitlePropertyName

public String getTitlePropertyName()
Returns the name of the property that provides the text for the image title
Example:
	String titlePropName = colImg.getTitlePropertyName();
See Also:
AgoColumnImage.setTitlePropertyName(String titlepropertyname)

setTitlePropertyName

public void setTitlePropertyName(String titlepropertyname)
Sets the name of the property that will provide the text for the image title
Parameters:
titlepropertyname - the image title name
Example:
	// set the property from which the image
	// title is to be retrieved -
	// in this case, the property "ImageTitle"
	// should have as its value the image title
	colImg.setTitlePropertyName("ImageTitle");
See Also:
AgoColumnImage.getTitlePropertyName()

setPropertyName

public void setPropertyName(String propertyname)
Sets the name of the image to display in this column, or name of the source database column.
Parameters:
propertyname - name of the image file or the database column
For an image stored in a database column, specify the column name
For an image stored in the media store, specify "databasename:imagefilename"
Usage:
If the image is stored in a database column, then this specifies the column name (as specified in the Property Inspector of the AgcData). If the image is stored in the media store, then this specifies the name of the image file.
Example:
This fragment shows how to display an image from a database column called ItemImage.
     colImg.setPropertyName("Image");
This fragment shows how to display an image from the media store.
     colImg.setPropertyName("SilverMaster35:aglogo.gif");

setCaretPropertyName

public void setCaretPropertyName(String caretpropertyname)
Specifies the image to be used in this column when the column has the caret. The caret is the rectangle that marks the current item.
Parameters:
caretpropertyname - name of the image file (in the media store) or the database column to use when this column has the caret
Usage:
If the image is stored in a database column, then this specifies the column name (as specified in the Property Inspector of the AgcData). If the image is stored in the media store, then this specifies the name of the image file.
Example:
This example shows how to load the image from a database column:
	colImg.setCaretPropertyName("CaretImage");
This fragment shows how to display an image from the media store.
     colImg.setCaretPropertyName("SilverMaster35:aglogo.gif");
See Also:
AgoViewFormat

SilverStream
Application Server 3.5