|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display2d.DataRaster
public class DataRaster
DataRaster maps (x,y) data onto an image. The image has the same size as the data panel. Every data point renders itself as one pixel.
Field Summary | |
---|---|
protected int |
alpha
|
protected java.awt.image.BufferedImage |
image
|
protected int |
maxPoints
|
DrawingPanel |
primaryDrawingPanel
The drawing panel that determines the image size. |
protected double |
xmax
|
protected double |
xmin
|
protected double |
ymax
|
protected double |
ymin
|
Constructor Summary | |
---|---|
DataRaster(DrawingPanel dp,
double _xmin,
double _xmax,
double _ymin,
double _ymax)
Constructs a DataRaster object that maps (x,y) data to image pixels. |
Method Summary | |
---|---|
void |
append(int dataIndex,
double x,
double y)
Appends an (x,y) datum to the image. |
protected org.opensourcephysics.display2d.DataRaster.ImageData |
checkIndex(int dataIndex)
Ensures that the image data exists |
void |
clear()
Clears all data from all Datasets. |
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draw the image containing the dataset pixels. |
java.awt.Color |
getBackgroundColor()
|
double |
getHeight()
|
java.awt.Color |
getPixColor(int xpix,
int ypix)
|
double |
getWidth()
|
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 |
isMeasured()
Determines if information is available to set min/max values. |
java.awt.image.BufferedImage |
render()
Paints a new image using the existing data. |
void |
setColor(int dataIndex,
java.awt.Color color)
Sets the data point marker color. |
void |
setMinMax(double _minx,
double _maxx,
double _miny,
double _maxy)
|
void |
setVisible(boolean isVisible)
Sets the visibility of the DataRaster. |
void |
setXMax(double _value)
|
void |
setXMin(double _value)
|
void |
setYMax(double _value)
|
void |
setYMin(double _value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public DrawingPanel primaryDrawingPanel
protected double xmin
protected double xmax
protected double ymin
protected double ymax
protected int alpha
protected java.awt.image.BufferedImage image
protected int maxPoints
Constructor Detail |
---|
public DataRaster(DrawingPanel dp, double _xmin, double _xmax, double _ymin, double _ymax)
dp
- the drawing panel that will be used to calculate the image size_xmin
- the mininum x value that can be mapped_xmax
- the maximum x value that can be mapped_ymin
- the mininum y value that can be mapped_ymax
- the maximum y value that can be mappedMethod Detail |
---|
public void append(int dataIndex, double x, double y)
x
- y
- dataIndex
- Description of Parameterpublic void setColor(int dataIndex, java.awt.Color color)
dataIndex
- color
- public void clear()
protected org.opensourcephysics.display2d.DataRaster.ImageData checkIndex(int dataIndex)
dataIndex
- public java.awt.image.BufferedImage render()
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
panel
- the panel containing this data rasterg
- the graphics context upon which to drawpublic boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public void setXMin(double _value)
public void setXMax(double _value)
public void setYMin(double _value)
public void setYMax(double _value)
public void setMinMax(double _minx, double _maxx, double _miny, double _maxy)
public double getXMin()
Measurable
getXMin
in interface Measurable
public double getXMax()
Measurable
getXMax
in interface Measurable
public double getYMin()
Measurable
getYMin
in interface Measurable
public double getYMax()
Measurable
getYMax
in interface Measurable
public double getWidth()
public double getHeight()
public java.awt.Color getBackgroundColor()
public java.awt.Color getPixColor(int xpix, int ypix)
public void setVisible(boolean isVisible)
isVisible
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |