Package org.opensourcephysics.display
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
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a MeasuredImage with a pixel scale.MeasuredImage
(BufferedImage image) Constructs a MeasuredImage with a pixel scale.MeasuredImage
(BufferedImage _image, double _xmin, double _xmax, double _ymin, double _ymax) Constructs a MeasuredImage with the given scale. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(DrawingPanel panel, Graphics g) Draws the image on the panel.getImage()
double
getXMax()
Gets the maximum x needed to draw this object.double
getXMin()
Gets the minimum x needed to draw this object.double
getYMax()
Gets the maximum y needed to draw this object.double
getYMin()
Gets the minimum y needed to draw this object.boolean
Determines if information is available to set min/max values.void
setImage
(BufferedImage _image) void
setMinMax
(double _xmin, double _xmax, double _ymin, double _ymax) void
setVisible
(boolean isVisible) Sets the visibility of the lattice.void
setXMax
(double _xmax) void
setXMin
(double _xmin) void
setYMax
(double _ymax) void
setYMin
(double _ymin) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Field Details
-
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
Constructs a MeasuredImage with a pixel scale.- Parameters:
image
- the image
-
MeasuredImage
Constructs a MeasuredImage with the given scale.- Parameters:
_image
-_xmin
-_xmax
-_ymin
-_ymax
-
-
-
Method Details
-
setImage
-
getImage
-
setVisible
public void setVisible(boolean isVisible) Sets the visibility of the lattice. Drawing will be disabled if visible is false.- Parameters:
isVisible
-
-
draw
Draws the image on the panel. -
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 interfaceMeasurable
- 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 interfaceMeasurable
- Returns:
- minimum
-
getXMax
public double getXMax()Description copied from interface:Measurable
Gets the maximum x needed to draw this object.- Specified by:
getXMax
in interfaceMeasurable
- Returns:
- maximum
-
getYMin
public double getYMin()Description copied from interface:Measurable
Gets the minimum y needed to draw this object.- Specified by:
getYMin
in interfaceMeasurable
- Returns:
- minimum
-
getYMax
public double getYMax()Description copied from interface:Measurable
Gets the maximum y needed to draw this object.- Specified by:
getYMax
in interfaceMeasurable
- 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)
-