|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.UserCoordinates
com.quinncurtis.chart2djava.WorldCoordinates
com.quinncurtis.chart2djava.WorkingCoordinates
com.quinncurtis.chart2djava.PhysicalCoordinates
com.quinncurtis.chart2djava.CartesianCoordinates
com.quinncurtis.chart2djava.PolarCoordinates
public class PolarCoordinates
The CartesianCoordinates class extends the CartesianCoordinates class to support polar scales. Polar coordinates used ChartPoint2D objects to store data points. The x-value of the ChartPoint2D object is the polar magnitude and the y-value is the polar angle. In the datasets used with PolarCoordinates, the x-values also represent polar magnitudes and y-values represent polar angle.
Field Summary |
---|
Constructor Summary | |
---|---|
PolarCoordinates()
The default PolarCoordinates constructor. |
|
PolarCoordinates(double rR)
This constructor creates a new PolarCoordinates scaled for the radius R. |
Method Summary | |
---|---|
void |
autoScale(ChartDataset dataset)
This method initializes an PolarCoordinates object based on the range of x-values (polar magnitudes) in a dataset. |
void |
autoScale(ChartDataset[] datasets)
This method initializes an PolarCoordinates object based on the range of x-values (polar magnitudes) in an array of datasets. |
void |
autoScale(ChartDataset[] datasets,
int nroundmode)
This method initializes an PolarCoordinates object based on the range of x-values (polar magnitudes) in an array of datasets. |
void |
autoScale(ChartDataset dataset,
int nroundmode)
This method initializes an PolarCoordinates object based on the range of x-values (polar magnitudes) in a dataset. |
void |
calcAutoScale(ChartDataset[] datasets,
int nroundmode)
Calculates a polar axis scale based on the range of x-values (polar magnitudes) in an array of datasets. |
void |
calcAutoScale(ChartDataset dataset,
int nroundmode)
Calculates a polar axis scale based on the range of x-values (polar magnitudes) in a dataset. |
void |
cartesianToPolar(ChartPoint2D dest,
ChartPoint2D source)
This method converts the coordinates of a point from Cartesian coordinates to polar coordinates. |
java.lang.Object |
clone()
Returns an object that is a clone of this PolarCoordinates object. |
void |
convertCoord(ChartPoint2D dest,
int ndestpostype,
ChartPoint2D source,
int nsrcpostype)
It converts the coordinates of a point from one coordinate system to another. |
ChartPoint2D |
convertCoord(int ndestpostype,
ChartPoint2D source,
int nsrcpostype)
It converts the coordinates of a point from one coordinate system to another. |
void |
convertCoordArray(ChartPoint2D[] dest,
int ndestpostype,
ChartPoint2D[] source,
int nsrcpostype,
int n)
This method converts an array of points from one coordinate system to another. |
double |
convertRadius(int ndestpostype,
double source,
int nsrcpostype)
This method converts a radius value from one coordinate system to another. |
void |
copy(PolarCoordinates source)
Copies the source PolarCoordinates object. |
int |
errorCheck(int nerror)
Checks the PolarCoordinates object for common errors. |
PolarAxes |
getCompatibleAxes()
This method returns an PolarAxes axis object, compatible with this coordinate system. |
PolarAxes |
getCompatibleAxis()
This method returns an PolarAxes axis object, compatible with this coordinate system. |
double |
getPolarScaleRadius()
Returns the radius of the polar scale. |
void |
polarLineAbs(java.awt.geom.GeneralPath path,
ChartPoint2D p1,
ChartPoint2D p2,
boolean binterpolate)
This method converts the specified starting and ending polar coordinates to device coordinates, and adds a corresponding line segment to the specified path. |
void |
polarLineAbs(java.awt.geom.GeneralPath path,
double x1,
double y1,
double x2,
double y2,
boolean binterpolate)
This method converts the specified starting and ending polar coordinates to device coordinates, and adds a corresponding line segment to the specified path. |
void |
polarLineToAbs(java.awt.geom.GeneralPath path,
double x,
double y,
boolean binterpolate)
This method converts the specified polar coordinates to device coordinates, and adds a corresponding lineto segment to the specified path. |
void |
polarMoveToAbs(java.awt.geom.GeneralPath path,
double x,
double y)
This method converts the specified polar coordinates to device coordinates, and adds a corresponding move segment to the specified path. |
void |
polarToCartesian(ChartPoint2D dest,
ChartPoint2D source)
This method converts the coordinates of a point from polar coordinates to underlying 2D Cartesian coordinate system. |
void |
setPolarScaleRadius(double radius)
Sets the radius of the polar scale. |
Methods inherited from class com.quinncurtis.chart2djava.CartesianCoordinates |
---|
autoScale, autoScale, autoScale, checkValidPoint, copy, copy, getCompatibleAxis, setCartesianScaleTransforms, setCartesianXScaleTransform, setCartesianYScaleTransform |
Methods inherited from class com.quinncurtis.chart2djava.WorkingCoordinates |
---|
calcWorkingScale, copy, getClippingArea, getGraphAreaScale, getGraphAspectRatio, getGraphBorderFrame, getGraphRect, getPlotAreaScale, getPlotRect, getWorkingRangeX, getWorkingRangeY, setClippingArea, setFixedGraphBorderInset, setFixedGraphBorderInsets, setGraphBorderDiagonal, setGraphBorderFrame, setGraphBorderFrame, setGraphBorderInsets, setPlotAreaScale |
Methods inherited from class com.quinncurtis.chart2djava.WorldCoordinates |
---|
copy, getWorldCurrentPos, getWorldX1, getWorldX2, getWorldY1, getWorldY2, setWorldScale, setWorldScale, userToWorld, userToWorld, userToWorld, userToWorld, userToWorldAbsX, userToWorldAbsY, userToWorldRelX, userToWorldRelY, worldToUser, worldToUser, worldToUser, worldToUserAbsX, worldToUserAbsY, worldToUserRelX, worldToUserRelY |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolarCoordinates()
public PolarCoordinates(double rR)
rR
- The radius of the polar scale.Method Detail |
---|
public void autoScale(ChartDataset dataset)
autoScale
in class CartesianCoordinates
dataset
- The dataset used as the basis for the new coordinate system. The maximum x-value
in the dataset controls the polar coordinate scaling.public void autoScale(ChartDataset[] datasets)
autoScale
in class CartesianCoordinates
datasets
- An array of datasets used as the basis for the new coordinate system. The
maximum x-value in the datasets controls the polar coordinate scaling.public void autoScale(ChartDataset[] datasets, int nroundmode)
datasets
- An array of datasets used as the basis for the new coordinate system. The maximum
x-value in the datasets controls the polar coordinate scaling.nroundmode
- Sets the auto-scale mode for the polar axis scaling. Use one of the
auto-scale rounding mode constants: AUTOAXES_FAR, AUTOAXES_NEAR, AUTOAXES_EXACT.public void autoScale(ChartDataset dataset, int nroundmode)
dataset
- The dataset used as the basis for the new coordinate system. The maximum x-value
in the dataset controls the polar coordinate scaling.nroundmode
- Sets the auto-scale mode for the polar axis scaling. Use one of the auto-scale
rounding mode constants: AUTOAXES_FAR, AUTOAXES_NEAR, AUTOAXES_EXACT.public void calcAutoScale(ChartDataset[] datasets, int nroundmode)
datasets
- An array of datasets used as the basis for the new coordinate system. The
maximum x-value in the datasets controls the polar coordinate scaling.nroundmode
- The rounding mode.public void calcAutoScale(ChartDataset dataset, int nroundmode)
dataset
- The dataset used as the basis for the new coordinate system. The maximum x-value
in the dataset controls the polar coordinate scaling.nroundmode
- Sets the auto-scale mode for the polar axis scaling. Use one of the auto-scale
rounding mode constants: AUTOAXES_FAR, AUTOAXES_NEAR, AUTOAXES_EXACT.public void cartesianToPolar(ChartPoint2D dest, ChartPoint2D source)
dest
- Returns the coordinates of the point using polar coordinates, where the polar
magnitude is store in source.x, and the polar angle in source.y.source
- The coordinates of the point in Cartesian coordinates.public java.lang.Object clone()
clone
in class CartesianCoordinates
public void convertCoord(ChartPoint2D dest, int ndestpostype, ChartPoint2D source, int nsrcpostype)
convertCoord
in class PhysicalCoordinates
dest
- Returns the converted coordinate value as a ChartPoint2D object.ndestpostype
- Specifies the destination coordinate system. Use one of the coordinate
system constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;source
- The coordinates of a the point that is to be converted.nsrcpostype
- Specifies the source coordinate system. Use one of the coordinate system
constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;public ChartPoint2D convertCoord(int ndestpostype, ChartPoint2D source, int nsrcpostype)
convertCoord
in class PhysicalCoordinates
ndestpostype
- Specifies the destination coordinate system. Use one of the coordinate system
constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;source
- The coordinates of a the point that is to be converted.nsrcpostype
- Specifies the source coordinate system. Use one of the coordinate system
constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;
public void convertCoordArray(ChartPoint2D[] dest, int ndestpostype, ChartPoint2D[] source, int nsrcpostype, int n)
convertCoordArray
in class PhysicalCoordinates
dest
- An array of ChartPoint2D objects, of size n, that returns the converted coordinate values.ndestpostype
- Specifies the destination coordinate system. Use one of the coordinate
system constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;source
- An array of ChartPoint2D, of size n, that holds the points that are to be converted.nsrcpostype
- Specifies the source coordinate system. Use one of the coordinate system
constants: POLAR_POS, DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;n
- The number of points in source and destination arrays.public double convertRadius(int ndestpostype, double source, int nsrcpostype)
ndestpostype
- Specifies the destination coordinate system. Use one of the coordinate
system constants: DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;source
- The radius value to be converted.nsrcpostype
- Specifies the source coordinate system. Use one of the coordinate system
constants: DEV_POS, PHYS_POS, POLAR_POS, NORM_GRAPH_POS, or NORM_PLOT_POS;
public void copy(PolarCoordinates source)
source
- The source PolarCoordinates object.public int errorCheck(int nerror)
errorCheck
in class CartesianCoordinates
nerror
- Current error state
public PolarAxes getCompatibleAxes()
public PolarAxes getCompatibleAxis()
public double getPolarScaleRadius()
public void polarLineAbs(java.awt.geom.GeneralPath path, ChartPoint2D p1, ChartPoint2D p2, boolean binterpolate)
path
- A general path object.p1
- The starting point in polar coordinates.p2
- The ending point in polar coordinates.binterpolate
- Set to true for polar coordinate interpolation whenpublic void polarLineAbs(java.awt.geom.GeneralPath path, double x1, double y1, double x2, double y2, boolean binterpolate)
path
- A general path object.x1
- The polar magnitude of the starting point.y1
- The polar angle of the starting point.x2
- The polar magnitude of the ending point.y2
- The polar angle of the ending point.binterpolate
- Set to true for polar coordinate interpolation whenpublic void polarLineToAbs(java.awt.geom.GeneralPath path, double x, double y, boolean binterpolate)
path
- A general path object.x
- The polar magnitude of the point.y
- The polar angle of the point.binterpolate
- Set to true for polar coordinate interpolation when drawing to the next point.public void polarMoveToAbs(java.awt.geom.GeneralPath path, double x, double y)
path
- A general path object.x
- The polar magnitude of the point.y
- The polar angle of the point.public void polarToCartesian(ChartPoint2D dest, ChartPoint2D source)
dest
- Returns the coordinates of the point in Cartesian coordinates.source
- The coordinates of a point specified using polar coordinates, where the polar
magnitude is store in source.x, and the polar angle in source.y.public void setPolarScaleRadius(double radius)
radius
- Sets the radius of the polar scale.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |