visad.bom.annotations
Class ImageJ3D

java.lang.Object
  extended by visad.bom.annotations.ImageJ3D
All Implemented Interfaces:
ScreenAnnotation

public class ImageJ3D
extends Object
implements ScreenAnnotation

Meant to encapsulate information representing an Image which is going to be rendered on a VisAD display without being subject to the usual VisAD transformations. Thus the Image should stick in Screen Coordinates.


Field Summary
static int BOTTOM_LEFT
          Image bottom left positioned on x, y
static int BOTTOM_RIGHT
          Image bottom right positioned on x, y
static int CENTER
          Image centre positioned on x, y
static int TOP_LEFT
          Image top left positioned on x, y
static int TOP_RIGHT
          Image top right positioned on x, y
 
Constructor Summary
ImageJ3D(Image image, int position, int x, int y, double zValue, double scaleFactor)
          Constructs a ImageJ3D from specified values in screen coordinates.
ImageJ3D(String filename, int position, int x, int y, double zValue, double scaleFactor)
          Constructs a ImageJ3D from specified values in screen coordinates.
 
Method Summary
 void setImage(Image image)
          Set the Image for this object.
 void setImageJ3Ds(int x, int y)
          Set coordinates for the ImageJ3D.
 void setPosition(int position)
          Set the relative position for this object.
 void setScaleFactor(double scaleFactor)
          Set the amount to magnify the image.
 void setZValue(double zValue)
           
 Object toDrawable(DisplayImpl display)
          Make the Object into a Shape3D.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_LEFT

public static final int TOP_LEFT
Image top left positioned on x, y

See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
Image top right positioned on x, y

See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
Image bottom right positioned on x, y

See Also:
Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT
Image bottom left positioned on x, y

See Also:
Constant Field Values

CENTER

public static final int CENTER
Image centre positioned on x, y

See Also:
Constant Field Values
Constructor Detail

ImageJ3D

public ImageJ3D(String filename,
                int position,
                int x,
                int y,
                double zValue,
                double scaleFactor)
         throws VisADException
Constructs a ImageJ3D from specified values in screen coordinates.

Parameters:
filename - of a valid GIF, JPEG or PNG file.
position - how to place the image relative to (x, y); one of Image.TOP_LEFT (default), Image.TOP_RIGHT, Image.BOTTOM_RIGHT, Image.BOTTOM_LEFT, Image.CENTER
x - x screen coordinate of image location.
y - y screen coordinate of image location.
zValue - Virtual world value; larger z is in front.
scaleFactor - scale factor for image magnification; greater than 0.0.
Throws:
VisADException - if the Image is bad.

ImageJ3D

public ImageJ3D(Image image,
                int position,
                int x,
                int y,
                double zValue,
                double scaleFactor)
         throws VisADException
Constructs a ImageJ3D from specified values in screen coordinates.

Parameters:
image - base java.awt.Image object to represent.
position - how to place the image relative to (x, y); one of Image.TOP_LEFT (default), Image.TOP_RIGHT, Image.BOTTOM_RIGHT, Image.BOTTOM_LEFT, Image.CENTER
x - x screen coordinate of image location.
y - y screen coordinate of image location.
zValue - Virtual world value; larger z is in front.
scaleFactor - scale factor for image magnification; greater than 0.0.
Throws:
VisADException - if the Image is bad.
Method Detail

setImage

public void setImage(Image image)
              throws VisADException
Set the Image for this object.

Parameters:
image - base java.awt.Image object to represent.
Throws:
VisADException - if the Image is bad.

setPosition

public void setPosition(int position)
Set the relative position for this object.

Parameters:
position - how to place the image relative to (x, y); one of Image.TOP_LEFT (default), Image.TOP_RIGHT, Image.BOTTOM_RIGHT, Image.BOTTOM_LEFT, Image.CENTER

setScaleFactor

public void setScaleFactor(double scaleFactor)
Set the amount to magnify the image.

Parameters:
scaleFactor - scale factor for image magnification; greater than 0.0.

setImageJ3Ds

public void setImageJ3Ds(int x,
                         int y)
Set coordinates for the ImageJ3D.

Parameters:
x - x screen coordinate of image location.
y - y screen coordinate of image location.

setZValue

public void setZValue(double zValue)
Parameters:
zValue - Virtual world value; larger z is in front.

toDrawable

public Object toDrawable(DisplayImpl display)
                  throws VisADException
Description copied from interface: ScreenAnnotation
Make the Object into a Shape3D.

Specified by:
toDrawable in interface ScreenAnnotation
Parameters:
display - the VisAD display for this Image.
Returns:
the Image description as a Shape3D object.
Throws:
VisADException - if there is a VisAD problem.