Class ElementImage

java.lang.Object
org.opensourcephysics.display3d.simple3d.Element
org.opensourcephysics.display3d.simple3d.ElementImage
All Implemented Interfaces:
Element, ElementImage, InteractionSource

public class ElementImage extends Element implements ElementImage

Title: ElementImage

Description: An image using the painter's algorithm

Version:
March 2005
Author:
Francisco Esquembre
  • Constructor Details

    • ElementImage

      public ElementImage()
  • Method Details

    • setImageFile

      public void setImageFile(String file)
      Description copied from interface: ElementImage
      Sets the image file to be displayed
      Specified by:
      setImageFile in interface ElementImage
    • getImageFile

      public String getImageFile()
      Description copied from interface: ElementImage
      Gets the image displayed
      Specified by:
      getImageFile in interface ElementImage
    • setImage

      public void setImage(Image image)
      Description copied from interface: ElementImage
      Sets the image to be displayed
      Specified by:
      setImage in interface ElementImage
      Parameters:
      image - java.awt.Image
    • setRotationAngle

      public void setRotationAngle(double angle)
      Description copied from interface: ElementImage
      Sets the rotation angle for the image. Default is 0.
      Specified by:
      setRotationAngle in interface ElementImage
      Parameters:
      angle - the rotation angle
    • getRotationAngle

      public double getRotationAngle()
      Description copied from interface: ElementImage
      Gets the rotation angle for the image
      Specified by:
      getRotationAngle in interface ElementImage
    • getTargetHit

      protected InteractionTarget getTargetHit(int x, int y)
      Description copied from class: Element
      Gets the target that is under the (x,y) position of the screen
      Overrides:
      getTargetHit in class Element
      Parameters:
      x - int
      y - int
      Returns:
      InteractionTarget
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load object data.
      Returns:
      the XML.ObjectLoader