|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.JCNumberUtil | +--com.klg.jclass.chart.JCChartUtil
JCChartUtil
is a collection of static methods and static
variables that are used throughout JClass Chart.
Field Summary |
Fields inherited from class com.klg.jclass.util.JCNumberUtil |
DECIMAL, DEFAULT_FLOAT, DEGREES, GRADS, LOG_TEN_BASE_E, M_2PI, M_PI, M_PI_2, M_SQRT2, RADIANS, XBYX1, XBYX2, XINSIDE, YBYORIGIN, YBYTOP, YINSIDE |
Constructor Summary | |
JCChartUtil()
|
Method Summary | |
static com.klg.jclass.chart.DoubleCoord |
calcTik(double ts,
int prec)
Calculates the tick and numbering increments by taking a prospective increment size and gravitating it towards a 'nice' number, (for example, one ending in 5 or 0). |
protected static double |
getAngleRatio(int unit,
double angle,
double angleOrigin,
boolean clockwise)
Calculates the fraction of a full circle that a specified angle represents. |
static double |
getDistanceToVector(Point2D.Double endPoint1,
Point2D.Double endPoint2,
Point2D.Double point)
Returns the minimum pixel distance between a pick point and a specified line segment. |
static Line2D.Double[] |
getLineSegments(Polygon poly)
Creates an array of line segments from the vertex coordinates of the specified polygon. |
static double |
getPolygonDistance(int px,
int py,
Polygon poly)
Returns the minimum pixel distance between a pick point and a specified polygon. |
static double |
getRadarAngle(int angleUnits,
int numberPoints,
int index,
boolean isReversed)
Returns the radar angle for a data point. |
static double |
getShapeDistance(Point2D.Double pt,
Shape shape,
double flatness)
Returns the minimum pixel distance between a pick point and a specified Shape object. |
Methods inherited from class com.klg.jclass.util.JCNumberUtil |
abs, abs, boundAngle, brighter, calcError, clamp, clamp, clamp, colorsNear, convertAngle, convertFromSN, countInString, darker, degToRad, distance, distance, distance, distTrap, fmod, format, fudgeItalicLabel, getDecimalPointChar, iceil, ifloor, internalFormat, intLog10, isHTML, locateX, locateXY, locateY, log10, logFormat, max, min, nicePrecision, pointsToPolygon, pow10, precCeil, precCorrect, precFloor, radToDeg, tickBasedPrecision, trace, validUnit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JCChartUtil()
Method Detail |
public static Line2D.Double[] getLineSegments(Polygon poly)
poly
- the polygon
public static double getPolygonDistance(int px, int py, Polygon poly)
px
- the x pixel coordinate of the pick pointpy
- the y pixel coordinate of the pick pointpoly
- the Polygon
public static double getShapeDistance(Point2D.Double pt, Shape shape, double flatness)
Shape
object. If the pick point is inside the
Shape
, the return value is 0.
pt
- the pick pointshape
- the Shapeflatness
- the maximum distance, from any point on the original curve,
that the line segments which are used to approximate curved segments are
allowed to deviate
Shape
public static double getDistanceToVector(Point2D.Double endPoint1, Point2D.Double endPoint2, Point2D.Double point)
endPoint1
- first point of line segmentendPoint2
- last point of line segmentpoint
- the pick point
public static com.klg.jclass.chart.DoubleCoord calcTik(double ts, int prec)
ts
- prec
-
public static double getRadarAngle(int angleUnits, int numberPoints, int index, boolean isReversed)
angleUnits
- either DEGREES
, GRADS
, or
RADIANS
numberPoints
- number of spokes in Radar chartindex
- array index of data pointisReversed
- true
if the direction of the angle axis is reversed
protected static double getAngleRatio(int unit, double angle, double angleOrigin, boolean clockwise)
unit
- The units in which the angle is expressed. Valid values are
JCChartUtil.DEGREES
, JCChartUtil.GRADS
, or
JCChartUtil.RADIANS
.angle
- the angle for which the angle ratio is to be calculatedangleOrigin
- the angle offset for the chartclockwise
- true
if the angle values increase in the clockwise
direction
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |