|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display2d.SurfacePlot
public class SurfacePlot
SurfacePlot draws a 3D surface of a scalar field. Surfaceplot uses code from the Surface Plotter package by Yanto Suryono.
Field Summary | |
---|---|
protected GridData |
griddata
|
static int |
INIT_CALC_DIV
Field INIT_CALC_DIV |
static int |
INIT_DISP_DIV
Field INIT_DISP_DIV |
protected java.text.DecimalFormat |
labelFormat
|
protected boolean |
visible
|
Fields inherited from interface org.opensourcephysics.display2d.Plot2D |
---|
CONTOUR_PLOT, GRID_PLOT, INTERPOLATED_PLOT, SURFACE_PLOT |
Constructor Summary | |
---|---|
SurfacePlot()
SurfacePlot constructor. |
|
SurfacePlot(GridData _griddata)
SurfacePlot constructor. |
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Paint the surface. |
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 |
isMeasured()
Determines if information is available to set min/max values. |
void |
mouseDragged(java.awt.event.MouseEvent e,
DrawingPanel drawingPanel)
mouseDrag |
boolean |
mousePressed(java.awt.event.MouseEvent e,
DrawingPanel drawingPanel)
mouseDown event handler. |
void |
mouseReleased(java.awt.event.MouseEvent e,
DrawingPanel drawingPanel)
Method mouseReleased |
void |
set2DScaling(double scale)
Sets the 2D scaling factor. |
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 |
setAxisLabels(java.lang.String xLabel,
java.lang.String yLabel,
java.lang.String zLabel)
Sets the axis labels. |
void |
setColorPalette(java.awt.Color[] colors)
Sets the colors that will be used between the floor and ceiling values. |
void |
setDistance(double distance)
Sets the viewing distance. |
void |
setElevationAngle(double angle)
Sets the viewing elevation angle. |
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 griddata. |
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 |
setLabelFormat(java.lang.String _format)
Sets the format for the axis label values. |
void |
setPaletteType(int type)
Determines the palette type that will be used. |
void |
setRotationAngle(double angle)
Sets the viewing rotation angle. |
void |
setShowGridLines(boolean show)
Outlines the data grid's boundaries. |
void |
setTranslation(int xpix,
int ypix)
Translates the view by the specified number of pixels. |
void |
setVisible(boolean isVisible)
Sets the visibility of the lattice. |
javax.swing.JFrame |
showLegend()
Shows the color legend. |
void |
update()
Updates the surface plot using the current 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 boolean visible
protected java.text.DecimalFormat labelFormat
public static final int INIT_CALC_DIV
public static final int INIT_DISP_DIV
protected GridData griddata
Constructor Detail |
---|
public SurfacePlot()
public SurfacePlot(GridData _griddata)
_griddata
- Method 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
- 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 GridData getGridData()
getGridData
in interface Plot2D
public void setGridData(GridData _griddata)
setGridData
in interface Plot2D
_griddata
- public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
panel
- g
- public void setPaletteType(int type)
setPaletteType
in interface Plot2D
type
- public void setIndexes(int[] indexes)
setIndexes
in interface Plot2D
indexes
- the sample-componentpublic void setLabelFormat(java.lang.String _format)
_format
- the format stringpublic void setAxisLabels(java.lang.String xLabel, java.lang.String yLabel, java.lang.String zLabel)
xLabel
- StringyLabel
- StringzLabel
- Stringpublic 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 setExpandedZ(boolean expanded, double expansionFactor)
setExpandedZ
in interface Plot2D
expanded
- booleanexpansionFactor
- doublepublic void update()
update
in interface Plot2D
public void setTranslation(int xpix, int ypix)
xpix
- the x translation in pixelsypix
- the y translation in pixelspublic void setRotationAngle(double angle)
angle
- the rotation angle in degreespublic void setElevationAngle(double angle)
angle
- the elevation angle in degreespublic void setDistance(double distance)
distance
- the distancepublic void set2DScaling(double scale)
scale
- the scaling factorpublic boolean mousePressed(java.awt.event.MouseEvent e, DrawingPanel drawingPanel)
mouseDown
event handler. Sets internal tracking variables
for dragging operations.
e
- the eventdrawingPanel
-
public void mouseReleased(java.awt.event.MouseEvent e, DrawingPanel drawingPanel)
e
- drawingPanel
- public void mouseDragged(java.awt.event.MouseEvent e, DrawingPanel drawingPanel)
mouseDrag event handler. Tracks dragging operations.
Checks the delay regeneration flag and does proper actions.
- Parameters:
e
- the eventdrawingPanel
-
public void setShowGridLines(boolean show)
setShowGridLines
in interface Plot2D
show
- public void setGridLineColor(java.awt.Color c)
setGridLineColor
in interface Plot2D
c
- public javax.swing.JFrame showLegend()
showLegend
in interface Plot2D
public void setColorPalette(java.awt.Color[] colors)
setColorPalette
in interface Plot2D
colors
- public void setVisible(boolean isVisible)
setVisible
in interface Plot2D
isVisible
- public void setFloorCeilColor(java.awt.Color floorColor, java.awt.Color ceilColor)
setFloorCeilColor
in interface Plot2D
floorColor
- ceilColor
- public double getXMin()
getXMin
in interface Measurable
public double getXMax()
getXMax
in interface Measurable
public double getYMin()
getYMin
in interface Measurable
public double getYMax()
getYMax
in interface Measurable
public boolean isMeasured()
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 |