|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.gui.PlotTool
Encapsulates the transform between world and image coordinates for use in plotting data graphs. Provides functions to plot or mark an array of Point2D data or an array of such Point2D arrays. Automatically handles the painting of axes, grid lines, and tick marks on the axes.
The "world" coordinate space refers to the coordinate space inhabited by the data arrays or functions that are to be plotted. The "image" coordinate space refers to the coordinate space of the graphics context on which the plots are painted.
| Field Summary | |
protected Rectangle2D.Double |
imageBounds
Bounding rectangle of the image coordinate space. |
protected Interval |
imageXRange
The x-interval in image coordinates. |
protected Interval |
imageYRange
The y-interval in image coordinates. |
protected int |
inset
Number of pixels in image coordinate units to inset the transform of the world coordinates. |
protected AffineTransform |
inverseMapping
The inverse of the world to image transform. |
protected Transform1D |
inverseXMapping
The inverse of the x-component of the world to image transform. |
protected Transform1D |
inverseYMapping
The inverse of the y-component of the world to image transform. |
protected Line2D.Double |
L
Helper for line computation. |
protected AffineTransform |
mapping
The world to image transform. |
protected Point2D.Double |
P
Helper for point computation. |
protected boolean |
preservesShape
Whether or not to preserve geometric shape. |
protected Point2D.Double |
Q
Helper for point computation. |
protected Point2D.Double |
scale
The absolute value of the x and y scale factors. |
protected Rectangle2D.Double |
worldBounds
Bounding rectangle of the world coordinate space. |
protected Interval |
worldXRange
The x-interval in world coordinates. |
protected Interval |
worldYRange
The y-interval in world coordinates. |
protected Transform1D |
xMapping
The x-component of the world to image transform. |
protected Transform1D |
yMapping
The y-component of the world to image transform. |
| Constructor Summary | |
PlotTool()
Constructs a plot tool with the default parameters. |
|
PlotTool(Rectangle2D w,
Rectangle2D i)
Constructs a plot tool for use with the given world and image coordinate spaces. |
|
PlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq)
Constructs a plot tool for use with the given world and image coordinate spaces, with the given policy regarding the preservation of geometric shape. |
|
PlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq,
int in)
Constructs a plot tool for use with the given world and image coordinate spaces, with the given policy regarding the preservation of geometric shape, and the given image inset. |
|
| Method Summary | |
PlotTool |
autoAxes(Graphics2D g)
Plots black axes of thickness 3 in given graphics context. |
PlotTool |
autoGridLines(Graphics2D g)
Plots grid lines appropriate for the world to image transform in the given graphics context, using the default thickness and the default color for grid lines. |
Point2D |
autoSpacing(int minPixel)
Returns a Point2D object encapsulating
an appropriate spacing for grid lines and tick marks
in world coordinates. |
PlotTool |
autoTickMarks(Graphics2D g)
Plots tick marks appropriate for the world to image transform in the given graphics context, using the default thickness and the default color for tick marks. |
static double |
findSpacing(double minimumDelta)
Returns the smallest double that has one of the three forms 10k, 2*10k, or 5*10k, and is greater than or equal to the absolute value of the given minimum. |
Rectangle2D |
getImageBounds()
Returns a clone of the image coordinate bounds. |
int |
getInset()
Return the image inset. |
AffineTransform |
getInverseTransform()
Returns a clone of the inverse of the world bounds to image bounds two-dimensional transform. |
Transform1D |
getInverseXTransform()
Returns a clone of the inverse of the x component of the world to image transform. |
Transform1D |
getInverseYTransform()
Returns a clone of the inverse of the y component of the world to image transform. |
AffineTransform |
getTransform()
Returns a clone of the world bounds to image bounds two-dimensional transform. |
Rectangle2D |
getWorldBounds()
Returns a clone of the world coordinate bounds. |
Transform1D |
getXTransform()
Returns a clone of the x component of the world to image transform. |
Transform1D |
getYTransform()
Return a clone of the y component of the world to image transform. |
Point2D |
inverseScale(Point2D source)
Returns the point produced by transforming the given point using the inverse of the world to image transform. |
Point2D |
inverseScale(Point2D source,
Point2D target)
Scales the given source Point2D
using the inverse of the world to image transform
and sets the target Point2D
to the transformed value. |
double |
inverseXScale(double x)
Returns the result of scaling the given value using the x component of the inverse of the world to image transform. |
double |
inverseYScale(double y)
Returns the result of scaling the given value using the y component of the inverse of the world to image transform. |
static Rectangle2D |
makeBoundsRectangle2D(Point2D[] data)
Return the smallest rectangle containing the data in the given Point2D array
and return null if no data is supplied. |
static Rectangle2D |
makeBoundsRectangle2D(Point2D[][] data)
Return the smallest rectangle containing the data in the given array of Point2D arrays
and return null if no data is supplied. |
void |
markData(Graphics2D g,
Point2D[][] data,
Paint[] color,
PlotMark m)
Transforms the points of the given array of arrays using the world to image transform and marks the resulting points in the given graphics context using the given color or Paint
to paint the marks. |
void |
markData(Graphics2D g,
Point2D[][] data,
Paint color,
PlotMark m)
Transforms the points of the given array of arrays using the world to image transform and marks the resulting points in the given graphics context using the given color or Paint
to paint the marks. |
void |
markData(Graphics2D g,
Point2D[] data,
Paint color,
PlotMark m)
Transforms the points of the given array using the world to image transform and marks the resulting points in the given graphics context using the given color or Paint
to paint the marks. |
PlotTool |
plotAxes(Graphics2D g,
Paint color,
int thick)
Plots axes in the given graphics context using the given color or Paint
and the given line thickness. |
void |
plotData(Graphics2D g,
Point2D[][] data,
Paint color)
Transforms the points of the given array of arrays using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
to draw the lines. |
void |
plotData(Graphics2D g,
Point2D[][] data,
Paint[] color)
Transforms the points of the given array of arrays using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
to draw the lines. |
void |
plotData(Graphics2D g,
Point2D[][] data,
Paint[] color,
Stroke s)
Transforms the points of the given array of arrays using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
and the given Stroke to draw the lines. |
void |
plotData(Graphics2D g,
Point2D[][] data,
Paint color,
Stroke s)
Transforms the points of the given array of arrays using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
and the given Stroke to draw the lines. |
void |
plotData(Graphics2D g,
Point2D[] data,
Paint color)
Transforms the points of the given array using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
to draw the lines. |
void |
plotData(Graphics2D g,
Point2D[] data,
Paint color,
Stroke s)
Transforms the points of the given array using the world to image transform and plots a function of the resulting points in the given graphics context using the given color or Paint
and the given Stroke to draw the lines. |
PlotTool |
plotGridLines(Graphics2D g,
Paint color,
Point2D delta)
Plots vertical and horizontal grid lines of thickness 1 using the given color or Paint
and the given grid spacing values
encapsulated as a Point2D object. |
void |
plotHGridLine(Graphics2D g,
double yPosition)
Plots a horizontal grid line corresponding to the given y position in world coordinates, in the given graphics context. |
PlotTool |
plotHGridLines(Graphics2D g,
Paint color,
double delta)
Plots a sequence of horizontal grid lines of thickness 1 using the given color or Paint
and the given y grid spacing value. |
void |
plotHTickMark(Graphics2D g,
double yPosition,
int ticksize)
Plots a horizontal tick line corresponding to the given y position in world coordinates, in the given graphics context using the given tick size. |
PlotTool |
plotHTickMarks(Graphics2D g,
Paint color,
double delta,
int ticksize)
Plots a sequence of horizontal tick marks of thickness 1 using the given color or Paint,
y grid spacing value, and tick mark length. |
PlotTool |
plotTickMarks(Graphics2D g,
Paint color,
Point2D delta,
int ticksize)
Plots vertical and horizontal tick marks of thickness 1 using the given color or Paint,
grid spacing values encapsulated
as a Point2D object, and tick mark length. |
void |
plotVGridLine(Graphics2D g,
double xPosition)
Plots a vertical grid line corresponding to the given x position in world coordinates, in the given graphics context. |
PlotTool |
plotVGridLines(Graphics2D g,
Paint color,
double delta)
Plots a sequence of vertical grid lines of thickness 1 using the given color or Paint
and the given x grid spacing value. |
void |
plotVTickMark(Graphics2D g,
double xPosition,
int ticksize)
Plots a vertical tick line corresponding to the given x position in world coordinates, in the given graphics context using the given tick size. |
PlotTool |
plotVTickMarks(Graphics2D g,
Paint color,
double delta,
int ticksize)
Plots a sequence of vertical tick marks of thickness 1 using the given color or Paint,
x grid spacing value, and tick mark length. |
boolean |
preservesShape()
Returns whether or not this tool preserves geometric shape. |
Point2D |
scale(Point2D source)
Returns the point produced by transforming the given point using the world to image transform. |
Point2D |
scale(Point2D source,
Point2D target)
Scales the given source Point2D
using the world to image transform
and sets the target Point2D
to the transformed value. |
PlotTool |
setImageBounds(Rectangle2D i)
Sets the image coordinate bounds to the given bounds. |
PlotTool |
setInset(int in)
Sets the image inset to the given value in image pixel units. |
PlotTool |
setPlotTool(PlotTool other)
Sets the world coordinate space, the image coordinate space, the shape preservation policy and the image inset for this plot tool to the respective values for the given plot tool. |
PlotTool |
setPlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq,
int in)
Sets the world coordinate space, the image coordinate space, the shape preservation policy and the image inset for this plot tool to the given values. |
PlotTool |
setPreservesShape(boolean eq)
Sets the geometric shape preservation policy to the given value. |
protected PlotTool |
setTransforms()
Creates an affine transform suitable for transforming points in the world coordinate space to points in the image coordinate space, either by best fit or by preserving the shape of the geometry. |
PlotTool |
setWorldBounds(Point2D[] data)
Set the world coordinate bounds to the smallest rectangle that contains the Point2D array data. |
PlotTool |
setWorldBounds(Point2D[][] data)
Set the world coordinate bounds to the smallest rectangle that contains the Point2D array of array data. |
PlotTool |
setWorldBounds(Rectangle2D w)
Sets the world coordinate bounds to the given bounds. |
void |
storeImageBounds(Rectangle2D i)
Stores the given image coordinate bounds. |
protected void |
storeInset(int in)
Stores the given inset value. |
protected void |
storePreservesShape(boolean ps)
Stores the given shape preservation policy. |
protected void |
storeWorldBounds(Rectangle2D w)
Stores the given world coordinate bounds. |
int |
xMaxIndex(double delta)
Returns the maximum index for vertical grid or tick lines given the spacing along the x axis in world coordinates. |
int |
xMinIndex(double delta)
Returns the minimum index for vertical grid or tick lines given the spacing along the x axis in world coordinates. |
double |
xScale(double x)
Returns the result of scaling the given value using the x component of the world to image transform. |
int |
yMaxIndex(double delta)
Returns the maximum index for horizontal grid or tick lines given the spacing along the y axis in world coordinates. |
int |
yMinIndex(double delta)
Returns the minimum index for horizontal grid or tick lines given the spacing along the y axis in world coordinates. |
double |
yScale(double y)
Returns the result of scaling the given value using the y component of the world to image transform. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Rectangle2D.Double worldBounds
protected Rectangle2D.Double imageBounds
protected boolean preservesShape
protected int inset
protected AffineTransform mapping
protected Transform1D xMapping
protected Transform1D yMapping
protected AffineTransform inverseMapping
protected Transform1D inverseXMapping
protected Transform1D inverseYMapping
protected Interval worldXRange
protected Interval worldYRange
protected Interval imageXRange
protected Interval imageYRange
protected Point2D.Double scale
protected transient Point2D.Double P
protected transient Point2D.Double Q
protected transient Line2D.Double L
| Constructor Detail |
public PlotTool()
PlotTool(Rectangle2D, Rectangle2D),
PlotTool(Rectangle2D, Rectangle2D, boolean),
PlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int)
public PlotTool(Rectangle2D w,
Rectangle2D i)
w - the desired world coordinate boundsi - the desired image coordinate boundsPlotTool(),
PlotTool(Rectangle2D, Rectangle2D, boolean),
PlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int)
public PlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq)
w - the desired world coordinate boundsi - the desired image coordinate boundseq - whether or not the transform preserves geometric shapePlotTool(),
PlotTool(Rectangle2D, Rectangle2D),
PlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int)
public PlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq,
int in)
w - the desired world coordinate boundsi - the desired image coordinate boundseq - whether or not the transform preserves geometric shapein - the desired inset in image pixel unitsPlotTool(),
PlotTool(Rectangle2D, Rectangle2D),
PlotTool(Rectangle2D, Rectangle2D, boolean),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int)| Method Detail |
public PlotTool setPlotTool(PlotTool other)
other - the object to be copied
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setTransforms()
public PlotTool setPlotTool(Rectangle2D w,
Rectangle2D i,
boolean eq,
int in)
w - the desired world coordinate boundsi - the desired image coordinate boundseq - whether or not the transform preserves geometric shapein - the desired inset in image pixel units
setPlotTool(PlotTool),
setTransforms()public PlotTool setWorldBounds(Rectangle2D w)
w - the new world coordinate bounds
setWorldBounds(Point2D[]),
setWorldBounds(Point2D[][]),
getWorldBounds(),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setImageBounds(Rectangle2D),
setPreservesShape(boolean),
setInset(int),
setTransforms()public Rectangle2D getWorldBounds()
setWorldBounds(Rectangle2D),
setWorldBounds(Point2D[]),
setWorldBounds(Point2D[][])public PlotTool setWorldBounds(Point2D[] data)
Point2D array data.
data - the array data to enclose in the bounds
setWorldBounds(Rectangle2D),
setWorldBounds(Point2D[][]),
getWorldBounds(),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setImageBounds(Rectangle2D),
setPreservesShape(boolean),
setInset(int),
setTransforms(),
makeBoundsRectangle2D(Point2D[])public PlotTool setWorldBounds(Point2D[][] data)
Point2D array of array data.
data - the array of array data to enclose in the bounds
setWorldBounds(Rectangle2D),
getWorldBounds(),
setWorldBounds(Point2D[]),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setImageBounds(Rectangle2D),
setPreservesShape(boolean),
setInset(int),
setTransforms(),
makeBoundsRectangle2D(Point2D[][])public static Rectangle2D makeBoundsRectangle2D(Point2D[] data)
Point2D array
and return null if no data is supplied.
data - the Point2D arraymakeBoundsRectangle2D(Point2D[][])public static Rectangle2D makeBoundsRectangle2D(Point2D[][] data)
Point2D arrays
and return null if no data is supplied.
data - the Point2D arraymakeBoundsRectangle2D(Point2D[])public PlotTool setImageBounds(Rectangle2D i)
i - the new image coordinate bounds
getImageBounds(),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setWorldBounds(Rectangle2D),
setWorldBounds(Point2D[]),
setWorldBounds(Point2D[][]),
setPreservesShape(boolean),
setInset(int),
setTransforms()public Rectangle2D getImageBounds()
setImageBounds(Rectangle2D)public PlotTool setPreservesShape(boolean eq)
eq - whether or not this tool preserves geometric shape
preservesShape(),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setWorldBounds(Rectangle2D),
setWorldBounds(Point2D[]),
setWorldBounds(Point2D[][]),
setImageBounds(Rectangle2D),
setInset(int),
setTransforms()public boolean preservesShape()
setPreservesShape(boolean)public PlotTool setInset(int in)
in - the new image inset in image pixel units
getInset(),
setPlotTool(Rectangle2D, Rectangle2D, boolean, int),
setPlotTool(PlotTool),
setWorldBounds(Rectangle2D),
setWorldBounds(Point2D[]),
setWorldBounds(Point2D[][]),
setImageBounds(Rectangle2D),
setPreservesShape(boolean),
setTransforms()public int getInset()
setInset(int)public AffineTransform getTransform()
public Transform1D getXTransform()
public Transform1D getYTransform()
public AffineTransform getInverseTransform()
public Transform1D getInverseXTransform()
public Transform1D getInverseYTransform()
public Point2D scale(Point2D source,
Point2D target)
Point2D
using the world to image transform
and sets the target Point2D
to the transformed value.
This method signature follows the conventions
for similar methods in the AffineTransform class.
source - the point to transformtarget - the point to store transformed point
or null if a new point should be created
nullscale(Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseXScale(double),
inverseYScale(double)public Point2D scale(Point2D source)
source - the point to transformscale(Point2D, Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseXScale(double),
inverseYScale(double)public double xScale(double x)
scale(Point2D, Point2D),
scale(Point2D),
yScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseXScale(double),
inverseYScale(double)public double yScale(double y)
scale(Point2D, Point2D),
scale(Point2D),
xScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseXScale(double),
inverseYScale(double)
public Point2D inverseScale(Point2D source,
Point2D target)
Point2D
using the inverse of the world to image transform
and sets the target Point2D
to the transformed value.
This method signature follows the conventions
for similar methods in the AffineTransform class.
source - the point to transformtarget - the point to store transformed point
or null if a new point should be created
nullscale(Point2D, Point2D),
scale(Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D),
inverseXScale(double),
inverseYScale(double)public Point2D inverseScale(Point2D source)
source - the point to transformscale(Point2D, Point2D),
scale(Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D, Point2D),
inverseXScale(double),
inverseYScale(double)public double inverseXScale(double x)
scale(Point2D, Point2D),
scale(Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseYScale(double)public double inverseYScale(double y)
scale(Point2D, Point2D),
scale(Point2D),
xScale(double),
yScale(double),
inverseScale(Point2D, Point2D),
inverseScale(Point2D),
inverseXScale(double)
public void plotData(Graphics2D g,
Point2D[] data,
Paint color)
Paint
to draw the lines.
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void plotData(Graphics2D g,
Point2D[] data,
Paint color,
Stroke s)
Paint
and the given Stroke to draw the lines.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void plotData(Graphics2D g,
Point2D[][] data,
Paint color)
Paint
to draw the lines.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void plotData(Graphics2D g,
Point2D[][] data,
Paint color,
Stroke s)
Paint
and the given Stroke to draw the lines.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void plotData(Graphics2D g,
Point2D[][] data,
Paint[] color)
Paint
to draw the lines.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void plotData(Graphics2D g,
Point2D[][] data,
Paint[] color,
Stroke s)
Paint
and the given Stroke to draw the lines.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void markData(Graphics2D g,
Point2D[] data,
Paint color,
PlotMark m)
Paint
to paint the marks.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[][], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void markData(Graphics2D g,
Point2D[][] data,
Paint color,
PlotMark m)
Paint
to paint the marks.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint[], PlotMark)
public void markData(Graphics2D g,
Point2D[][] data,
Paint[] color,
PlotMark m)
Paint
to paint the marks.
plotData(Graphics2D, Point2D[], Paint),
plotData(Graphics2D, Point2D[], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint),
plotData(Graphics2D, Point2D[][], Paint, Stroke),
plotData(Graphics2D, Point2D[][], Paint[]),
plotData(Graphics2D, Point2D[][], Paint[], Stroke),
markData(Graphics2D, Point2D[], Paint, PlotMark),
markData(Graphics2D, Point2D[][], Paint, PlotMark)
public void plotVGridLine(Graphics2D g,
double xPosition)
g - the graphics contextxPosition - the x position in world coordinatesplotHGridLine(Graphics2D, double)
public void plotHGridLine(Graphics2D g,
double yPosition)
g - the graphics contextyPosition - the y position in world coordinatesplotVGridLine(Graphics2D, double)
public void plotVTickMark(Graphics2D g,
double xPosition,
int ticksize)
g - the graphics contextxPosition - the x position in world coordinatesticksize - the length of the tick markplotHTickMark(Graphics2D, double, int)
public void plotHTickMark(Graphics2D g,
double yPosition,
int ticksize)
g - the graphics contextyPosition - the y position in world coordinatesticksize - the length of the tick markplotVTickMark(Graphics2D, double, int)public int xMinIndex(double delta)
delta - the spacing along the x axis
in world coordinatesyMinIndex(double),
xMaxIndex(double),
yMaxIndex(double)public int yMinIndex(double delta)
delta - the spacing along the y axis
in world coordinatesxMinIndex(double),
xMaxIndex(double),
yMaxIndex(double)public int xMaxIndex(double delta)
delta - the spacing along the x axis
in world coordinatesxMinIndex(double),
yMinIndex(double),
yMaxIndex(double)public int yMaxIndex(double delta)
delta - the spacing along the y axis
in world coordinatesxMinIndex(double),
yMinIndex(double),
xMaxIndex(double)
public PlotTool plotVGridLines(Graphics2D g,
Paint color,
double delta)
Paint
and the given x grid spacing value.
g - the graphics contextcolor - the grid line colordelta - the x grid spacing
plotVGridLine(Graphics2D, double),
plotHGridLine(Graphics2D, double),
plotHGridLines(Graphics2D, Paint, double),
plotGridLines(Graphics2D, Paint, Point2D)
public PlotTool plotHGridLines(Graphics2D g,
Paint color,
double delta)
Paint
and the given y grid spacing value.
g - the graphics contextcolor - the grid line colordelta - the y grid spacing
plotVGridLine(Graphics2D, double),
plotHGridLine(Graphics2D, double),
plotVGridLines(Graphics2D, Paint, double),
plotGridLines(Graphics2D, Paint, Point2D)
public PlotTool plotGridLines(Graphics2D g,
Paint color,
Point2D delta)
Paint
and the given grid spacing values
encapsulated as a Point2D object.
g - the graphics contextcolor - the grid line colordelta - a Point2D encapsulating
the grid spacing in the x and y directions
plotVGridLine(Graphics2D, double),
plotHGridLine(Graphics2D, double),
plotVGridLines(Graphics2D, Paint, double),
plotHGridLines(Graphics2D, Paint, double),
autoGridLines(Graphics2D)
public PlotTool plotVTickMarks(Graphics2D g,
Paint color,
double delta,
int ticksize)
Paint,
x grid spacing value, and tick mark length.
g - the graphics contextcolor - the tick mark colordelta - the x tick mark spacingticksize - the length for each tick mark
plotVTickMark(Graphics2D, double, int),
plotHTickMark(Graphics2D, double, int),
plotHTickMarks(Graphics2D, Paint, double, int),
plotTickMarks(Graphics2D, Paint, Point2D, int)
public PlotTool plotHTickMarks(Graphics2D g,
Paint color,
double delta,
int ticksize)
Paint,
y grid spacing value, and tick mark length.
g - the graphics contextcolor - the tick mark colordelta - the y tick mark spacingticksize - the length for each tick mark
plotVTickMark(Graphics2D, double, int),
plotHTickMark(Graphics2D, double, int),
plotVTickMarks(Graphics2D, Paint, double, int),
plotTickMarks(Graphics2D, Paint, Point2D, int)
public PlotTool plotTickMarks(Graphics2D g,
Paint color,
Point2D delta,
int ticksize)
Paint,
grid spacing values encapsulated
as a Point2D object, and tick mark length.
g - the graphics contextcolor - the tick mark colordelta - a Point2D encapsulating
the tick mark spacing
in the x and y directionsticksize - the length for each tick mark
plotVTickMark(Graphics2D, double, int),
plotHTickMark(Graphics2D, double, int),
plotVTickMarks(Graphics2D, Paint, double, int),
plotHTickMarks(Graphics2D, Paint, double, int),
autoTickMarks(Graphics2D)public static double findSpacing(double minimumDelta)
minimumDelta - the minimum value that could be returnedpublic Point2D autoSpacing(int minPixel)
Point2D object encapsulating
an appropriate spacing for grid lines and tick marks
in world coordinates.
The x and y values of the returned
Point2D object will each have one of the
three numeric forms: 10k,
2*10k, or 5*10k.
If this plot tool is set to preserve geometric shape
then the x and y values of the returned
point will be equal.
minPixel - the minimum spacing in image pixel units
Point2D object encapsulating
the appropriate spacing
for grid lines and tick marks
in world coordinatespublic PlotTool autoGridLines(Graphics2D g)
g - the graphics context on which to plot
plotGridLines(Graphics2D, Paint, Point2D)public PlotTool autoTickMarks(Graphics2D g)
g - the graphics context on which to plot
plotTickMarks(Graphics2D, Paint, Point2D, int)
public PlotTool plotAxes(Graphics2D g,
Paint color,
int thick)
Paint
and the given line thickness.
g - the graphics context on which to plotcolor - the desired axes colorthick - the desired axes line thickness
plotVGridLine(Graphics2D, double),
plotHGridLine(Graphics2D, double),
autoAxes(Graphics2D)public PlotTool autoAxes(Graphics2D g)
g - the graphics context on which to plot
plotAxes(Graphics2D, Paint, int)protected void storeWorldBounds(Rectangle2D w)
w - the new world coordinate boundsstoreImageBounds(Rectangle2D),
storePreservesShape(boolean),
storeInset(int)public void storeImageBounds(Rectangle2D i)
i - the new image coordinate boundsstoreWorldBounds(Rectangle2D),
storePreservesShape(boolean),
storeInset(int)protected void storePreservesShape(boolean ps)
ps - whether or not the transform
preserves geometric shapestoreWorldBounds(Rectangle2D),
storeImageBounds(Rectangle2D),
storeInset(int)protected void storeInset(int in)
in - the new image inset in image pixel unitsstoreWorldBounds(Rectangle2D),
storeImageBounds(Rectangle2D),
storePreservesShape(boolean)protected PlotTool setTransforms()
Creates an affine transform suitable for transforming points in the world coordinate space to points in the image coordinate space, either by best fit or by preserving the shape of the geometry.
The affine transform will support the mathematician's convention for world coodinates:
This means that in practice:
The image of the world will be centered, that is, the center of the bounds rectangle for the world coordinate space will map to the center of the bounds rectangle for the image coordinate space.
If this plot tool is not set to preserve geometric shape, then the transform will map the bounds rectangle for the world coordinate space directly to the bounds rectangle for the image coordinate space.
The inset parameter is used to adjust the transform so that the world coordinate bounds maps to a subrectangle of the image coordinate bounds inset on all sides by the given number of pixels.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||