PlotSurfacepublic class GraphSurface extends java.lang.Object implements PlotSurface
MAX_COORD| Constructor | Description |
|---|---|
GraphSurface(javax.swing.JComponent component,
boolean xLog,
boolean yLog,
boolean xFlip,
boolean yFlip) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.awt.Point |
dataToGraphics(double x,
double y,
boolean insideOnly) |
Converts a point in data space to graphics space.
|
java.awt.Shape |
getClip() |
Returns the clip region in which points may be plotted.
|
javax.swing.JComponent |
getComponent() |
Returns the graphical component on which the plotting surface is
displayed.
|
double[] |
graphicsToData(int px,
int py,
boolean insideOnly) |
Converts a point in graphics space to data space.
|
void |
paintSurface(java.awt.Graphics g) |
Paints the plotting surface.
|
void |
setBounds(java.awt.Rectangle bounds) |
Sets the rectangle within which data points may be plotted.
|
void |
setDataRange(double xlo,
double ylo,
double xhi,
double yhi) |
Requests a range of data space values to be visible on
this plotting surface.
|
void |
setState(PlotState state) |
Signals to the plot the characteristics of the plot which will
be performed.
|
java.lang.String |
toString() |
public GraphSurface(javax.swing.JComponent component,
boolean xLog,
boolean yLog,
boolean xFlip,
boolean yFlip)
component - the component on which this surface will drawxLog - true iff X axis is logarithmically scaledyLog - true iff Y axis is logarithmically scaledxFlip - true iff X axis is invertedyFlip - true iff Y axis is invertedpublic java.awt.Shape getClip()
PlotSurfaceGraphics.setClip(java.awt.Shape) - i.e. probably
a Rectangle.getClip in interface PlotSurfacepublic javax.swing.JComponent getComponent()
PlotSurfaceJComponent.paintComponent(java.awt.Graphics)
to give a plotting background in accordance with the most recently
set PlotState.getComponent in interface PlotSurfacepublic void setDataRange(double xlo,
double ylo,
double xhi,
double yhi)
PlotSurfacesetDataRange in interface PlotSurfacexlo - (approximate) lower bound of X coordinateylo - (approximate) lower bound of Y coordinatexhi - (approximate) upper bound of X coordinateyhi - (approximate) upper bound of Y coordinatepublic void setBounds(java.awt.Rectangle bounds)
bounds - the region of the component which represents the
target for data points; annotations may be drawn outside
this regionpublic java.awt.Point dataToGraphics(double x,
double y,
boolean insideOnly)
PlotSurfaceThe coordinates of the returned point must have absolute values
no greater than PlotSurface.MAX_COORD.
dataToGraphics in interface PlotSurfacex - data space X coordinatey - data space Y coordinateinsideOnly - true to restrict non-null results to those
within the plotting surfacepublic double[] graphicsToData(int px,
int py,
boolean insideOnly)
PlotSurfacegraphicsToData in interface PlotSurfacepx - graphics space X coordinatepy - graphics space Y coordinateinsideOnly - true to restrict non-null results to those
within the plotting surfacepublic void setState(PlotState state)
PlotSurfacePlotSurface.getComponent()
next paints itself it should do so following the specifications
made here.setState in interface PlotSurfacestate - plot characteristicspublic void paintSurface(java.awt.Graphics g)
PlotSurfaceRequiring this here isn't very tidy, but following quite a bit of
experimentation I can't work out any other way to do scatter plot
image caching while still drawing to a potentially
hardware-accelerated graphics context
(see ScatterPlot implementation).
paintSurface in interface PlotSurfaceg - graphics contextpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.