JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class Chart3dAnnoHandler

java.lang.Object
  |
  +--com.klg.jclass.chart3d.Chart3dAnnoHandler
All Implemented Interfaces:
Comparator, Serializable

public class Chart3dAnnoHandler
extends Object
implements Comparator, Serializable

Class that handles annotations for a given JCAxis.

See Also:
Serialized Form

Field Summary
protected  double annoHeight
          The maximum annotation height for the current valueLabel list.
protected  double annoShift
          The annotation shift for the current valueLabel list
protected  com.klg.jclass.chart3d.JCAxis axis
          The parent JCAxis object
protected  ArrayList userValueLabels
          User value labels list.
protected  ArrayList valueLabels
          ArrayList of JCValueLabel instances.
 
Constructor Summary
Chart3dAnnoHandler(com.klg.jclass.chart3d.JCAxis axis)
          Constructor that sets the parent JCAxis object.
 
Method Summary
protected  void calcAnnoHeight(Graphics gc)
          Calculates the maximum annotation height for this axis
 int compare(Object o1, Object o2)
          JCValueLabel sorting routine.
 double getAnnoHeight()
          Gets the maximum annotation height for the current valueLabel list.
 double getAnnoShift()
          Gets the annotation shift for the current valueLabel list.
protected  com.klg.jclass.chart3d.JCAxis getAxis()
          Gets the parent JCAxis object.
protected  com.klg.jclass.chart3d.JCValueLabel getLabelFromValue(double value, boolean labelDrawn, boolean tickDrawn, boolean minorTick, boolean useLabelGenerator)
          Makes a formatted value label given a value.
protected  ArrayList getUserValueLabels()
          Returns the user value label list.
 ArrayList getValueLabels()
          Gets the internally generated value labels.
protected  void makeAnnotations(Graphics gc, com.klg.jclass.chart3d.Anno anno)
          Creates the axis annotations for display.
protected  void setUserValueLabels(ArrayList userValueLabels)
          Sets the user value label list.
protected  void sortValueLabels()
          Sorts user-provided value labels so that they are in increasing order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

valueLabels

protected ArrayList valueLabels
ArrayList of JCValueLabel instances.


userValueLabels

protected ArrayList userValueLabels
User value labels list.


annoHeight

protected double annoHeight
The maximum annotation height for the current valueLabel list.


annoShift

protected double annoShift
The annotation shift for the current valueLabel list


axis

protected com.klg.jclass.chart3d.JCAxis axis
The parent JCAxis object

Constructor Detail

Chart3dAnnoHandler

public Chart3dAnnoHandler(com.klg.jclass.chart3d.JCAxis axis)
Constructor that sets the parent JCAxis object.

Parameters:
axis - The parent JCAxis object
Method Detail

getAxis

protected com.klg.jclass.chart3d.JCAxis getAxis()
Gets the parent JCAxis object.

Returns:
The JCAxis parent

getValueLabels

public ArrayList getValueLabels()
Gets the internally generated value labels. If the annotationMethod of the parent axis is ANNOTATION_VALUE_LABELS, this list will hold the same value labels as the user value label list.

Returns:
The internally generated value labels.

getUserValueLabels

protected ArrayList getUserValueLabels()
Returns the user value label list. This is an array list that holds the user list of value labels, either passed in all at once, or added one at a time.

Returns:
The user value label list.

setUserValueLabels

protected void setUserValueLabels(ArrayList userValueLabels)
Sets the user value label list. Sorts them so they are in increasing order.

Parameters:
userValueLabels - The new userValueLabel list.

getAnnoHeight

public double getAnnoHeight()
Gets the maximum annotation height for the current valueLabel list.

Returns:
The maximum annotation height.

getAnnoShift

public double getAnnoShift()
Gets the annotation shift for the current valueLabel list.

Returns:
The annotation shift.

sortValueLabels

protected void sortValueLabels()
Sorts user-provided value labels so that they are in increasing order.


compare

public int compare(Object o1,
                   Object o2)
JCValueLabel sorting routine.

Specified by:
compare in interface Comparator
Parameters:
o1 - The first value label
o2 - The second value label
Returns:
Return whether first label is less than (negative), greater than (positive), or equal to (zero) the second label.

calcAnnoHeight

protected void calcAnnoHeight(Graphics gc)
Calculates the maximum annotation height for this axis

Parameters:
gc - Graphics context needed for font information

makeAnnotations

protected void makeAnnotations(Graphics gc,
                               com.klg.jclass.chart3d.Anno anno)
Creates the axis annotations for display. The axis annotations are stored internally as an ArrayList of JCValueLabel objects. Each JCValueLabel represents a label and/or tick at a particular value along the axis.

Parameters:
gc - Graphics context needed to calculate annotation font information
anno - The Anno object for which the labels are to be generated.

getLabelFromValue

protected com.klg.jclass.chart3d.JCValueLabel getLabelFromValue(double value,
                                                                boolean labelDrawn,
                                                                boolean tickDrawn,
                                                                boolean minorTick,
                                                                boolean useLabelGenerator)
Makes a formatted value label given a value. If a label generator has been specified and useLabelGenerator is true, allow it to modify the value label before returning.

Parameters:
value - The value for which the label is to be generated
labelDrawn - Is the label drawn for the returned value label?
tickDrawn - Is the tick drawn for the returned value label?
minorTick - Minor or Major tick for the returned value label?
useLabelGenerator - Call the user supplied label generator for this value label.

Copyright © 2004 Quest Software Inc..
All rights reserved.