org.pscode.xui.image.bean
Class ImageCaption

java.lang.Object
  extended by org.pscode.xui.image.bean.ImageCaption
All Implemented Interfaces:
Comparable

public class ImageCaption
extends Object
implements Comparable

JavaBean used to store caption description. Designed for use with the J2SE XMLEncoder/Decoder.

Version:
2010-01-20
Author:
Andrew Thompson

Field Summary
 Color backgroundColor
          The background color to display behind this caption.
 Color captionColor
          The color of the text of this caption.
 String captionText
          The text or caption to display.
 Point connectTo
          Insert arrow pointing to this location on the imageSize.
 String fontFamily
          Font family to use for rendering this caption.
 int fontSize
           
 Point location
          Upper left corner of title.
 int width
          The width of the text.
 
Constructor Summary
ImageCaption()
           
 
Method Summary
 int compareTo(Object object)
          Compares in order the - location x/y - connectTo x/y - text and returns the comparison of the first that is not equal.
 Color getBackgroundColor()
           
 Rectangle getBoundsOfCaption(Dimension imageSize)
          Provides a rectangle encapsulating the title for the given image size.
 Color getCaptionColor()
           
 String getCaptionText()
           
 Point getConnectTo()
           
 String getFontFamily()
           
 int getFontSize()
           
 String getHtmlString()
           
 Point getLocation()
           
 int getWidth()
           
 void setBackgroundColor(Color backgroundColor)
           
 void setCaptionColor(Color captionColor)
           
 void setCaptionText(String captionText)
           
 void setConnectTo(Point connectTo)
           
 void setFontFamily(String fontFamily)
           
 void setFontSize(int fontSize)
           
 void setLocation(Point location)
           
 void setWidth(int width)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

captionText

public String captionText
The text or caption to display.


fontFamily

public String fontFamily
Font family to use for rendering this caption. This is used as the default font - styles used in the HTML might override it.


captionColor

public Color captionColor
The color of the text of this caption.


backgroundColor

public Color backgroundColor
The background color to display behind this caption. Can be 'null' for no backgrountitleSize. If not null, will support partial transparency in the color.


width

public int width
The width of the text. Height is determined by the number of lines needed to render the text, given the text and width.


location

public Point location
Upper left corner of title.


connectTo

public Point connectTo
Insert arrow pointing to this location on the imageSize.


fontSize

public int fontSize
Constructor Detail

ImageCaption

public ImageCaption()
Method Detail

getFontSize

public int getFontSize()

setFontSize

public void setFontSize(int fontSize)

setCaptionText

public void setCaptionText(String captionText)

getCaptionText

public String getCaptionText()

setWidth

public void setWidth(int width)

getWidth

public int getWidth()

setFontFamily

public void setFontFamily(String fontFamily)

getFontFamily

public String getFontFamily()

setCaptionColor

public void setCaptionColor(Color captionColor)

getCaptionColor

public Color getCaptionColor()

setBackgroundColor

public void setBackgroundColor(Color backgroundColor)

getBackgroundColor

public Color getBackgroundColor()

setLocation

public void setLocation(Point location)

getLocation

public Point getLocation()

setConnectTo

public void setConnectTo(Point connectTo)

getConnectTo

public Point getConnectTo()

getBoundsOfCaption

public Rectangle getBoundsOfCaption(Dimension imageSize)
Provides a rectangle encapsulating the title for the given image size. It is necessary to have the image size to calculate location constraints < 1 (center & indent from right/bottom).


getHtmlString

public String getHtmlString()

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object object)
Compares in order the - location x/y - connectTo x/y - text and returns the comparison of the first that is not equal. If all else fails, returns '0' to mean equal.

Specified by:
compareTo in interface Comparable