com.liquidatom.derbyscore.theme
Class ImageElement

java.lang.Object
  extended by com.liquidatom.derbyscore.theme.ThemeElement
      extended by com.liquidatom.derbyscore.theme.ImageElement

@ThreadSafe
@Immutable
public class ImageElement
extends ThemeElement

Represents an image element within the theme.

Author:
Russell Francis (russ@metro-six.com)

Constructor Summary
ImageElement(Theme theme, java.lang.String conditionJs, java.awt.Rectangle position, java.lang.String imgRef)
          Construct a new ImageElement used to conditionally render an image as part of the theme.
 
Method Summary
 java.lang.String getImgRef()
          Get the unique label used to identify the image that this element will render.
 java.awt.Rectangle getPosition()
          Get a Rectangle describing the bounds which this image will be rendered into.
 
Methods inherited from class com.liquidatom.derbyscore.theme.ThemeElement
getTheme, getVisibleConditionScript, isVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageElement

public ImageElement(Theme theme,
                    java.lang.String conditionJs,
                    java.awt.Rectangle position,
                    java.lang.String imgRef)
Construct a new ImageElement used to conditionally render an image as part of the theme.

Parameters:
theme - The theme which this element belongs too.
conditionJs - A snippet of javascript code which if non-null will be evaluated to determine if the image should be rendered. The javascript has access to the current Bout instance.
position - An optional rectangle which defines the confines into which the image should be scaled and rendered. If this has 0 width the width of the image will be used. If this has 0 height, the height of the image will be used. If this is null the width and height will be taken from the referenced image.
imgRef - The unique label for the image which we wish to render.
Method Detail

getImgRef

public java.lang.String getImgRef()
Get the unique label used to identify the image that this element will render.

Returns:
The unique label used to identify the image that this element will render.

getPosition

public java.awt.Rectangle getPosition()
Get a Rectangle describing the bounds which this image will be rendered into.

Specified by:
getPosition in class ThemeElement
Returns:
A Rectangle describing the bounds which this image will be rendered into.