org.opensourcephysics.media.core
Interface InteractiveImage

All Superinterfaces:
Drawable, DrawableImage, Interactive, Measurable
All Known Subinterfaces:
Video
All Known Implementing Classes:
GifVideo, ImageVideo, VideoAdapter

public interface InteractiveImage
extends Interactive, DrawableImage

This defines methods used by interactive drawable images.

Version:
1.0
Author:
Douglas Brown

Method Summary
 double getAngle()
          Gets the angle in radians of the image base measured ccw from the world x-axis.
 ImageCoordSystem getCoords()
          Gets the image coordinate system.
 double getHeight()
          Gets the height of the image in world units.
 double getRelativeAspect()
          Gets the relative aspect of the displayed image.
 double getWidth()
          Gets the width of the image in world units.
 void setAngle(double theta)
          Sets the angle in radians of the image base measured ccw from the world x-axis.
 void setCoords(ImageCoordSystem coords)
          Sets the image coordinate system.
 void setHeight(double height)
          Sets the height of the image in world units.
 void setRelativeAspect(double relativeAspect)
          Sets the relative aspect of the displayed image.
 void setWidth(double width)
          Sets the width of the image in world units.
 
Methods inherited from interface org.opensourcephysics.display.Interactive
findInteractive, getX, getY, isEnabled, setEnabled, setX, setXY, setY
 
Methods inherited from interface org.opensourcephysics.display.Measurable
getXMax, getXMin, getYMax, getYMin, isMeasured
 
Methods inherited from interface org.opensourcephysics.display.Drawable
draw
 
Methods inherited from interface org.opensourcephysics.media.core.DrawableImage
getFilterStack, getImage, getProperty, getPropertyNames, isVisible, setFilterStack, setProperty, setVisible
 

Method Detail

setRelativeAspect

void setRelativeAspect(double relativeAspect)
Sets the relative aspect of the displayed image. The pixel aspect of an image is the ratio of its pixel width to height. Its world aspect is the ratio of width to height in world units. For example, a 320 x 240 pixel image has a pixel aspect of 4/3. If its relative aspect is set to 2, then the world aspect of the image will be 8/3. This means that if the image width is set to 16, its height will be 6. Conversely, if its height is set to 10, its width will be 8/3 x 10 = 26.666.

Parameters:
relativeAspect - the world aspect of the image relative to its pixel aspect.

getRelativeAspect

double getRelativeAspect()
Gets the relative aspect of the displayed image.

Returns:
the relative aspect of the displayed image
See Also:
setRelativeAspect(double)

setWidth

void setWidth(double width)
Sets the width of the image in world units. This method also sets the height using the relative aspect.

Parameters:
width - the width in world units
See Also:
setRelativeAspect(double)

getWidth

double getWidth()
Gets the width of the image in world units.

Returns:
the width of the image

setHeight

void setHeight(double height)
Sets the height of the image in world units. This method also sets the width using the relative aspect.

Parameters:
height - the height in world units
See Also:
setRelativeAspect(double)

getHeight

double getHeight()
Gets the height of the image in world units.

Returns:
the height of the image

setAngle

void setAngle(double theta)
Sets the angle in radians of the image base measured ccw from the world x-axis.

Parameters:
theta - the angle in radians

getAngle

double getAngle()
Gets the angle in radians of the image base measured ccw from the world x-axis.

Returns:
the angle in radians

getCoords

ImageCoordSystem getCoords()
Gets the image coordinate system.

Returns:
the image coordinate system

setCoords

void setCoords(ImageCoordSystem coords)
Sets the image coordinate system.

Parameters:
coords - the image coordinate system