tapestry.support.swing
Class TImage

java.lang.Object
  |
  +--tapestry.support.swing.TAnimator
        |
        +--tapestry.support.swing.TDrawable
              |
              +--tapestry.support.swing.TImage

public class TImage
extends TDrawable

A class that is an image defined by a center location (x, y) and dimension (w x h). Images are specified using a WWW URL. Images can be in GIF or JPEG formats.

Coordinates for an image are as you would expect from cartesian geometry. (0,0) represents the center of container in which the image is drawn, with x-coordinates increasing to the right and y-coordinates increasing to the top of the container. Coordinates are given in pixel units.


Fields inherited from class tapestry.support.swing.TAnimator
DEFAULT_DELAY
 
Constructor Summary
TImage(int cx, int cy, java.lang.String url)
          Creates a new TImage centered at position (cx, cy) with specified image from specified URL.
TImage(java.awt.Point center, java.lang.String url)
          Creates a new TImage centered at specified point with specified text.
 
Method Summary
 void drawFeature(java.awt.Graphics g, boolean isFilled)
           
 java.awt.Image getImage()
          Returns the shape's image.
 java.awt.Dimension getSize()
          Returns the shape's size.
 void setImage(java.lang.String url)
          Sets the shape's image to new image from specified url.
 void setSize(int width, int height)
          Sets the image's size.
 
Methods inherited from class tapestry.support.swing.TDrawable
act, draw, fill, getCenter, getColor, hide, move, outline, setCenter, setCenter, setColor, setContainer, setLineWidth, show
 
Methods inherited from class tapestry.support.swing.TAnimator
actionPerformed, dispose, getContainer, getCount, getDelay, init, isRunning, setDelay, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TImage

public TImage(int cx,
              int cy,
              java.lang.String url)
Creates a new TImage centered at position (cx, cy) with specified image from specified URL.
Parameters:
cx - center x coordinate of text
cy - center y coordinate of text
url - url of image to display

TImage

public TImage(java.awt.Point center,
              java.lang.String url)
Creates a new TImage centered at specified point with specified text.
Parameters:
center - center point of box
url - url of image to display
Method Detail

getSize

public java.awt.Dimension getSize()
Returns the shape's size.
Returns:
width and height of shape
Overrides:
getSize in class TDrawable

setSize

public void setSize(int width,
                    int height)
Sets the image's size.
Parameters:
width - new width of shape
height - new height of shape
Overrides:
setSize in class TDrawable

getImage

public java.awt.Image getImage()
Returns the shape's image.
Returns:
image of shape

setImage

public void setImage(java.lang.String url)
Sets the shape's image to new image from specified url.
Parameters:
url - url of image to display

drawFeature

public void drawFeature(java.awt.Graphics g,
                        boolean isFilled)
Overrides:
drawFeature in class TDrawable