|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display.MeasuredImage org.opensourcephysics.display2d.GridPlot
public class GridPlot
GridPlot plots a scalar field by coloring pixels using a buffered image. The buffered image is scaled before it is copied to a drawing panel.
Field Summary |
---|
Fields inherited from class org.opensourcephysics.display.MeasuredImage |
---|
image, visible, xmax, xmin, ymax, ymin |
Fields inherited from interface org.opensourcephysics.display2d.Plot2D |
---|
CONTOUR_PLOT, GRID_PLOT, INTERPOLATED_PLOT, SURFACE_PLOT |
Constructor Summary | |
---|---|
GridPlot()
Constructs a GridPlot without any data. |
|
GridPlot(GridData griddata)
Constructs the GridPlot using the given griddata. |
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the image and the grid. |
double |
getCeiling()
Gets the ceiling for scaling the z data. |
double |
getFloor()
Gets the floor for scaling the z data. |
GridData |
getGridData()
Gets the GridData object. |
static XML.ObjectLoader |
getLoader()
Gets an XML.ObjectLoader to save and load data for this program. |
double |
indexToX(int i)
Gets the x coordinate for the given index. |
double |
indexToY(int i)
Gets the y coordinate for the given index. |
boolean |
isAutoscaleZ()
Gets the autoscale flag for z. |
protected void |
recolorImage()
Recolors the image pixels using the data array. |
void |
setAll(java.lang.Object obj)
Sets the data to new values. |
void |
setAll(java.lang.Object obj,
double xmin,
double xmax,
double ymin,
double ymax)
Sets the values and the scale. |
void |
setAutoscaleZ(boolean isAutoscale,
double floor,
double ceil)
Sets the autoscale flag and the floor and ceiling values for the colors. |
void |
setColorPalette(java.awt.Color[] colors)
Sets the colors that will be used between the floor and ceiling values. |
void |
setExpandedZ(boolean expanded,
double expansionFactor)
Expands the z scale so as to enhance values close to zero. |
void |
setFloorCeilColor(java.awt.Color floorColor,
java.awt.Color ceilColor)
Sets the floor and ceiling colors. |
void |
setGridData(GridData _griddata)
Sets the data storage to the given value. |
void |
setGridLineColor(java.awt.Color c)
Sets the color for grid line boundaries |
void |
setIndexes(int[] indexes)
Sets the indexes for the data component that will be plotted. |
void |
setPaletteType(int type)
Determines the palette type that will be used. |
void |
setShowGridLines(boolean showGrid)
Outlines the data grid's boundaries. |
javax.swing.JFrame |
showLegend()
Shows how values map to colors. |
void |
update()
Updates this object's state using new data values. |
int |
xToIndex(double x)
Gets closest index from the given x world coordinate. |
int |
yToIndex(double y)
Gets closest index from the given y world coordinate. |
Methods inherited from class org.opensourcephysics.display.MeasuredImage |
---|
getXMax, getXMin, getYMax, getYMin, isMeasured, setImage, setMinMax, setVisible, setXMax, setXMin, setYMax, setYMin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opensourcephysics.display2d.Plot2D |
---|
setVisible |
Methods inherited from interface org.opensourcephysics.display.Measurable |
---|
getXMax, getXMin, getYMax, getYMin, isMeasured |
Constructor Detail |
---|
public GridPlot(GridData griddata)
griddata
- the point datapublic GridPlot()
Method Detail |
---|
public void setIndexes(int[] indexes)
setIndexes
in interface Plot2D
indexes
- the sample-componentpublic GridData getGridData()
getGridData
in interface Plot2D
public void setGridData(GridData _griddata)
setGridData
in interface Plot2D
_griddata
- new data storagepublic double indexToX(int i)
indexToX
in interface Plot2D
i
- int
public double indexToY(int i)
indexToY
in interface Plot2D
i
- int
public int xToIndex(double x)
xToIndex
in interface Plot2D
x
- double the coordinate
public int yToIndex(double y)
yToIndex
in interface Plot2D
y
- double the coordinate
public void setAll(java.lang.Object obj)
setAll
in interface Plot2D
obj
- public void setAll(java.lang.Object obj, double xmin, double xmax, double ymin, double ymax)
setAll
in interface Plot2D
obj
- array of new valuesxmin
- doublexmax
- doubleymin
- doubleymax
- doublepublic javax.swing.JFrame showLegend()
showLegend
in interface Plot2D
public void setAutoscaleZ(boolean isAutoscale, double floor, double ceil)
setAutoscaleZ
in interface Plot2D
isAutoscale
- floor
- ceil
- public boolean isAutoscaleZ()
isAutoscaleZ
in interface Plot2D
public double getFloor()
getFloor
in interface Plot2D
public double getCeiling()
getCeiling
in interface Plot2D
public void setPaletteType(int type)
setPaletteType
in interface Plot2D
type
- public void setColorPalette(java.awt.Color[] colors)
setColorPalette
in interface Plot2D
colors
- public void setFloorCeilColor(java.awt.Color floorColor, java.awt.Color ceilColor)
setFloorCeilColor
in interface Plot2D
floorColor
- ceilColor
- public void setShowGridLines(boolean showGrid)
setShowGridLines
in interface Plot2D
showGrid
- public void setGridLineColor(java.awt.Color c)
setGridLineColor
in interface Plot2D
c
- public void setExpandedZ(boolean expanded, double expansionFactor)
setExpandedZ
in interface Plot2D
expanded
- booleanexpansionFactor
- doublepublic void update()
update
in interface Plot2D
protected void recolorImage()
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
draw
in class MeasuredImage
panel
- g
- public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |