|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display2d.ContourPlot
public class ContourPlot
ContourPlot draws a contour plot of a scalar field. Contour uses code from the Surface Plotter package by Yanto Suryono.
Field Summary | |
---|---|
protected ColorMapper |
colorMap
|
protected boolean |
interpolateLargeGrids
|
protected ZExpansion |
zMap
|
Fields inherited from interface org.opensourcephysics.display2d.Plot2D |
---|
CONTOUR_PLOT, GRID_PLOT, INTERPOLATED_PLOT, SURFACE_PLOT |
Constructor Summary | |
---|---|
ContourPlot()
Constructs a ContourPlot without any data. |
|
ContourPlot(GridData _griddata)
Constructs a ContourPlot that renders the given GridData. |
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Paint the contour. |
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 |
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. |
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. |
boolean |
isInterpolateLargeGrids()
Retruns true if plot interpolates a large grid onto a smaller grid to speed the computation of contour lines. |
boolean |
isMeasured()
Determines if information is available to set min/max values. |
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. |
void |
setColorPalette(java.awt.Color[] colors)
Determines the palette type that will be used. |
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, ceiling, and line colors. |
void |
setGridData(GridData _griddata)
Sets the data storage to the given value. |
void |
setGridLineColor(java.awt.Color color)
Sets the contour line color. |
void |
setIndexes(int[] indexes)
Sets the indexes for the data components that will be plotted. |
void |
setInterpolateLargeGrids(boolean interpolate)
Sets flag to interpolates a large grid onto a smaller grid to speed the computation of contour lines. |
void |
setNumberOfLevels(int n)
Sets the number of contour levels. |
void |
setPaletteType(int mode)
Sets the type of palette. |
void |
setShowGridLines(boolean showLines)
Shows the contour lines. |
void |
setVisible(boolean isVisible)
Sets the visibility of the contour plot. |
javax.swing.JFrame |
showLegend()
Shows how values map to colors. |
void |
update()
Updates the contour data. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ZExpansion zMap
protected ColorMapper colorMap
protected boolean interpolateLargeGrids
Constructor Detail |
---|
public ContourPlot()
public ContourPlot(GridData _griddata)
_griddata
- data storageMethod Detail |
---|
public 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
- double[][] the new valuespublic 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 GridData getGridData()
getGridData
in interface Plot2D
public void setGridData(GridData _griddata)
setGridData
in interface Plot2D
_griddata
- public void setVisible(boolean isVisible)
setVisible
in interface Plot2D
isVisible
- public javax.swing.JFrame showLegend()
showLegend
in interface Plot2D
public void setShowGridLines(boolean showLines)
setShowGridLines
in interface Plot2D
showLines
- public void setGridLineColor(java.awt.Color color)
setGridLineColor
in interface Plot2D
color
- public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
g
- public void setAutoscaleZ(boolean isAutoscale, double floor, double ceil)
setAutoscaleZ
in interface Plot2D
isAutoscale
- floor
- ceil
- public void setInterpolateLargeGrids(boolean interpolate)
interpolate
- booleanpublic boolean isInterpolateLargeGrids()
public void setExpandedZ(boolean expanded, double expansionFactor)
setExpandedZ
in interface Plot2D
expanded
- booleanexpansionFactor
- doublepublic boolean isAutoscaleZ()
isAutoscaleZ
in interface Plot2D
public double getFloor()
getFloor
in interface Plot2D
public double getCeiling()
getCeiling
in interface Plot2D
public void update()
update
in interface Plot2D
public void setColorPalette(java.awt.Color[] colors)
setColorPalette
in interface Plot2D
colors
- Color[]public void setPaletteType(int mode)
setPaletteType
in interface Plot2D
mode
- public void setFloorCeilColor(java.awt.Color floorColor, java.awt.Color ceilColor)
setFloorCeilColor
in interface Plot2D
floorColor
- ceilColor
- public void setIndexes(int[] indexes)
setIndexes
in interface Plot2D
indexes
- the sample-component indexespublic void setNumberOfLevels(int n)
n
- number of levels.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 boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |