Class MeasuredImage

java.lang.Object
org.opensourcephysics.display.MeasuredImage
All Implemented Interfaces:
Drawable, Measurable
Direct Known Subclasses:
BinaryLattice, ByteRaster, CellLatticePC, ComplexGridPlot, ComplexInterpolatedPlot, GrayscalePlot, GridPlot, IntegerRaster, InterpolatedPlot

public class MeasuredImage extends Object implements Measurable
MeasuredImage contains an image and a scale in world units. When a MeasuredImage is added to a drawing panel, the image will scale itself to the panel's world units.
Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • image

      protected BufferedImage image
    • xmin

      protected double xmin
    • xmax

      protected double xmax
    • ymin

      protected double ymin
    • ymax

      protected double ymax
    • visible

      protected boolean visible
    • minmax

      protected double[] minmax
  • Constructor Details

    • MeasuredImage

      public MeasuredImage()
      Constructs a MeasuredImage with a pixel scale.
    • MeasuredImage

      public MeasuredImage(BufferedImage image)
      Constructs a MeasuredImage with a pixel scale.
      Parameters:
      image - the image
    • MeasuredImage

      public MeasuredImage(BufferedImage _image, double _xmin, double _xmax, double _ymin, double _ymax)
      Constructs a MeasuredImage with the given scale.
      Parameters:
      _image -
      _xmin -
      _xmax -
      _ymin -
      _ymax -
  • Method Details

    • setImage

      public void setImage(BufferedImage _image)
    • getImage

      public BufferedImage getImage()
    • setVisible

      public void setVisible(boolean isVisible)
      Sets the visibility of the lattice. Drawing will be disabled if visible is false.
      Parameters:
      isVisible -
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the image on the panel.
      Specified by:
      draw in interface Drawable
      Parameters:
      panel -
      g -
    • isMeasured

      public boolean isMeasured()
      Description copied from interface: Measurable
      Determines if information is available to set min/max values. Objects that store data should return false if data is null.
      Specified by:
      isMeasured in interface Measurable
      Returns:
      true if min/max values are valid
    • getXMin

      public double getXMin()
      Description copied from interface: Measurable
      Gets the minimum x needed to draw this object.
      Specified by:
      getXMin in interface Measurable
      Returns:
      minimum
    • getXMax

      public double getXMax()
      Description copied from interface: Measurable
      Gets the maximum x needed to draw this object.
      Specified by:
      getXMax in interface Measurable
      Returns:
      maximum
    • getYMin

      public double getYMin()
      Description copied from interface: Measurable
      Gets the minimum y needed to draw this object.
      Specified by:
      getYMin in interface Measurable
      Returns:
      minimum
    • getYMax

      public double getYMax()
      Description copied from interface: Measurable
      Gets the maximum y needed to draw this object.
      Specified by:
      getYMax in interface Measurable
      Returns:
      minimum
    • setXMin

      public void setXMin(double _xmin)
    • setXMax

      public void setXMax(double _xmax)
    • setYMin

      public void setYMin(double _ymin)
    • setYMax

      public void setYMax(double _ymax)
    • setMinMax

      public void setMinMax(double _xmin, double _xmax, double _ymin, double _ymax)