org.formaria.swt
Class Image

java.lang.Object
  extended by Canvas
      extended by org.formaria.swt.Image
All Implemented Interfaces:
ImageHolder
Direct Known Subclasses:
HotspotImage

public class Image
extends Canvas
implements ImageHolder

Draws an image

Copyright (c) Formaria Ltd., 2008

License: see license.txt $Revision: 2.18 $


Field Summary
protected  Project currentProject
          The current project
 
Constructor Summary
Image(java.lang.Object parent)
          Create a new image
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception
 boolean getAlignment()
           
 java.lang.String getImageName()
          Gets the name of the image being displayed.
 java.lang.String getToolTip()
          Get the tooltip text
 boolean isFull()
           
 boolean isScale()
           
protected  void paint(GC gc)
          Renders the component
 void setAlignment(boolean alignment)
           
 void setBg(java.lang.String clrStr)
          Set the background color
 void setFull(boolean full)
           
 void setImage(java.awt.Image img)
          Sets the image to display.
 void setImageName(java.lang.String name)
          Sets the name of the image being displayed.
 void setScale(boolean scale)
           
 void setToolTip(java.lang.String text)
          Set the tooltip text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentProject

protected Project currentProject
The current project

Constructor Detail

Image

public Image(java.lang.Object parent)
Create a new image

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception


setImage

public void setImage(java.awt.Image img)
Sets the image to display.

Specified by:
setImage in interface ImageHolder
Parameters:
img - the image

setToolTip

public void setToolTip(java.lang.String text)
Set the tooltip text

Parameters:
text - the new text

getToolTip

public java.lang.String getToolTip()
Get the tooltip text

Returns:
the existing text if any

setBg

public void setBg(java.lang.String clrStr)
Set the background color

Parameters:
clrStr - the new color string (hex)

paint

protected void paint(GC gc)
Renders the component

Parameters:
g - the graphics context

setImageName

public void setImageName(java.lang.String name)
Sets the name of the image being displayed.

Specified by:
setImageName in interface ImageHolder
Parameters:
name - the image name

getImageName

public java.lang.String getImageName()
Gets the name of the image being displayed.

Specified by:
getImageName in interface ImageHolder
Returns:
the image name

isScale

public boolean isScale()

setScale

public void setScale(boolean scale)

getAlignment

public boolean getAlignment()

setAlignment

public void setAlignment(boolean alignment)

isFull

public boolean isFull()

setFull

public void setFull(boolean full)