|
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.chart3d.Anno
Internal class for JClass Chart 3D. This class calculates the annotation extents and also draws the annotation
Field Summary | |
protected com.klg.jclass.chart3d.JCChart3dArea |
area
The parent JCChart3dArea object |
protected Matrix4d |
axisMatrix
A matrix that is computed once per edge for a given axis and used for each label on the axis. |
protected Matrix4d |
compMatrix
Used to compute the annotation orientation for an axis (vertical or horizontal) based on whether the horizontal or vertical component of the axis is dominant. |
static double |
CUBE_SCALE
Used to translate font measurements to "cube" space (absolute space) |
protected boolean |
doPicking
If true, label picking is done instead of drawing |
protected Matrix4d |
edgeMatrix
The edge matrix is responsible for translating the annotation to the proper edge of the cube. |
protected Matrix4d |
justifyMatrix
The justify matrix positions the annotation so that it will not conflict with the tick-marks and is properly centered on the tick mark. |
protected Matrix4d |
matrix
A general utility matrix |
static int |
NUM_POINTS
Number of points in internal u point list |
static int |
NUM_VECTORS
Number of vectors in internal v vector list |
protected Matrix4d |
orientationMatrix
Calculates the orientation matrix. |
protected Point |
pickPoint
Point used for label picking |
protected Matrix4d |
planeMatrixInit
The plane matrix is used to help find the best annotation plane. |
protected com.klg.jclass.chart3d.JCValueLabel |
selectedLabel
The label that the pickPoint falls in (null if no label picked) |
static double |
TICK_PAD_FACTOR
The amount of space between the tick and the annotation as a fraction of the annotation height |
protected Point4d[] |
u
List of points used during calculations |
protected Vector3d[] |
v
List of vector objects used during calculations |
Constructor Summary | |
Anno()
No args constructor. |
|
Anno(com.klg.jclass.chart3d.JCChart3dArea area)
Contstructor which sets the parent JCChart3dArea. |
Method Summary | |
boolean |
adjustDataport(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
com.klg.jclass.chart3d.JCBox dataport,
int startEdge,
double scale,
boolean tight,
com.klg.jclass.chart3d.Justify justify,
double axisMin,
double axisMax)
Adjust the dataport for a given axis for annotation only if one of the four edges are annotated. |
protected void |
annoInit()
Resets often used matrices to null so that they don't contain any info that might have come from previous use. |
protected void |
bound3dAxis(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm,
com.klg.jclass.chart3d.Extents extents,
com.klg.jclass.chart3d.JCBox dataport)
Finds the extents of the given axis modifying the viewport bounds and dataport bounds as required. |
protected void |
boundBox(Matrix4d ctm,
double height,
double width,
com.klg.jclass.chart3d.Extents extents)
Finds the extents of the bounding box determined by the given height and width after it is transformed. |
protected void |
boundText(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm,
String text,
double offset,
com.klg.jclass.chart3d.Extents extents,
com.klg.jclass.chart3d.Justify justify)
Binds the given text relative to the cube based on the axis font |
protected void |
boundTitle(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm,
String text,
com.klg.jclass.chart3d.Extents extents,
com.klg.jclass.chart3d.Justify justify)
Binds the given title text relative to the cube based on the title font. |
protected void |
calc2dAnno(Graphics gc,
com.klg.jclass.chart3d.JCBox viewport,
com.klg.jclass.chart3d.JCBox dataport)
Calculates the extents of the annotation for 2D projection plots. |
protected void |
calc3dAnno(Graphics gc,
com.klg.jclass.chart3d.JCBox viewport,
com.klg.jclass.chart3d.JCBox dataport)
Calculates annotation extents for 3D plots (drawn with the Java 2D api). |
protected void |
calcAnno(Graphics gc,
com.klg.jclass.chart3d.JCBox viewport,
com.klg.jclass.chart3d.JCBox dataport)
Caculates annotation extents for either the 2D or 3D plots (drawn with the Java 2D api). |
protected void |
calcAxisBounds(com.klg.jclass.chart3d.JCAxis axis,
double fontSize,
double windowSize,
double scale,
boolean tight,
double min,
double max)
Calculates the tick increment and axis min. |
protected void |
cubeDrawString(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d m,
String text,
Color foreground,
boolean isTitle)
Transforms and draws string on the cube. |
double |
cubeTextWidth(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
String text,
boolean isTitle,
boolean haveAnno)
Finds the text width relative to the cube size. |
void |
determineVertical(int edge,
com.klg.jclass.chart3d.Justify justify)
Do we draw annotation parallel to the axis (vertical == false) or orthogonal to it (vertical == true) |
protected void |
draw2dAnno(Graphics gc)
Draws annotation for 2d projection plots |
protected void |
draw2dAxis(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm)
In 2d mode, draws the annotation for a given axis. |
void |
draw3dAnno(Graphics gc)
Draws annotation for 3d plots (drawn with the Java 2D api). |
protected void |
draw3dAxis(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm)
In 3d mode, draws the annotation for a given axis. |
protected void |
drawAnnotation(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
Matrix4d ctm,
com.klg.jclass.chart3d.JCValueLabel vLabel,
com.klg.jclass.chart3d.Justify justify,
double height,
double width)
Given a string and a transformation matrix, draws the tick and/or annotation based on information in the passed in value label. |
void |
extendAxisDataport(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis,
com.klg.jclass.chart3d.JCBox dataport,
double scale,
boolean tight,
boolean vertical,
double axisMin,
double axisMax)
If the annotation method is ANNOTATION_VALUES, the axis may need to get extended if the annotation overhangs the end of the axis. |
protected Point2d |
findAxisDxDy(int edge)
Finds the delta in x and y for a given edge based
on an axis. |
protected Point2d |
findEdgeDxDy(int edge)
Returns the delta in x and y for a given edge
(based on the current transformation). |
protected String |
formatAnno(double value,
int nfrac)
Given a value and an integer specifying the number of fractional digits to be used, returns a formatted string based on the value. |
com.klg.jclass.chart3d.JCChart3dArea |
getChart3dArea()
Gets the parent chart3d area. |
Matrix4d |
getEdgeMatrix(int edge)
Returns an edge matrix based on the given edge of the cube. |
Matrix4d |
getJustifyMatrix(double height,
double width,
com.klg.jclass.chart3d.Justify justify)
This method creates a justify matrix which positions the annotation so that it will not conflict with the tick-marks, etc. |
Matrix4d |
getOrientationMatrix(int edge,
com.klg.jclass.chart3d.Justify justify)
Calculates the orientation matrix. |
protected double |
guessLongestAnnotation(Graphics gc,
com.klg.jclass.chart3d.JCAxis axis)
Since the min/max values are not necessarily representative of the intermediate annotations, we assume that the step size will introduce at least 1 extra digit of precision. |
protected void |
initializePoints()
Initialize internal point array |
protected com.klg.jclass.chart3d.JCValueLabel |
pickLabel(Graphics gc,
Point p)
Check if a label has been selected by going thru the drawing mechanism |
void |
setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea area)
Sets the parent chart3d area. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double TICK_PAD_FACTOR
public static final double CUBE_SCALE
public static final int NUM_POINTS
public static final int NUM_VECTORS
protected Matrix4d orientationMatrix
protected Matrix4d edgeMatrix
protected Matrix4d justifyMatrix
protected Matrix4d planeMatrixInit
protected Matrix4d compMatrix
protected Matrix4d matrix
protected Matrix4d axisMatrix
protected Point4d[] u
protected Vector3d[] v
protected boolean doPicking
protected Point pickPoint
protected com.klg.jclass.chart3d.JCValueLabel selectedLabel
protected com.klg.jclass.chart3d.JCChart3dArea area
Constructor Detail |
public Anno()
public Anno(com.klg.jclass.chart3d.JCChart3dArea area)
area
- The parent JCChart3dAreaMethod Detail |
public com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
public void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea area)
area
- The new JCChart3dAreaprotected void initializePoints()
protected String formatAnno(double value, int nfrac)
value
- The value to be formattednfrac
- The number of fractional digits
public Matrix4d getEdgeMatrix(int edge)
edge
- The edge of the cube for which the edge Matrix is being
calculated
protected Point2d findEdgeDxDy(int edge)
x
and y
for a given edge
(based on the current transformation).
edge
- The edge of the cube for which the deltas are to be calculated
protected Point2d findAxisDxDy(int edge)
x
and y
for a given edge based
on an axis.
edge
- The edge of the cube for which the deltas are to be calculated
public Matrix4d getOrientationMatrix(int edge, com.klg.jclass.chart3d.Justify justify)
edgeMatrix
transformations have been applied.
Also computes, whether to rotate the annotation, whether its above or below
the axis, whether to flip the annotation in the Y direction, and whether to
spin the axis title. All this is stored in the justify object.
edge
- The edge of the cube for which the orientation plane needs to
be calculatedjustify
- The justify object where information computed by this method
is stored.
public Matrix4d getJustifyMatrix(double height, double width, com.klg.jclass.chart3d.Justify justify)
height
- The annotation heightwidth
- The annotation widthjustify
- The object which stores information like whether the
annotation is rotated, the annotation is above the axis, and if the
annotation is flipped in the y direction. It also stores the computed
easeway.
public double cubeTextWidth(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, String text, boolean isTitle, boolean haveAnno)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis the text is ontext
- The text whose width is to be computedisTitle
- Is this text from an axis title?haveAnno
- Have the annotations already been computed for this axis?
protected void cubeDrawString(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d m, String text, Color foreground, boolean isTitle)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis with which this string is associatedm
- The matrix with which to transform the shape determined by the
stringtext
- The string to drawisTitle
- Are we drawing the title?protected void drawAnnotation(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm, com.klg.jclass.chart3d.JCValueLabel vLabel, com.klg.jclass.chart3d.Justify justify, double height, double width)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis for which the annotation is to be drawnctm
- Current transformation matrix (used to position the annotation)vLabel
- The JCValueLabel object which stores the label, its background
and foreground colors, and other info on how to draw the labeljustify
- Object which has information about label positioningheight
- The height of the annotationwidth
- The width of the annotationprotected void boundBox(Matrix4d ctm, double height, double width, com.klg.jclass.chart3d.Extents extents)
ctm
- The current transformation matrixheight
- The height of the original "box"width
- The width of the original "box"extents
- The Extents object that stores the current viewport extentsprotected void boundText(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm, String text, double offset, com.klg.jclass.chart3d.Extents extents, com.klg.jclass.chart3d.Justify justify)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis that the given text is associated withctm
- The current transformation matrixtext
- The text to boundoffset
- The position offset along the axis for this textextents
- The Extents object that stores the current viewport extentsjustify
- Used to compute the justification matrix for this textprotected void boundTitle(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm, String text, com.klg.jclass.chart3d.Extents extents, com.klg.jclass.chart3d.Justify justify)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis associated with this titlectm
- The current transformation matrixtext
- The text for this titleextents
- The Extents object that stores the current viewport extentsjustify
- The Justify object that store whether to flip the title in the
X or Y direction.protected double guessLongestAnnotation(Graphics gc, com.klg.jclass.chart3d.JCAxis axis)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis to which the annotation belongs.protected void calcAxisBounds(com.klg.jclass.chart3d.JCAxis axis, double fontSize, double windowSize, double scale, boolean tight, double min, double max)
axis
- The axis to which this annotation belongsfontSize
- The font size (unit coord)windowSize
- The window size (unit coord) in approp. dimensionscale
- A scale for determining how many annotations on an axis. The
bigger the value the less annotations.tight
- We want tight bounds in the Z direction for barsmin
- The min value for this axismax
- The max value for this axispublic void determineVertical(int edge, com.klg.jclass.chart3d.Justify justify)
edge
- The edge/axis for which the annotation orientation is to be
determinedjustify
- Stores the results of orientation determinationpublic void extendAxisDataport(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, com.klg.jclass.chart3d.JCBox dataport, double scale, boolean tight, boolean vertical, double axisMin, double axisMax)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis whose dataport might be extenddataport
- The object which stores the current dataport extentsscale
- The axis normalized scaletight
- We want tight bounds in the Z direction for barsvertical
- Is the annotation orientation vertical or horizontal?axisMin
- The axis min valueaxisMax
- The axis max valuepublic boolean adjustDataport(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, com.klg.jclass.chart3d.JCBox dataport, int startEdge, double scale, boolean tight, com.klg.jclass.chart3d.Justify justify, double axisMin, double axisMax)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis whose dataport might be adjusteddataport
- The object which stores the current dataport extentsstartEdge
- The starting edge for this axisscale
- The axis normalized scaletight
- We want tight bounds in the Z direction for barsjustify
- Justify object that has the anno orientation information we needaxisMin
- The axis min valueaxisMax
- The axis max valueprotected void bound3dAxis(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm, com.klg.jclass.chart3d.Extents extents, com.klg.jclass.chart3d.JCBox dataport)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis to be boundedctm
- The current transformation matrixextents
- The current viewport extentsdataport
- The current cube dataportprotected void draw3dAxis(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis to be drawnctm
- The current transformation matrixprotected void draw2dAxis(Graphics gc, com.klg.jclass.chart3d.JCAxis axis, Matrix4d ctm)
gc
- The graphics object to use for drawing and getting font infoaxis
- The axis to be drawnctm
- The current transformation matrixprotected void annoInit()
protected void calcAnno(Graphics gc, com.klg.jclass.chart3d.JCBox viewport, com.klg.jclass.chart3d.JCBox dataport)
gc
- The graphics object to use for drawing and getting font infoviewport
- The rectangular viewport into which the graph is to be drawndataport
- The cube's data extentsprotected void calc3dAnno(Graphics gc, com.klg.jclass.chart3d.JCBox viewport, com.klg.jclass.chart3d.JCBox dataport)
gc
- The graphics object to use for drawing and getting font infoviewport
- The rectangular viewport into which the graph is to be drawndataport
- The cube's data extentspublic void draw3dAnno(Graphics gc)
gc
- The graphics object to use for drawing and getting font infoprotected void calc2dAnno(Graphics gc, com.klg.jclass.chart3d.JCBox viewport, com.klg.jclass.chart3d.JCBox dataport)
gc
- The graphics object to use for drawing and getting font infoviewport
- The rectangular viewport into which the graph is to be drawndataport
- The cube's data extentsprotected void draw2dAnno(Graphics gc)
gc
- The graphics object to use for drawing and getting font infoprotected com.klg.jclass.chart3d.JCValueLabel pickLabel(Graphics gc, Point p)
p
- The point to check against the labels
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |