JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCAxis

java.lang.Object
  |
  +--com.klg.jclass.chart.TrackChange
        |
        +--com.klg.jclass.chart.ChartInteriorRegion
              |
              +--com.klg.jclass.chart.JCAxis
All Implemented Interfaces:
Changeable, Changeable, com.klg.jclass.chart.Drawable, com.klg.jclass.util.JCName, Serializable

public class JCAxis
extends ChartInteriorRegion
implements Serializable

Class controlling all attributes relating to rendering axes.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.chart.AnnotationHandler annoHandler
          Handler for code specific to axis annotations.
protected  List annoList
          List of JCAnno objects.
protected  int annotationMethod
          AnnotationMethod property, determines how the axis is labelled
protected  int annotationRotation
          Rotation of axis annotations.
protected  double annotationRotationAngle
          Label rotation in radians
static int AUTOMATIC
          Enum value for automatic origin placement.
protected  com.klg.jclass.chart.JCChartArea chartArea
          Pointer to the parent chart area
protected  int chartType
          The type of the chart this axis is associated with.
protected  com.klg.jclass.chart.MinMax dataLimits
          The mininum and maximum value of data being plotted against this axis.
static long DAYS
          Enums for TimeUnit property representing value of days.
protected  boolean decimalPadded
          True if decimals in annotations should be padded with zeroes.
protected  com.klg.jclass.chart.DerivedInt degreeGradPrecision
          Object that holds the numbering precision for a Polar chart x axis when the angle unit is DEGREES or GRADS.
protected  boolean editable
          True if axis is editable.
protected  com.klg.jclass.chart.JCAxisFormula formula
          Formula used to define axis relationships.
protected  int gap
          Property that controls the gap between visible value labels, in pixels.
protected  boolean gridDefault
           
protected  List gridList
          List of JCGrid objects.
protected  boolean gridVisible
          True is grid lines are visible.
static long HOURS
          Enums for TimeUnit property representing value of hours.
protected  boolean i_vertical
          Internal flag
protected  boolean isPrimary
          True if this is the primary axis for this chart.
 boolean isTimeBaseSet
          True if the user has explicitly set the time base value.
protected  com.klg.jclass.chart.JCLabelGenerator labelGenerator
          Generator for custom annotations.
protected  Locale locale
          Locale for this axis.
protected  boolean logarithmic
          True if axis is logarithmic.
protected  com.klg.jclass.chart.Mapper mapper
          Used for point label image mapping.
protected  com.klg.jclass.chart.DerivedDouble max
          Axis maxiumum.
static int MAX
          Enum value for origin placement at axis maximum.
protected static int MAX_PRECISION
          The default maximum precision.
protected  int maximumPrecision
          The maximum value the axis precision can have.
protected  com.klg.jclass.chart.DerivedDouble min
          Axis miniumum.
static int MIN
          Enum value for origin placement at axis minimum.
static long MINUTES
          Enums for TimeUnit property representing value of minutes.
static long MONTHS
          Enums for TimeUnit property representing value of months.
protected  com.klg.jclass.chart.DerivedDouble numSpacing
          Object that holds the axis numbering spacing specified by the user
protected  com.klg.jclass.chart.DerivedDouble origin
          Axis origin.
static int ORIGIN
          Enum value for origin placement at axis origin.
protected  com.klg.jclass.chart.DerivedInt originPlacement
          Placement of origin on axis.
protected  com.klg.jclass.chart.JCAxis otherAxis
          The other axis associated with this axis.
protected  com.klg.jclass.chart.DerivedInt placement
          Placement of axis with respect to another axis.
protected  com.klg.jclass.chart.JCAxis placementAxis
          Axis to place this axis on.
protected  double placementLocation
          Location on placementAxis where this axis is placed.
static int POINT_LABELS
          Enum value representing point label annotations.
protected  com.klg.jclass.chart.PolarAxisParams polarAxisParams
           
protected  com.klg.jclass.chart.DerivedInt precision
          Object that holds the axis numbering precision specified by the user
protected  com.klg.jclass.chart.DerivedInt radianPrecision
          Object that holds the numbering precision for a Polar chart x axis when the angle unit is RADIANS.
protected  boolean reversed
          True if axis is reversed.
static int ROTATE_180
          Enum value representing a rotation of 180 degrees.
static int ROTATE_270
          Enum value representing a rotation of 270 degrees.
static int ROTATE_90
          Enum value representing a rotation of 90 degrees.
static int ROTATE_NONE
          Enum value representing no rotation.
static int ROTATE_OTHER
          Enum value representing a rotation specified by annotationRotationAngle.
protected  int savedXAxisAnnotationMethod
          Local copy of x axis annotation method.
static long SECONDS
          Enums for TimeUnit property representing value of seconds.
protected  Polygon sideplane
          The polygon that defines the axis trough.
protected  double step
          Internal property that tracks the data space tick spacing
protected  int tickLength
          Internal property specifying the length of the tick marks in pixels
protected  com.klg.jclass.chart.DerivedDouble tickSpacing
          Object that holds the axis tick spacing specified by the user
static int TIME_LABELS
          Enum value representing time label annotations.
protected  Date timeBase
          Base time used for time labels.
protected  com.klg.jclass.chart.DerivedString timeFormat
          Format used in displaying time labels.
protected  long timeUnit
          Time unit used for time labels.
protected  TimeZone timeZone
          TimeZone for this axis.
protected  com.klg.jclass.chart.JCAxisTitle title
          The axis title.
protected  boolean useAnnoTicks
          If true, and the annotation method is TIME_LABELS, POINT_LABELS, or VALUE_LABELS, draw ticks specified by all the JCAnno objects.
protected  boolean usingDoublePixels
           
static int VALUE
          Enum value representing value annotations.
static int VALUE_ANCHORED
          Enum value for origin placement at a particular axis value.
static int VALUE_LABELS
          Enum value representing value label annotations.
protected  boolean vertical
          True if axis is vertical.
static long WEEKS
          Enums for TimeUnit property representing value of weeks.
protected  double yAxisAngle
          Angle (in RADIANS) of y axis in a Polar chart.
static long YEARS
          Enums for TimeUnit property representing value of years.
static int ZERO
          Enum value for origin placement at axis zero.
 
Fields inherited from class com.klg.jclass.chart.ChartInteriorRegion
background, dimIsDefaultChangedToTrue, font, foreground, groupingUsed, height, insets, inUpdate, left, name, needsRepaint, numberLocalization, parentChart, parentRegion, top, transparent, updateParent, visible, width
 
Fields inherited from class com.klg.jclass.chart.TrackChange
changed, changedFlag
 
Fields inherited from interface com.klg.jclass.chart.Changeable
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW
 
Fields inherited from interface com.klg.jclass.util.Changeable
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Constructor Summary
JCAxis()
          Default constructor
JCAxis(com.klg.jclass.chart.JCChartArea parent, boolean vert, int meth)
          Constructs a JCAxis object given the parent JCChartArea and a boolean indicating whether the axis is vertical or horizontal.
JCAxis(Locale locale)
          Default constructor with locale.
 
Method Summary
 void addAnnotation(com.klg.jclass.chart.JCAnno anno)
          Adds a JCAnno object to this axis.
 void addDefaultLabels()
          Intended for internal use.
 void addDefaultTicks()
          Intended for internal use.
 void addGrid(com.klg.jclass.chart.JCGrid grid)
          Adds a JCGrid object to this axis.
 void addValueLabel(com.klg.jclass.chart.JCValueLabel vl)
          Adds the provided value label to the list of value labels.
protected  void adjustCenterAndRadius(int xOffset, int yOffset, int radiusDelta)
          Adjusts the position and size of a Polar/Radar chart to keep all of the annotation within view.
protected  double applyDataToPixelScaling(double dataValue)
          Convert from data to pixel units (i.e., apply scaling factor only, no translation).
protected  double applyPixelToDataScaling(double pixels)
          Convert from pixel to data units (i.e., apply scaling factor only, no translation).
 boolean containsAnnotation(com.klg.jclass.chart.JCAnno anno)
          Determines if the specified JCAnno has already been added to the axis.
 boolean containsAnnotation(String annoName)
          Determines if a JCAnno with the specified name has already been added to the axis.
 boolean containsGrid(com.klg.jclass.chart.JCGrid grid)
          Determines if the specified JCGrid has already been added to the axis.
 boolean containsGrid(String gridName)
          Determines if a JCGrid with the specified name has already been added to the axis.
 double dateToValue(Date d)
          Converts a date to a value along this axis, taking into consideration the current TimeBase and TimeUnit properties.
 void draw(Graphics gc)
          Overrides ChartInteriorRegion.draw() to ensure that a border is not drawn around the axis.
 void drawAnnotationsAndTitle(Graphics gc)
           
 void drawAnnotationsAndTitle(Graphics gc, boolean drawAnno, boolean drawTitle)
           
protected  void drawGridLineInTrough(Graphics gc, com.klg.jclass.chart.JCLineStyle ls, double v)
          Draw a grid line in the axis trough.
protected  void drawRadialGridLine(Graphics gc, double angle)
          Draws a radial line of length radius at the specified angle.
protected  void drawWebLine(Graphics gc, com.klg.jclass.chart.JCLineStyle ls, double r, int nSpokes)
           
protected  com.klg.jclass.chart.JCAnno getAnnoObject(int type)
          This method searches an internal List for a JCAnno object of the specified type.
 com.klg.jclass.chart.AnnotationHandler getAnnotationHandler()
          Gets the AnnotationHandler for this axis
 List getAnnotationList()
          Returns the List of JCAnno objects that have been set on this axis.
 int getAnnotationMethod()
          Gets the value of the AnnotationMethod property.
 int getAnnotationRotation()
          Gets the AnnotationRotation property of JCAxis.
 double getAnnotationRotationAngle(int angleUnit)
          Returns the AnnotationRotationAngle property of JCAxis.
 Color getBackground()
          Gets the background color of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance and region is opaque, and set on parent JCChart instance and chart is opaque.
 com.klg.jclass.chart.JCChartArea getChartArea()
          Gets the parent region JCChartArea instance.
 com.klg.jclass.chart.JCGrid getDefaultGrid()
          For internal use only.
 com.klg.jclass.chart.JCAnno getDefaultLabels()
          For internal use only.
 com.klg.jclass.chart.JCAnno getDefaultTicks()
          For internal use only.
 Font getFont()
          Gets the font property of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance, and set on parent JCChart instance.
 Color getForeground()
          Gets the foreground color of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance, and set on parent JCChart instance.
 com.klg.jclass.chart.JCAxisFormula getFormula()
          Retrieves the JCAxisFormula object, which specifies a relationship between this JCAxis object and another JCAxis object.
 int getGap()
          Gets the value of the Gap property.
 com.klg.jclass.chart.JCValueLabel getGeneratedValueLabel(double val)
          Retrieves the value label for the specified value from the list of value labels generated for this axis.
 com.klg.jclass.chart.JCValueLabel[] getGeneratedValueLabels()
          Gets the list of value labels generated for this axis.
 com.klg.jclass.chart.JCValueLabel getGeneratedValueLabels(int indx)
          Gets the value label at the specified index in the list of value labels generated for this axis.
 com.klg.jclass.chart.JCGrid getGrid(int index)
          This method returns the JCGrid object at the specified index.
protected  double[] getGridLineList()
          Gets a list of the axis positions that grid lines have to be drawn at.
 List getGridList()
          Returns the List of JCGrid objects.
 double getGridSpacing()
          Gets the GridSpacing property of the first JCGrid object.
 boolean getGridSpacingIsDefault()
          Gets the isDefault property of the first JCGrid object on this axis.
 com.klg.jclass.chart.JCChartStyle getGridStyle()
          Gets the GridStyle property of the first JCGrid object on this axis.
 com.klg.jclass.chart.JCLabelGenerator getLabelGenerator()
          Gets the value of the LabelGenerator property.
 Locale getLocale()
          Retrieve the locale for this axis.
 com.klg.jclass.chart.Mapper getMapper()
          Get the current image map mapper.
 double getMax()
          Gets the Max property of the axis, which controls the maximum value shown on the axis.
 boolean getMaxIsDefault()
          Gets the MaxIsDefault property.
 int getMaxPrecision()
          Gets the MaxPrecision property of the Axis, which controls the maximum value of the Precision property.
protected  int getMaxTickOuterExtent()
          This method returns the maximum outer extent of tick marks on this axis.
 double getMin()
          Gets the Min property of the JCAxis, which controls the minimum value shown on the axis.
 boolean getMinIsDefault()
          Gets the MinIsDefault property.
 double getNumSpacing()
          Gets the NumSpacing property of the Axis, which controls the interval between axis labels.
 boolean getNumSpacingIsDefault()
          Gets the NumSpacingIsDefault property of JCAxis.
 double getOrigin()
          Gets the Origin property of the Axis, which controls the location of the origin along the axis.
 double getOriginBase(int units)
          Method to get the angle of the theta axis origin.
 boolean getOriginIsDefault()
          Gets the OriginIsDefault property.
 int getOriginPlacement()
          Gets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.
 boolean getOriginPlacementIsDefault()
          Gets the OriginPlacementIsDefault property.
 int getPlacement()
          Gets the Placement property of the JCAxis, which controls where the axis is placed.
 com.klg.jclass.chart.JCAxis getPlacementAxis()
          Gets the PlacementAxis property of the axis.
 boolean getPlacementIsDefault()
          Gets the PlacementIsDefault property.
 double getPlacementLocation()
          Gets the value of the PlacementLocation property.
protected  com.klg.jclass.chart.AnnoBoundsInfo getPolarAnnotationBounds()
          Returns an AnnoBoundsInfo object for this axis.
protected  com.klg.jclass.chart.PolarAxisParams getPolarAxisParams()
           
 Point2D.Double getPolarRadarCenter()
          Gets the center of the plot area for polar/radar charts.
 double getPolarRadarRadius()
          Gets the radius of the plot area for polar/radar charts.
 int getPrecision()
          Gets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.
 boolean getPrecisionIsDefault()
          Gets the PrecisionIsDefault property of JCAxis.
protected  int getThetaAxisLabelOffset()
          Returns the pixel distance between the theta axis and a theta axis label in a Polar/Radar chart.
 double getTickSpacing()
          Gets the TickSpacing property, which controls the interval between tick lines on the axis.
 boolean getTickSpacingIsDefault()
          Gets the TickSpacingIsDefault property of JCAxis.
 Date getTimeBase()
          Gets the value of the TimeBase property.
 String getTimeFormat()
          Gets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.
 boolean getTimeFormatIsDefault()
          Gets the value of the TimeFormatIsDefault property.
 long getTimeUnit()
          Gets the value of the TimeUnit property.
 TimeZone getTimeZone()
          Retrieve the time zone for this axis.
 com.klg.jclass.chart.JCAxisTitle getTitle()
          Retrieves the JCAxisTitle object, which controls the appearance of the axis title.
 boolean getUseAnnoTicks()
          This method returns the value of the useAnnoTicks flag.
 Vector getUserValueLabels()
          Intended for internal use only.
 com.klg.jclass.chart.JCValueLabel getValueLabel(double val)
          Retrieves the value label for the specified value from the list of user-specified value labels.
 com.klg.jclass.chart.JCValueLabel[] getValueLabels()
          Gets the value of the ValueLabels property.
 com.klg.jclass.chart.JCValueLabel getValueLabels(int indx)
          Gets the value of the ValueLabels property at a specified index.
 double getYAxisAngle(int units)
          Method to get the angle of the y axis in a Polar/Radar chart.
 boolean isAnnotationVisible()
          Gets the value of the annotationVisible property.
 boolean isBar()
          Internal methods
protected  boolean isBottomSide()
          Returns true if the axis is on the bottom of the chart.
 boolean isDecimalPadded()
          Gets the DecimalPadded property.
 boolean isEditable()
          Gets the Editable property.
 boolean isGridDefault()
           
 boolean isGridVisible()
          Gets the value of the GridVisible property.
 boolean isHalfRange()
          Method to get the half range flag for Polar charts.
protected  boolean isLeftSide()
          Returns true if the axis is on the left side of the chart.
 boolean isLogarithmic()
          Gets the Logarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).
 boolean isPolar()
          Is the chart a polar plot?
 boolean isPolarRadar()
          Is the chart a polar or radar plot?
protected  boolean isPolarRadar(int type)
           
 boolean isRadar()
          Is the chart a radar plot?
 boolean isRadarCircularGrid()
          Gets the state of the circular flag for Radar chart grid lines.
 boolean isReversed()
          Gets the Reversed property of JCAxis, which determines if the axis order is reversed.
protected  boolean isRightSide()
          Returns true if the axis is on the right side of the chart.
protected  boolean isTopSide()
          Returns true if the axis is on the top of the chart.
 boolean isVertical()
          Gets the value of the Vertical property.
protected  void layoutPolarAxis()
          Axis layout for Polar or Radar charts.
protected  void makeDefaultAnnotations()
          Create default JCAnno objects.
protected  void makeTickLabels()
          If the annotation method is VALUE or if the useAnnoTicks flag is set, iterate through the list of JCAnno objects and create JCValueLabels for the tick marks defined by each JCAnno.
 void recalc()
          Recalculates the axis parameters.
 void removeAllAnnotations()
          Removes all JCAnno objects from the internal List.
 void removeAllGrids()
           
 void removeAnnotation(int index)
          Removes the JCAnno object at the specified index from this axis.
 void removeAnnotation(com.klg.jclass.chart.JCAnno anno)
          Removes the specified JCAnno object from this axis.
 void removeDefaultGrid()
          For internal use only.
 void removeDefaultLabels()
          For internal use only.
 void removeDefaultTicks()
          For internal use only.
 void removeGrid(int index)
          Removes the JCGrid object at the specified index from this axis.
 void removeGrid(com.klg.jclass.chart.JCGrid grid)
          Removes the specified JCGrid object from this axis.
 void removeValueLabel(int index)
          Intended for internal use only.
 void setAnnotationList(List annoList)
          Sets a List of JCAnno objects on this axis.
 void setAnnotationMethod(int newMethod)
          Sets the value of the AnnotationMethod property.
 void setAnnotationRotation(int rot)
          Sets the AnnotationRotation property of JCAxis.
 void setAnnotationRotationAngle(int angleUnit, double rotationAngle)
          Sets the AnnotationRotationAngle property of JCAxis.
 void setAnnotationVisible(boolean visible)
          Sets the value of the annotationVisible property.
 void setBounds(int newx, int newy, int neww, int newh)
          Overridden setBounds() method that makes sure the scale and shift values are recalculated when the axis size or position changes.
 void setDecimalPadded(boolean b)
          Sets the DecimalPadded property.
 void setEditable(boolean b)
          Sets the Editable property.
 void setGap(int gp)
          Sets the value of the Gap property.
 void setGridDefault(boolean isDefault)
          Sets the value of the gridDefault property.
 void setGridSpacing(double space)
          Sets the GridSpacing property of the first JCGrid object on this axis.
 void setGridSpacingIsDefault(boolean useDef)
          Sets the isDefault property of the first JCGrid object on this axis.
 void setGridStyle(com.klg.jclass.chart.JCChartStyle style)
          Sets the GridStyle property of the first JCGrid object on this axis.
 void setGridVisible(boolean isGridVisible)
          Sets the value of the GridVisible property.
 void setHalfRange(boolean fHalfRange)
          Method to set the half range flag for Polar charts.
 void setLabelGenerator(com.klg.jclass.chart.JCLabelGenerator lg)
          Sets the value of the LabelGenerator property.
 void setLocale(Locale locale)
          Set the locale for this axis.
 void setLogarithmic(boolean log)
          Sets the Logarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).
 void setMapper(com.klg.jclass.chart.Mapper mapper)
          Set the current image map mapper.
 void setMax(double nmax)
          Sets the Max property of the axis, which controls the maximum value shown on the axis.
 void setMaxIsDefault(boolean useDef)
          Sets the MaxIsDefault property.
 void setMaxPrecision(int maxprec)
          Sets the MaxPrecision property of the Axis, which controls the maximum value of the Precision property.
 void setMin(double nmin)
          Sets the Min property of the JCAxis, which controls the minimum value shown on the axis.
 void setMinIsDefault(boolean useDef)
          Sets the MinIsDefault property.
 void setNumSpacing(double inc)
          Sets the NumSpacing property of the Axis, which controls the number interval of the axis labels.
 void setNumSpacingIsDefault(boolean useDef)
          Sets the NumSpacingIsDefault property of JCAxis.
 void setOrigin(double oval)
          Sets the Origin property of the Axis, which controls the location of the origin along the axis.
 void setOriginBase(int units, double angle)
          Method to set the angle of the theta axis origin.
 void setOriginIsDefault(boolean useDef)
          Sets the OriginIsDefault property.
 void setOriginPlacement(int place)
          Sets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.
 void setOriginPlacementIsDefault(boolean useDef)
          Sets the OriginPlacementIsDefault property.
 void setParentChart(com.klg.jclass.chart.JCChart p)
          Sets the parent chart of this axis.
 void setPlacement(int place)
          Sets the Placement property of the JCAxis, which controls where the axis is placed.
 void setPlacement(com.klg.jclass.chart.JCAxis ax)
          Convenience method that sets the Placement property to ORIGIN, and sets the PlacementAxis property to the provided value
 void setPlacement(com.klg.jclass.chart.JCAxis ax, double v)
          Convenience method that sets the Placement property to VALUE_ANCHORED, the PlacementAxis property to the provided axis, and the PlacementLocation property to the provided floating- point value.
 void setPlacementAxis(com.klg.jclass.chart.JCAxis ax)
          Sets the PlacementAxis property of the axis.
 void setPlacementIsDefault(boolean useDef)
          Sets the PlacementIsDefault property.
 void setPlacementLocation(double v)
          Sets the value of the PlacementLocation property.
protected  void setPolarAxisParams(com.klg.jclass.chart.PolarAxisParams axisParams)
           
 void setPrecision(int prec)
          Sets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.
protected  void setPrecisionInternal(int prec)
           
 void setPrecisionIsDefault(boolean useDef)
          Sets the PrecisionIsDefault property of JCAxis.
 void setRadarCircularGrid(boolean fCircular)
          Makes the y grid lines of a Radar chart circular.
 void setReversed(boolean rev)
          Sets the Reversed property of JCAxis, which determines if the axis order is reversed.
 void setTickSpacing(double tick)
          Sets the TickSpacing property, which controls the interval between tick lines on the axis.
 void setTickSpacingIsDefault(boolean useDef)
          Sets the TickSpacingIsDefault property of JCAxis.
 void setTimeBase(Date nb)
          Sets the value of the TimeBase property.
 void setTimeFormat(String tf)
          Sets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.
 void setTimeFormat(String tf, boolean update)
          Sets the value of the TimeFormat property and recalcs as specified.
 void setTimeFormatIsDefault(boolean ud)
          Sets the value of the TimeFormatIsDefault property.
 void setTimeFormatIsDefault(boolean ud, boolean update)
          Sets the value of the TimeFormatIsDefault property and recalcs as specified.
 void setTimeUnit(long tu)
          Sets the value of the TimeUnit property.
 void setTimeZone(TimeZone timeZone)
          Set the time zone for formatting.
 void setTitle(com.klg.jclass.chart.JCAxisTitle props)
          Sets the JCAxisTitle object associated with the JCAxis.
 void setUseAnnoTicks(boolean useAnnoTicks)
          This method is used to set the value of the useAnnoTicks flag.
 void setValueLabels(int index, com.klg.jclass.chart.JCValueLabel vl)
          Sets the value of one one value label in the ValueLabels property.
 void setValueLabels(com.klg.jclass.chart.JCValueLabel[] vl)
          Sets the value of the ValueLabels property.
 void setVertical(boolean v)
          Sets the value of the Vertical property.
protected  void setVerticalInternal(boolean v)
           
 void setYAxisAngle(int units, double angle)
          Method to set the angle of the y axis in a Polar/Radar chart.
 String timeBaseToString(boolean useTimeFormat)
          Convert the time base to a time label string.
 double toData(int v)
          Converts a pixel value relative to the parent JCChartArea to a value in the data space.
 double toData(int v, boolean drawFront)
          Converts a pixel value relative to the parent JCChartArea to a value in the data space, first shifting the value from the front or back plane of the chart to the plane that holds this axis.
 com.klg.jclass.chart.JCDataCoord toDataPolar(int x, int y)
          Converts a pixel value relative to the parent JCChartArea to a value in the data space.
 int toPixel(double v)
          Converts a data value along the axis to a pixel value.
 int toPixel(double v, boolean drawFront)
          Converts a data value along the axis to a pixel value, shifting the value to the front or back plane of the chart from the plane this axis is on.
 double toPixelDouble(double v)
          Converts a data value along the axis to a pixel value.
 double toPixelDouble(double v, boolean drawFront)
          Converts a data value along the axis to a pixel value, shifting the value to the front or back plane of the chart from the plane this axis is on.
 Point toPixelPolar(double angle, double r, boolean convertDataToPixel)
          Converts polar data (angle,radius) to pixel (x,y) coordinates.
 String toString()
          String representation of the axis.
protected  void updateAnnoDefaultPrecision(int chartType)
          This method is invoked by the setChartType() method of ChartDataView.
protected  void updateAnnoDefPrecision(int prec)
          This method updates the default precision of the DEFAULT_LABELS JCAnno object.
protected  void updateAnnoHandler(int type)
          This method instantiates either an AnnotationHandler or a CircularChartAnnoHandler depending on the chart type parameter.
protected  void updateAnnotations()
          At the end of the layout process, update the default start, stop, and increment values of tick objects.
protected  void updateGridObject(com.klg.jclass.chart.JCGrid chartGrid, double start, double stop, double increment)
           
protected  void updateGrids()
           
 Date valueToDate(double v)
          Converts a value along this axis to a Date, taking into consideration the current TimeBase and TimeUnit properties.
 
Methods inherited from class com.klg.jclass.chart.ChartInteriorRegion
getDrawingArea, getDrawingArea, getGraphics, getGroupingUsed, getHeight, getHeightIsDefault, getInsets, getLeft, getLeftIsDefault, getName, getNumberFormatter, getNumberLocalization, getParentChart, getParentRegion, getSize, getTop, getTopIsDefault, getWidth, getWidthIsDefault, hide, insets, inside, isVisible, location, preferredSize, repaint, setBackground, setChanged, setChanged, setFont, setForeground, setGroupingUsed, setHeight, setHeightIsDefault, setInsets, setLeft, setLeftIsDefault, setLocation, setName, setNumberFormatterLocale, setNumberLocalization, setParentRegion, setSize, setTop, setTopIsDefault, setVisible, setWidth, setWidthIsDefault, show, size, sizeChanged, updateParent
 
Methods inherited from class com.klg.jclass.chart.TrackChange
getChanged, getChanged, isBatched, isChanged, isChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gap

protected int gap
Property that controls the gap between visible value labels, in pixels.


title

protected com.klg.jclass.chart.JCAxisTitle title
The axis title.


min

protected com.klg.jclass.chart.DerivedDouble min
Axis miniumum.


max

protected com.klg.jclass.chart.DerivedDouble max
Axis maxiumum.


origin

protected com.klg.jclass.chart.DerivedDouble origin
Axis origin.


originPlacement

protected com.klg.jclass.chart.DerivedInt originPlacement
Placement of origin on axis.


placement

protected com.klg.jclass.chart.DerivedInt placement
Placement of axis with respect to another axis.


gridVisible

protected boolean gridVisible
True is grid lines are visible. False otherwise.


formula

protected com.klg.jclass.chart.JCAxisFormula formula
Formula used to define axis relationships.


editable

protected boolean editable
True if axis is editable.


logarithmic

protected boolean logarithmic
True if axis is logarithmic.


reversed

protected boolean reversed
True if axis is reversed.


vertical

protected boolean vertical
True if axis is vertical.


i_vertical

protected boolean i_vertical
Internal flag


annotationRotation

protected int annotationRotation
Rotation of axis annotations. Value should be one ROTATE_NONE, ROTATE_90, ROTATE_180, ROTATE_270.


placementAxis

protected com.klg.jclass.chart.JCAxis placementAxis
Axis to place this axis on.


placementLocation

protected double placementLocation
Location on placementAxis where this axis is placed.


labelGenerator

protected com.klg.jclass.chart.JCLabelGenerator labelGenerator
Generator for custom annotations.


decimalPadded

protected boolean decimalPadded
True if decimals in annotations should be padded with zeroes.


savedXAxisAnnotationMethod

protected int savedXAxisAnnotationMethod
Local copy of x axis annotation method.


timeUnit

protected long timeUnit
Time unit used for time labels.


timeFormat

protected com.klg.jclass.chart.DerivedString timeFormat
Format used in displaying time labels.


timeBase

protected Date timeBase
Base time used for time labels.


isTimeBaseSet

public boolean isTimeBaseSet
True if the user has explicitly set the time base value. Gets reset if the user sets the time base to null.


sideplane

protected Polygon sideplane
The polygon that defines the axis trough.


tickLength

protected int tickLength
Internal property specifying the length of the tick marks in pixels


chartArea

protected com.klg.jclass.chart.JCChartArea chartArea
Pointer to the parent chart area


locale

protected Locale locale
Locale for this axis.


timeZone

protected TimeZone timeZone
TimeZone for this axis. Used only for time labels.


step

protected double step
Internal property that tracks the data space tick spacing


SECONDS

public static final long SECONDS
Enums for TimeUnit property representing value of seconds.

See Also:
Constant Field Values

MINUTES

public static final long MINUTES
Enums for TimeUnit property representing value of minutes.

See Also:
Constant Field Values

HOURS

public static final long HOURS
Enums for TimeUnit property representing value of hours.

See Also:
Constant Field Values

DAYS

public static final long DAYS
Enums for TimeUnit property representing value of days.

See Also:
Constant Field Values

WEEKS

public static final long WEEKS
Enums for TimeUnit property representing value of weeks.

See Also:
Constant Field Values

MONTHS

public static final long MONTHS
Enums for TimeUnit property representing value of months.

See Also:
Constant Field Values

YEARS

public static final long YEARS
Enums for TimeUnit property representing value of years.

See Also:
Constant Field Values

dataLimits

protected com.klg.jclass.chart.MinMax dataLimits
The mininum and maximum value of data being plotted against this axis.


precision

protected com.klg.jclass.chart.DerivedInt precision
Object that holds the axis numbering precision specified by the user


radianPrecision

protected com.klg.jclass.chart.DerivedInt radianPrecision
Object that holds the numbering precision for a Polar chart x axis when the angle unit is RADIANS.


degreeGradPrecision

protected com.klg.jclass.chart.DerivedInt degreeGradPrecision
Object that holds the numbering precision for a Polar chart x axis when the angle unit is DEGREES or GRADS.


MAX_PRECISION

protected static final int MAX_PRECISION
The default maximum precision.

See Also:
Constant Field Values

maximumPrecision

protected int maximumPrecision
The maximum value the axis precision can have.


numSpacing

protected com.klg.jclass.chart.DerivedDouble numSpacing
Object that holds the axis numbering spacing specified by the user


tickSpacing

protected com.klg.jclass.chart.DerivedDouble tickSpacing
Object that holds the axis tick spacing specified by the user


AUTOMATIC

public static final int AUTOMATIC
Enum value for automatic origin placement.

See Also:
Constant Field Values

MIN

public static final int MIN
Enum value for origin placement at axis minimum.

See Also:
Constant Field Values

MAX

public static final int MAX
Enum value for origin placement at axis maximum.

See Also:
Constant Field Values

ZERO

public static final int ZERO
Enum value for origin placement at axis zero.

See Also:
Constant Field Values

VALUE_ANCHORED

public static final int VALUE_ANCHORED
Enum value for origin placement at a particular axis value.

See Also:
Constant Field Values

ORIGIN

public static final int ORIGIN
Enum value for origin placement at axis origin.

See Also:
Constant Field Values

VALUE

public static final int VALUE
Enum value representing value annotations.

See Also:
Constant Field Values

VALUE_LABELS

public static final int VALUE_LABELS
Enum value representing value label annotations.

See Also:
Constant Field Values

TIME_LABELS

public static final int TIME_LABELS
Enum value representing time label annotations.

See Also:
Constant Field Values

POINT_LABELS

public static final int POINT_LABELS
Enum value representing point label annotations.

See Also:
Constant Field Values

annotationMethod

protected int annotationMethod
AnnotationMethod property, determines how the axis is labelled


annotationRotationAngle

protected double annotationRotationAngle
Label rotation in radians


ROTATE_NONE

public static final int ROTATE_NONE
Enum value representing no rotation.

See Also:
Constant Field Values

ROTATE_90

public static final int ROTATE_90
Enum value representing a rotation of 90 degrees.

See Also:
Constant Field Values

ROTATE_180

public static final int ROTATE_180
Enum value representing a rotation of 180 degrees.

See Also:
Constant Field Values

ROTATE_270

public static final int ROTATE_270
Enum value representing a rotation of 270 degrees.

See Also:
Constant Field Values

ROTATE_OTHER

public static final int ROTATE_OTHER
Enum value representing a rotation specified by annotationRotationAngle.

See Also:
Constant Field Values

chartType

protected transient int chartType
The type of the chart this axis is associated with.


isPrimary

protected transient boolean isPrimary
True if this is the primary axis for this chart.


otherAxis

protected transient com.klg.jclass.chart.JCAxis otherAxis
The other axis associated with this axis. If this is an X axis, the other axis is the associated Y axis, and vice versa.


annoHandler

protected com.klg.jclass.chart.AnnotationHandler annoHandler
Handler for code specific to axis annotations.


polarAxisParams

protected com.klg.jclass.chart.PolarAxisParams polarAxisParams

yAxisAngle

protected double yAxisAngle
Angle (in RADIANS) of y axis in a Polar chart.


usingDoublePixels

protected boolean usingDoublePixels

annoList

protected List annoList
List of JCAnno objects.


gridList

protected List gridList
List of JCGrid objects.


gridDefault

protected boolean gridDefault

useAnnoTicks

protected boolean useAnnoTicks
If true, and the annotation method is TIME_LABELS, POINT_LABELS, or VALUE_LABELS, draw ticks specified by all the JCAnno objects. If false, draw ticks at the positions of the labels. This flag is ignored if the annotation method is VALUE. In that case, always draw ticks specified by the JCAnno objects.


mapper

protected com.klg.jclass.chart.Mapper mapper
Used for point label image mapping.

Constructor Detail

JCAxis

public JCAxis(com.klg.jclass.chart.JCChartArea parent,
              boolean vert,
              int meth)
Constructs a JCAxis object given the parent JCChartArea and a boolean indicating whether the axis is vertical or horizontal.

Parameters:
parent - parent JCChartArea object. All axes must be attached to a JCChartArea.
vert - if true, the axis is a vertical axis. Otherwise, the axis is considered horizontal.
meth - Axis annotation method

JCAxis

public JCAxis()
Default constructor


JCAxis

public JCAxis(Locale locale)
Default constructor with locale.

Method Detail

updateAnnoHandler

protected void updateAnnoHandler(int type)
This method instantiates either an AnnotationHandler or a CircularChartAnnoHandler depending on the chart type parameter.


setParentChart

public void setParentChart(com.klg.jclass.chart.JCChart p)
Sets the parent chart of this axis. This involves noting it locally, setting the parent region to be the chart area associated with the specified chart, setting these values on any titles this axis may have, and marking all annotations to use this parent.

Overrides:
setParentChart in class ChartInteriorRegion
Parameters:
p - The parent chart to use

setLocale

public void setLocale(Locale locale)
Set the locale for this axis.


getLocale

public Locale getLocale()
Retrieve the locale for this axis.


setTimeZone

public void setTimeZone(TimeZone timeZone)
Set the time zone for formatting. This is used for time labels.

Parameters:
timeZone - The new time zone.

getTimeZone

public TimeZone getTimeZone()
Retrieve the time zone for this axis.

Returns:
The current time zone.

isAnnotationVisible

public boolean isAnnotationVisible()
Gets the value of the annotationVisible property.


setAnnotationVisible

public void setAnnotationVisible(boolean visible)
Sets the value of the annotationVisible property.


isGridVisible

public boolean isGridVisible()
Gets the value of the GridVisible property. The GridVisible property determines whether a grid is drawn for the axis.

Returns:
true if the grid should appear, false otherwise

setGridVisible

public void setGridVisible(boolean isGridVisible)
Sets the value of the GridVisible property. The GridVisible property determines whether a grid is drawn for the axis.

Parameters:
isGridVisible - Set to true if the grid should appear, false otherwise

setGridDefault

public void setGridDefault(boolean isDefault)
Sets the value of the gridDefault property. The gridDefault property determines whether grid lines are drawn at the labels.

Parameters:
isDefault - If true, grid lines will be drawn at the labels. If false, grid line positions will be determined by JCGrid properties.

isGridDefault

public boolean isGridDefault()

getGridSpacing

public double getGridSpacing()
Gets the GridSpacing property of the first JCGrid object. The GridSpacing property controls the spacing between grid lines relative to the axis.

Returns:
floating-point number representing the axis value spacing between grid lines. A value of 0.0 indicates that grid lines will not be shown.

setGridSpacing

public void setGridSpacing(double space)
Sets the GridSpacing property of the first JCGrid object on this axis. The GridSpacing property controls the spacing between grid lines relative to the axis.

Parameters:
space - floating-point number representing the axis value spacing between grid lines. A value of 0.0 indicates that grid lines will not be shown.

setGridSpacingIsDefault

public void setGridSpacingIsDefault(boolean useDef)
Sets the isDefault property of the first JCGrid object on this axis. The GridSpacingIsDefault property determines whether Chart is responsible for calculating the grid spacing value. If true, Chart will calculate the grid spacing. If false, Chart will use the provided grid spacing.

Parameters:
useDef - true indicates that chart calculates the GridSpacing property. If false, the GridSpacing property is already specified.

getGridSpacingIsDefault

public boolean getGridSpacingIsDefault()
Gets the isDefault property of the first JCGrid object on this axis. The GridSpacingIsDefault property determines whether Chart is responsible for calculating the grid spacing value. If true, Chart will calculate the grid spacing. If false, Chart will use the provided grid spacing.

Returns:
true indicates that chart calculates the GridSpacing property. If false, the GridSpacing property is already specified.

getGridStyle

public com.klg.jclass.chart.JCChartStyle getGridStyle()
Gets the GridStyle property of the first JCGrid object on this axis. The GridStyle property controls the appearance of the grid.

Returns:
JCChartStyle object that controls the grid's appearance

setGridStyle

public void setGridStyle(com.klg.jclass.chart.JCChartStyle style)
Sets the GridStyle property of the first JCGrid object on this axis. The GridStyle property controls the appearance of the grid.

Parameters:
style - JCChartStyle object that controls the grid's appearance

setLogarithmic

public void setLogarithmic(boolean log)
Sets the Logarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).

Parameters:
log - If true, the axis will be logarithmic (base 10). Otherwise, the axis will be linear.

isLogarithmic

public boolean isLogarithmic()
Gets the Logarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).

Returns:
if true, the axis will be logarithmic (base 10). Otherwise, the axis will be linear.

setEditable

public void setEditable(boolean b)
Sets the Editable property. The Editable property determines whether the axis can be affected by edit/translation/zooming.

Parameters:
b - if true, the axis can be affected by an edit, translation or zoom action. If false, the axis is static.

isEditable

public boolean isEditable()
Gets the Editable property. The Editable property determines whether the axis can be affected by edit/translation/zooming.

Returns:
if true, the axis can be affected by an edit, translation or zoom action. If false, the axis is static.

setDecimalPadded

public void setDecimalPadded(boolean b)
Sets the DecimalPadded property. The DecimalPadded property determines whether the axis annotations will have their decimal portions padded with zeroes to the size of the precision.

Parameters:
b - if true, the axis annotations will be decimal padded.

isDecimalPadded

public boolean isDecimalPadded()
Gets the DecimalPadded property. The DecimalPadded property determines whether the axis annotations will have their decimal portions padded with zeroes to the size of the precision.

Returns:
if true, the axis annotations are decimal padded.

setMin

public void setMin(double nmin)
Sets the Min property of the JCAxis, which controls the minimum value shown on the axis.

Parameters:
nmin - minimum value

getMin

public double getMin()
Gets the Min property of the JCAxis, which controls the minimum value shown on the axis.

Returns:
minimum value

setMinIsDefault

public void setMinIsDefault(boolean useDef)
Sets the MinIsDefault property. The MinIsDefault property determines whether Chart is responsible for calculating the minimum axis value. If true, Chart will calculate the axis min. If false, Chart will use the provided axis min.

Parameters:
useDef - if true, Chart calculates the Min property. If false, the Min property is already specified.

getMinIsDefault

public boolean getMinIsDefault()
Gets the MinIsDefault property. The MinIsDefault property determines whether Chart is responsible for calculating the minimum axis value. If true, Chart will calculate the axis min. If false, Chart will use the provided axis min.

Returns:
true Chart calculates the Min property. If false, the Min property is already specified.

setMax

public void setMax(double nmax)
Sets the Max property of the axis, which controls the maximum value shown on the axis.

Parameters:
nmax - maximum value

getMax

public double getMax()
Gets the Max property of the axis, which controls the maximum value shown on the axis.

Returns:
maximum value

setMaxIsDefault

public void setMaxIsDefault(boolean useDef)
Sets the MaxIsDefault property. The MaxIsDefault property determines whether Chart is responsible for calculating the maximum axis value. If true, Chart calculates the axis max. If false, Chart uses the provided axis max.

Parameters:
useDef - if true, Chart calculates the Max property. If false, the Max property is already specified.

getMaxIsDefault

public boolean getMaxIsDefault()
Gets the MaxIsDefault property. The MaxIsDefault property determines whether Chart is responsible for calculating the maximum axis value. If true, Chart calculates the axis max. If false, Chart uses the provided axis max.

Returns:
true Chart calculates the Max property. If false, the Max property is already specified.

setOrigin

public void setOrigin(double oval)
Sets the Origin property of the Axis, which controls the location of the origin along the axis.

Parameters:
oval - origin value

getOrigin

public double getOrigin()
Gets the Origin property of the Axis, which controls the location of the origin along the axis.

Returns:
origin value

setOriginIsDefault

public void setOriginIsDefault(boolean useDef)
Sets the OriginIsDefault property. The OriginIsDefault property determines whether Chart is responsible for positioning the axis origin. If true, Chart calculates the axis origin. If false, Chart uses the provided axis origin value.

Parameters:
useDef - if true Chart calculates the Origin property. If false, the Origin property is already specified.

getOriginIsDefault

public boolean getOriginIsDefault()
Gets the OriginIsDefault property. The OriginIsDefault property determines whether Chart is responsible for positioning the axis origin. If true, Chart will calculate the axis origin. If false, Chart will use the provided axis origin value.

Returns:
true Chart calculates the Origin property. If false, the Origin property is already specified.

setOriginPlacement

public void setOriginPlacement(int place)
Sets the OriginPlacement property of the JCAxis, which specifies where the origin is placed. Note that the OriginPlacement property is only active if the Origin property has not been set.

Parameters:
place - one of AUTOMATIC (places origin at minimum value or at zero if there are negative and positive values), ZERO (places origin at zero), MIN (places origin at minimum value on axis) or MAX (places origin at maximum value on axis)
Throws:
IllegalArgumentException - If OriginPlacement isn't one of AUTOMATIC, ZERO, MIN or MAX.

getOriginPlacement

public int getOriginPlacement()
Gets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.

Returns:
one of AUTOMATIC (places origin at minimum value or at zero if there are negative and positive values), ZERO (places origin at zero), MIN (places origin at minimum value on axis) or MAX (places origin at maximum value on axis)

setOriginPlacementIsDefault

public void setOriginPlacementIsDefault(boolean useDef)
Sets the OriginPlacementIsDefault property. The OriginPlacementIsDefault property determines whether Chart is responsible for determining the location of the axis origin. If true, Chart calculates the origin positioning. If false, Chart uses the provided origin placement.

Parameters:
useDef - if true, Chart calculates the OriginPlacement property. If false, the OriginPlacement property is already specified.

getOriginPlacementIsDefault

public boolean getOriginPlacementIsDefault()
Gets the OriginPlacementIsDefault property. The OriginPlacementIsDefault property determines whether Chart is responsible for determining the location of the axis origin. If true, Chart calculates the origin positioning. If false, Chart uses the provided origin placement.

Returns:
true Chart calculates the OriginPlacement property. If false, the OriginPlacement property is already specified.

getTitle

public com.klg.jclass.chart.JCAxisTitle getTitle()
Retrieves the JCAxisTitle object, which controls the appearance of the axis title.

Returns:
JCAxisTitle object
See Also:
JCAxisTitle

setTitle

public void setTitle(com.klg.jclass.chart.JCAxisTitle props)
Sets the JCAxisTitle object associated with the JCAxis. JCAxisTitle controls the appearance of the axis title. This method is only accessible inside the chart package.

Parameters:
props - new JCAxisTitle object.
See Also:
JCAxisTitle

setReversed

public void setReversed(boolean rev)
Sets the Reversed property of JCAxis, which determines if the axis order is reversed.

Parameters:
rev - true if the axis is reversed, false otherwise

isReversed

public boolean isReversed()
Gets the Reversed property of JCAxis, which determines if the axis order is reversed.

Returns:
true if the axis is reversed, false otherwise

getFormula

public com.klg.jclass.chart.JCAxisFormula getFormula()
Retrieves the JCAxisFormula object, which specifies a relationship between this JCAxis object and another JCAxis object.

Returns:
JCAxisFormula object
See Also:
JCAxisFormula

setAnnotationRotation

public void setAnnotationRotation(int rot)
Sets the AnnotationRotation property of JCAxis.

The AnnotationRotation property specifies the rotation (clockwise) of each axis label. The 2D API is used to rotate the drawn text. Valid values are JCAxis.ROTATE_NONE, JCAxis.ROTATE_90, JCAxis.ROTATE_180, JCAxis.ROTATE_270, or ROTATE_OTHER.

Parameters:
rot - one of ROTATE_NONE, ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_OTHER.
Throws:
IllegalArgumentException - If the provided rotation value is not part of the ROTATE_ enum.

getAnnotationRotation

public int getAnnotationRotation()
Gets the AnnotationRotation property of JCAxis.

The AnnotationRotation property specifies the rotation (clockwise) of each axis label. In JDK 1.2, the 2D API is used to rotate the drawn text. Valid values are JCAxis.ROTATE_NONE, JCAxis.ROTATE_90, JCAxis.ROTATE_180, JCAxis.ROTATE_270 or JCAxis.ROTATE_OTHER.

Returns:
One of ROTATE_NONE, ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_OTHER.

setAnnotationRotationAngle

public void setAnnotationRotationAngle(int angleUnit,
                                       double rotationAngle)
Sets the AnnotationRotationAngle property of JCAxis. The AnnotationRotationAngle property represents the angle of rotation in radians of labels on this axis.

Parameters:
angleUnit - The units of the specified angle. Allowed values are JCChartUtil.DEGREES, JCChartUtil.RADIANS, and JCChartUtil.GRADS. If an invalid angle unit is specified, the method will not update the AnnotationRotationAngle property.
rotationAngle - The rotation angle of axis labels.

getAnnotationRotationAngle

public double getAnnotationRotationAngle(int angleUnit)
Returns the AnnotationRotationAngle property of JCAxis. The AnnotationRotationAngle property represents the angle of rotation of the labels on this axis.

Parameters:
angleUnit - The desired units for the returned angle. Allowed values are JCChartUtil.DEGREES, JCChartUtil.RADIANS, and JCChartUtil.GRADS.
Returns:
The rotation angle of the axis labels in the specified angle unit. If an invalid angle unit is specified, the returned angle will be in RADIANS.

setPlacement

public void setPlacement(int place)
Sets the Placement property of the JCAxis, which controls where the axis is placed.

Parameters:
place - one of AUTOMATIC (Chart chooses an appropriate location), ORIGIN (appears at the origin value), MIN (appears at the minimum axis value), MAX (appears at the maximum axis value) or VALUE_ANCHORED (appears at a particular value along another axis. Note that x axis labels, for example, will be placed at either the y axis origin, y axis max or y axis min value.
Throws:
IllegalArgumentException - If the Placement value is not one of AUTOMATIC, ORIGIN, MIN, MAX or VALUE_ANCHORED.

setPlacement

public void setPlacement(com.klg.jclass.chart.JCAxis ax)
Convenience method that sets the Placement property to ORIGIN, and sets the PlacementAxis property to the provided value

Parameters:
ax - new value for PlacementAxis.

setPlacement

public void setPlacement(com.klg.jclass.chart.JCAxis ax,
                         double v)
Convenience method that sets the Placement property to VALUE_ANCHORED, the PlacementAxis property to the provided axis, and the PlacementLocation property to the provided floating- point value.

Parameters:
ax - new value for PlacementAxis
v - new value for PlacementLocation

getPlacement

public int getPlacement()
Gets the Placement property of the JCAxis, which controls where the axis is placed.

Returns:
one of AUTOMATIC (Chart chooses an appropriate location), ORIGIN (appears at the origin value), MIN (Appears at the minimum axis value) and MAX (appears at the maximum axis value). Note that x axis labels, for example, will be placed at either the y axis origin, y axis max or y axis min value.

setPlacementIsDefault

public void setPlacementIsDefault(boolean useDef)
Sets the PlacementIsDefault property. The PlacementIsDefault property determines whether Chart is responsible for determining the location of the axis. If true, Chart calculates the origin positioning. If false, Chart uses the provided axus placement.

Parameters:
useDef - if true, Chart calculates the Placement property. If false, the Placement property is already specified.

getPlacementIsDefault

public boolean getPlacementIsDefault()
Gets the PlacementIsDefault property. The PlacementIsDefault property determines whether Chart is responsible for determining the location of the axis. If true, Chart calculates the axis positioning. If false, Chart uses the provided placement.

Returns:
true Chart calculates the Placement property. If false, the Placement property is already specified.

setPlacementAxis

public void setPlacementAxis(com.klg.jclass.chart.JCAxis ax)
Sets the PlacementAxis property of the axis. The PlacementAxis property determines the axis that controls the placement of this axis. In JCChart, it is possible to position an axis at a particular position on another axis (in conjunction with the PlacementLocation property or the Placement property).

Parameters:
ax - axis to be used to position this axis.

getPlacementAxis

public com.klg.jclass.chart.JCAxis getPlacementAxis()
Gets the PlacementAxis property of the axis. The PlacementAxis property determines the axis that controls the placement of this axis. In JCChart, it is possible to position an axis at a particular position on another axis (in conjunction with the PlacementLocation property or the Placement property).

Returns:
axis to be used to position this axis.

setPlacementLocation

public void setPlacementLocation(double v)
Sets the value of the PlacementLocation property. The PlacementLocation property is used with the PlacementAxis property to position the current axis object at a particular point on another axis.

Parameters:
v - Floating-point data value on PlacementAxis at which to place the current axis.

getPlacementLocation

public double getPlacementLocation()
Gets the value of the PlacementLocation property. The PlacementLocation property is used with the PlacementAxis property to position the current axis object at a particular point on another axis.

Returns:
Floating-point data value on PlacementAxis at which to place the current axis.

setAnnotationMethod

public void setAnnotationMethod(int newMethod)
Sets the value of the AnnotationMethod property. The AnnotationMethod property determines how axis annotations are generated.

Parameters:
newMethod - one of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS
Throws:
IllegalArgumentException - If the AnnotationMethod value is not one of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS.

getAnnotationMethod

public int getAnnotationMethod()
Gets the value of the AnnotationMethod property. The AnnotationMethod property determines how axis annotations are generated.

Returns:
One of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS

setPrecision

public void setPrecision(int prec)
Sets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.

Parameters:
prec - number of zeros after the decimal place. If negative, it specifies the number of zeros that appear before the decimal place.

setPrecisionInternal

protected void setPrecisionInternal(int prec)

updateAnnoDefPrecision

protected void updateAnnoDefPrecision(int prec)
This method updates the default precision of the DEFAULT_LABELS JCAnno object.


getPrecision

public int getPrecision()
Gets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.

Returns:
number of zeros after the decimal place. If negative, specifies the number of zeros that appear before the decimal place.

setPrecisionIsDefault

public void setPrecisionIsDefault(boolean useDef)
Sets the PrecisionIsDefault property of JCAxis. The PrecisionIsDefault determines whether Chart is responsible for calculating the numbering precision. If true, Chart will calculate the precision. If false, Chart will use the provided precision.

Parameters:
useDef - true tells Chart to calculate the Precision property, whereas false means that the Precision property is already specified

setMaxPrecision

public void setMaxPrecision(int maxprec)
Sets the MaxPrecision property of the Axis, which controls the maximum value of the Precision property. The default value is 14.

Parameters:
maxprec - the maximum value the Precision property can take on.

getMaxPrecision

public int getMaxPrecision()
Gets the MaxPrecision property of the Axis, which controls the maximum value of the Precision property. The default value is 14.

Returns:
the maximum value the Precision property can take on.

getPrecisionIsDefault

public boolean getPrecisionIsDefault()
Gets the PrecisionIsDefault property of JCAxis. The PrecisionIsDefault determines whether Chart is responsible for calculating the numbering precision. If true, Chart will calculate the precision. If false, Chart will use the provided precision.

Returns:
true tells Chart to calculate the Precision property, whereas false means that the Precision property is already specified

updateAnnoDefaultPrecision

protected void updateAnnoDefaultPrecision(int chartType)
This method is invoked by the setChartType() method of ChartDataView. When switching between chart types, we need to update the default annotation precision.


setNumSpacing

public void setNumSpacing(double inc)
Sets the NumSpacing property of the Axis, which controls the number interval of the axis labels. NumSpacing is only meant to work with Value or ValueLabels annotations. This method has no effect when time labels or point labels are being used.

Parameters:
inc - interval between axis labels

getNumSpacing

public double getNumSpacing()
Gets the NumSpacing property of the Axis, which controls the interval between axis labels. NumSpacing is only meant to work with Value or ValueLabels annotations. This method has no effect when time labels or point labels are being used.

Returns:
interval between axis labels

setNumSpacingIsDefault

public void setNumSpacingIsDefault(boolean useDef)
Sets the NumSpacingIsDefault property of JCAxis. The NumSpacingIsDefault determines whether Chart is responsible for calculating the numbering spacing. If true, Chart will calculate the spacing. If false, Chart will use the provided numbering spacing.

Parameters:
useDef - true tells Chart to calculate the NumSpacing property, whereas false means the NumSpacing property is already specified

getNumSpacingIsDefault

public boolean getNumSpacingIsDefault()
Gets the NumSpacingIsDefault property of JCAxis. The NumSpacingIsDefault determines whether Chart is responsible for calculating the numbering spacing. If true, Chart will calculate the spacing. If false, Chart will use the provided numbering spacing.

Returns:
true tells Chart to calculate the NumSpacing property, whereas false means the NumSpacing property is already specified

getTickSpacing

public double getTickSpacing()
Gets the TickSpacing property, which controls the interval between tick lines on the axis. Note: if the AnnotationMethod property is set to POINT_LABELS, tick lines appear at point values.

Returns:
interval between ticks

setTickSpacing

public void setTickSpacing(double tick)
Sets the TickSpacing property, which controls the interval between tick lines on the axis.

Parameters:
tick - interval between ticks

setTickSpacingIsDefault

public void setTickSpacingIsDefault(boolean useDef)
Sets the TickSpacingIsDefault property of JCAxis. The TickSpacingIsDefault determines whether Chart is responsible for calculating the tick spacing. If true, Chart will calculate the tick spacing. If false, Chart will use the provided tick spacing.

Parameters:
useDef - true tells Chart to calculate the TickSpacing property, whereas false means that the TickSpacing property is already specified

getTickSpacingIsDefault

public boolean getTickSpacingIsDefault()
Gets the TickSpacingIsDefault property of JCAxis. The TickSpacingIsDefault determines whether Chart is responsible for calculating the tick spacing. If true, Chart will calculate the tick spacing. If false, Chart will use the provided tick spacing.

Returns:
true tells Chart to calculate the TickSpacing property, whereas false means that the TickSpacing property is already specified

setLabelGenerator

public void setLabelGenerator(com.klg.jclass.chart.JCLabelGenerator lg)
Sets the value of the LabelGenerator property. The LabelGenerator property holds a reference to an object that implements the JCLabelGenerator interface. This interface is used to externally generate labels.

Parameters:
lg - reference to object instance used to generate labels.

getLabelGenerator

public com.klg.jclass.chart.JCLabelGenerator getLabelGenerator()
Gets the value of the LabelGenerator property. The LabelGenerator property holds a reference to an object that implements the JCLabelGenerator interface. This interface is used to externally generate labels.

Returns:
reference to object instance used to generate labels.

setTimeUnit

public void setTimeUnit(long tu)
Sets the value of the TimeUnit property. The TimeUnit property controls the unit of time used for labelling a time labelled axis.

Parameters:
tu - Unit of time; one of SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARS.

getTimeUnit

public long getTimeUnit()
Gets the value of the TimeUnit property. The TimeUnit property controls the unit of time used for labelling a time labelled axis.

Returns:
Unit of time; one of SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARS.

setTimeBase

public void setTimeBase(Date nb)
Sets the value of the TimeBase property. The TimeBase property defines the start time for the axis.

Parameters:
nb - Date object representing the start time for the axis.

getTimeBase

public Date getTimeBase()
Gets the value of the TimeBase property. The TimeBase property defines the start time for the axis.

Returns:
Date object representing the start time for the axis.

timeBaseToString

public String timeBaseToString(boolean useTimeFormat)
Convert the time base to a time label string.

Parameters:
useTimeFormat - if true, will use TimeFormat property in generating label. If false, will use default format.

setTimeFormat

public void setTimeFormat(String tf)
Sets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes. This is JDK 1.1 compliant. Uses the date and time format patterns described in JDK 1.1 documentation If this date and time format is used then the old time format does not reflect the changes

Parameters:
tf - format string for time labels.
See Also:
SimpleDateFormat

setTimeFormat

public void setTimeFormat(String tf,
                          boolean update)
Sets the value of the TimeFormat property and recalcs as specified.

Parameters:
tf - format string for time labels.
update - force a recalc if true.
See Also:
SimpleDateFormat

getTimeFormat

public String getTimeFormat()
Gets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.

Returns:
format string for time labels.

setTimeFormatIsDefault

public void setTimeFormatIsDefault(boolean ud)
Sets the value of the TimeFormatIsDefault property. The TimeFormatIsDefault property determines whether a time label format is generated automatically, or the user value for TimeFormat is used.

Parameters:
ud - true if a default will be generated, false if the user value will be used.

setTimeFormatIsDefault

public void setTimeFormatIsDefault(boolean ud,
                                   boolean update)
Sets the value of the TimeFormatIsDefault property and recalcs as specified.

Parameters:
ud - true if a default will be generated, false if the user value will be used.
update - will recalc if true.

getTimeFormatIsDefault

public boolean getTimeFormatIsDefault()
Gets the value of the TimeFormatIsDefault property. The TimeFormatIsDefault property determines whether a time label format is generated automatically, or the user value for TimeFormat is used.

Returns:
true if a default will be generated, false if the user value will be used.

setVertical

public void setVertical(boolean v)
Sets the value of the Vertical property. The Vertical property determines whether the axis is vertically oriented or horizontally oriented.

Parameters:
v - If true, the axis is vertical. Otherwise, it is horizontal.

setVerticalInternal

protected void setVerticalInternal(boolean v)

isVertical

public boolean isVertical()
Gets the value of the Vertical property. The Vertical property determines whether the axis is vertically oriented or horizontally oriented.

Returns:
If true, the axis is vertical. Otherwise, it is horizontal.

setGap

public void setGap(int gp)
Sets the value of the Gap property. The Gap property determines the amount of space left between adjacent axis annotations, in pixels.

Parameters:
gp - Space between labels. To ensure that the labels do not overlap, gp should be >=0. If overlapping labels is desired, gp can be <0.

getGap

public int getGap()
Gets the value of the Gap property. The Gap property determines the amount of space left between adjacent axis annotations, in pixels.

Returns:
Space between labels. To ensure that the labels do not overlap, gp should be >=0. If overlapping labels is desired, gp can be <0.

getValueLabel

public com.klg.jclass.chart.JCValueLabel getValueLabel(double val)
Retrieves the value label for the specified value from the list of user-specified value labels. Note that if there is no value label that is an exact floating point match of the value, the value label with a value closest to the value is returned.

Parameters:
val - data value for which to find the value label
Returns:
JCValueLabel instance. Returns null if there are no user-specified value labels.

getGeneratedValueLabel

public com.klg.jclass.chart.JCValueLabel getGeneratedValueLabel(double val)
Retrieves the value label for the specified value from the list of value labels generated for this axis. If the AnnotationMethod is set to VALUE_LABELS, this list will be the same as the user-specified list of value labels. Note that if there is no value label that is an exact floating point match of the value, the value label with a value closest to the value is returned.

Parameters:
val - data value for which to find the value label
Returns:
JCValueLabel instance. Returns null if there are no generated value labels.

addValueLabel

public void addValueLabel(com.klg.jclass.chart.JCValueLabel vl)
Adds the provided value label to the list of value labels. If the AnnotationMethod is VALUE_LABELS, then the value label will appear at the appropriate point along the axis.

Parameters:
vl - JCValueLabel instance to add

removeValueLabel

public void removeValueLabel(int index)
Intended for internal use only.


getValueLabels

public com.klg.jclass.chart.JCValueLabel[] getValueLabels()
Gets the value of the ValueLabels property. The ValueLabels property is an indexed property containing a list of all annotations specified by the user for an axis.


getUserValueLabels

public Vector getUserValueLabels()
Intended for internal use only.


getGeneratedValueLabels

public com.klg.jclass.chart.JCValueLabel[] getGeneratedValueLabels()
Gets the list of value labels generated for this axis. If the AnnotationMethod is set to VALUE_LABELS, this list will be the same as the user-specified list of value labels.


setValueLabels

public void setValueLabels(com.klg.jclass.chart.JCValueLabel[] vl)
Sets the value of the ValueLabels property. The ValueLabels property is an indexed property containing a list of all annotations specified by the user for an axis.


getValueLabels

public com.klg.jclass.chart.JCValueLabel getValueLabels(int indx)
Gets the value of the ValueLabels property at a specified index. The ValueLabels property is an indexed property containing a list of all annotations specified by the user for an axis.


getGeneratedValueLabels

public com.klg.jclass.chart.JCValueLabel getGeneratedValueLabels(int indx)
Gets the value label at the specified index in the list of value labels generated for this axis. If the AnnotationMethod is set to VALUE_LABELS, this list will be the same as the user-specified list of value labels.


setValueLabels

public void setValueLabels(int index,
                           com.klg.jclass.chart.JCValueLabel vl)
Sets the value of one one value label in the ValueLabels property. The ValueLabels property is an indexed property containing a list of all annotations specified by the user for an axis. This method is required by the beanbox, but somewhat ill-formed because the index specified will not necessarily be honoured because the ValueLabel list is sorted by value. It is not recommended for use.


toString

public String toString()
String representation of the axis. Used by com.klg.jclass.beans.IndexedPropertyEditor to name the axis.

Overrides:
toString in class Object

toPixel

public int toPixel(double v)
Converts a data value along the axis to a pixel value. The pixel value is valid inside the parent JCChartArea.

Parameters:
v - data value to convert to a screen location
Returns:
screen location in pixels

toPixelDouble

public double toPixelDouble(double v)
Converts a data value along the axis to a pixel value. The pixel value is valid inside the parent JCChartArea.

Parameters:
v - data value to convert to a screen location
Returns:
screen location in pixels

toPixelPolar

public Point toPixelPolar(double angle,
                          double r,
                          boolean convertDataToPixel)
Converts polar data (angle,radius) to pixel (x,y) coordinates. The pixel value is valid inside the parent JCChartArea.

Parameters:
angle - theta value in radians
r - radius in data or pixel units
convertDataToPixel - false if r is in pixel units.
Returns:
(x,y) chart area location in pixels. Returns null if r axis doesn't exist.

applyDataToPixelScaling

protected double applyDataToPixelScaling(double dataValue)
Convert from data to pixel units (i.e., apply scaling factor only, no translation).

Parameters:
dataValue - Data value to be scaled.
Returns:
The scaled value in pixel units. Double.MAX_VALUE if the r axis doesn't exist.

applyPixelToDataScaling

protected double applyPixelToDataScaling(double pixels)
Convert from pixel to data units (i.e., apply scaling factor only, no translation).

Parameters:
pixels - Pixel value to be scaled.
Returns:
The scaled value in data units. Double.MAX_VALUE if the r axis doesn't exist.

toPixel

public int toPixel(double v,
                   boolean drawFront)
Converts a data value along the axis to a pixel value, shifting the value to the front or back plane of the chart from the plane this axis is on. The pixel value is valid inside the parent JCChartArea.

Parameters:
v - data value to convert to a screen location
drawFront - true if the conversion to the front plane is desired, false if the conversion to the back plane is desired.
Returns:
screen location in pixels

toPixelDouble

public double toPixelDouble(double v,
                            boolean drawFront)
Converts a data value along the axis to a pixel value, shifting the value to the front or back plane of the chart from the plane this axis is on. The pixel value is valid inside the parent JCChartArea.

Parameters:
v - data value to convert to a screen location
drawFront - true if the conversion to the front plane is desired, false if the conversion to the back plane is desired.
Returns:
screen location in pixels

toData

public double toData(int v)
Converts a pixel value relative to the parent JCChartArea to a value in the data space. In effect, this routine performs mapping along a particular axis.

Parameters:
v - screen value (in pixels) to convert to a data value. Must be relative to the plot area.
Returns:
data value corresponding to the screen location

toData

public double toData(int v,
                     boolean drawFront)
Converts a pixel value relative to the parent JCChartArea to a value in the data space, first shifting the value from the front or back plane of the chart to the plane that holds this axis. In effect, this routine performs mapping along a particular axis.

Parameters:
v - screen value (in pixels) to convert to a data value. Must be relative to the plot area.
drawFront - true if the conversion from the front plane is desired, false if the conversion from the back plane is desired.
Returns:
data value corresponding to the screen location

toDataPolar

public com.klg.jclass.chart.JCDataCoord toDataPolar(int x,
                                                    int y)
Converts a pixel value relative to the parent JCChartArea to a value in the data space.

Parameters:
x - screen value x coordinate. Must be relative to the plot area.
y - screen value y coordinate.
Returns:
data value corresponding to the screen location. Null if r axis doesn't exist.

draw

public void draw(Graphics gc)
Overrides ChartInteriorRegion.draw() to ensure that a border is not drawn around the axis.

Specified by:
draw in interface com.klg.jclass.chart.Drawable
Overrides:
draw in class ChartInteriorRegion
Parameters:
gc - graphics context to use for drawing

drawAnnotationsAndTitle

public void drawAnnotationsAndTitle(Graphics gc)

drawAnnotationsAndTitle

public void drawAnnotationsAndTitle(Graphics gc,
                                    boolean drawAnno,
                                    boolean drawTitle)

setBounds

public void setBounds(int newx,
                      int newy,
                      int neww,
                      int newh)
Overridden setBounds() method that makes sure the scale and shift values are recalculated when the axis size or position changes.

Overrides:
setBounds in class ChartInteriorRegion
Parameters:
newx - new x position relative to the parent chart
newy - new y position relative to the parent chart
neww - new width
newh - new height

recalc

public void recalc()
Recalculates the axis parameters. This method is just a placeholder for now, since axis recalculation is distributed inside recalc() for JCChartArea.

Overrides:
recalc in class ChartInteriorRegion

dateToValue

public double dateToValue(Date d)
Converts a date to a value along this axis, taking into consideration the current TimeBase and TimeUnit properties.

Parameters:
d - date to convert
Returns:
value along this axis represented by specified date.

valueToDate

public Date valueToDate(double v)
Converts a value along this axis to a Date, taking into consideration the current TimeBase and TimeUnit properties.

Parameters:
v - value to convert
Returns:
date represented by specified value.

isRightSide

protected boolean isRightSide()
Returns true if the axis is on the right side of the chart.


isLeftSide

protected boolean isLeftSide()
Returns true if the axis is on the left side of the chart.


isBottomSide

protected boolean isBottomSide()
Returns true if the axis is on the bottom of the chart.


isTopSide

protected boolean isTopSide()
Returns true if the axis is on the top of the chart.


setPolarAxisParams

protected void setPolarAxisParams(com.klg.jclass.chart.PolarAxisParams axisParams)

getPolarAxisParams

protected com.klg.jclass.chart.PolarAxisParams getPolarAxisParams()

layoutPolarAxis

protected void layoutPolarAxis()
Axis layout for Polar or Radar charts. This method is called twice. In the first invocation, polarAxisParams properties are initialized, and chartArea.recalc() is called. While processing chartArea.recalc(), layoutPolarAxis() gets called again. We don't want to reinitialize polarAxisParams or call chartArea.recalc() again, so if polarAxisParams.radius is already equal to the initial value, return immediately.


adjustCenterAndRadius

protected void adjustCenterAndRadius(int xOffset,
                                     int yOffset,
                                     int radiusDelta)
Adjusts the position and size of a Polar/Radar chart to keep all of the annotation within view. This method can be called for either the theta axis, or r axis, but not both.

Parameters:
xOffset - x coordinate offset of chart center
yOffset - y coordinate offset of chart center
radiusDelta - Change in value of chart radius

getPolarAnnotationBounds

protected com.klg.jclass.chart.AnnoBoundsInfo getPolarAnnotationBounds()
Returns an AnnoBoundsInfo object for this axis.


getThetaAxisLabelOffset

protected int getThetaAxisLabelOffset()
Returns the pixel distance between the theta axis and a theta axis label in a Polar/Radar chart.


isPolar

public boolean isPolar()
Is the chart a polar plot?

Returns:
true if the chart type is JCChart.POLAR

isRadar

public boolean isRadar()
Is the chart a radar plot?

Returns:
true if the chart type is JCChart.RADAR or JCChart.AREA_RADAR

isPolarRadar

public boolean isPolarRadar()
Is the chart a polar or radar plot?

Returns:
true if the chart type is JCChart.POLAR, JCChart.RADAR or JCChart.AREA_RADAR

isPolarRadar

protected boolean isPolarRadar(int type)

isBar

public boolean isBar()
Internal methods


getGridLineList

protected double[] getGridLineList()
Gets a list of the axis positions that grid lines have to be drawn at.

Returns:
an array of grid line positions.

drawRadialGridLine

protected void drawRadialGridLine(Graphics gc,
                                  double angle)
Draws a radial line of length radius at the specified angle.

Parameters:
gc - The graphics context
angle - Angle in radians.

drawGridLineInTrough

protected void drawGridLineInTrough(Graphics gc,
                                    com.klg.jclass.chart.JCLineStyle ls,
                                    double v)
Draw a grid line in the axis trough.

Parameters:
gc - Graphics object used to draw grid line
ls - JCLineStyle object associated with this grid line
v - the value on the axis representing the grid line to draw.

drawWebLine

protected void drawWebLine(Graphics gc,
                           com.klg.jclass.chart.JCLineStyle ls,
                           double r,
                           int nSpokes)

getForeground

public Color getForeground()
Gets the foreground color of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance, and set on parent JCChart instance.

Overrides:
getForeground in class ChartInteriorRegion
Returns:
the derived foreground color of this axis.

getBackground

public Color getBackground()
Gets the background color of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance and region is opaque, and set on parent JCChart instance and chart is opaque.
Note: this is here for completeness sake -- there is really no background color to an axis.

Overrides:
getBackground in class ChartInteriorRegion
Returns:
the derived background color of this axis.

getFont

public Font getFont()
Gets the font property of this axis, which is derived according to the following hierarchy: set locally, set on parent region JCChartArea instance, and set on parent JCChart instance.

Overrides:
getFont in class ChartInteriorRegion
Returns:
the derived font of this axis.

getChartArea

public com.klg.jclass.chart.JCChartArea getChartArea()
Gets the parent region JCChartArea instance.


getAnnotationHandler

public com.klg.jclass.chart.AnnotationHandler getAnnotationHandler()
Gets the AnnotationHandler for this axis


setYAxisAngle

public void setYAxisAngle(int units,
                          double angle)
Method to set the angle of the y axis in a Polar/Radar chart.

Parameters:
units - The units of the specified angle. Valid values are JCChartUtil.DEGREES, JCChartUtil.GRADS, or JCChartUtil.RADIANS.
angle - The desired angle for the r axis.

getYAxisAngle

public double getYAxisAngle(int units)
Method to get the angle of the y axis in a Polar/Radar chart.

Parameters:
units - The desired units of the returned angle. Valid values are JCChartUtil.DEGREES, JCChartUtil.GRADS, or JCChartUtil.RADIANS.

setOriginBase

public void setOriginBase(int units,
                          double angle)
Method to set the angle of the theta axis origin.

Parameters:
units - The units of the specified angle. Valid values are JCChartUtil.DEGREES, JCChartUtil.GRADS, or JCChartUtil.RADIANS.
angle - The desired angle for the theta axis origin.

getOriginBase

public double getOriginBase(int units)
Method to get the angle of the theta axis origin.

Parameters:
units - The desired units of the returned angle. Valid values are JCChartUtil.DEGREES, JCChartUtil.GRADS, or JCChartUtil.RADIANS.

setHalfRange

public void setHalfRange(boolean fHalfRange)
Method to set the half range flag for Polar charts.

Parameters:
fHalfRange - If true, theta axis labels on a Polar chart will have a maximum value of 180 degrees.

isHalfRange

public boolean isHalfRange()
Method to get the half range flag for Polar charts.

Returns:
true if theta axis labels have a maximum value of 180 degrees.

setRadarCircularGrid

public void setRadarCircularGrid(boolean fCircular)
Makes the y grid lines of a Radar chart circular.

Parameters:
fCircular - true for circular grid lines, false for webbed grid lines.

isRadarCircularGrid

public boolean isRadarCircularGrid()
Gets the state of the circular flag for Radar chart grid lines.

Returns:
true if the y grid lines are circular, false if the y grid lines are webbed.

getPolarRadarCenter

public Point2D.Double getPolarRadarCenter()
Gets the center of the plot area for polar/radar charts.

Returns:
the center of the plot area for polar/radar charts.

getPolarRadarRadius

public double getPolarRadarRadius()
Gets the radius of the plot area for polar/radar charts.

Returns:
the radius of the plot area for polar/radar charts.

addAnnotation

public void addAnnotation(com.klg.jclass.chart.JCAnno anno)
Adds a JCAnno object to this axis.


removeAnnotation

public void removeAnnotation(com.klg.jclass.chart.JCAnno anno)
Removes the specified JCAnno object from this axis.


removeAnnotation

public void removeAnnotation(int index)
Removes the JCAnno object at the specified index from this axis.


containsAnnotation

public boolean containsAnnotation(com.klg.jclass.chart.JCAnno anno)
Determines if the specified JCAnno has already been added to the axis.

Parameters:
anno - The JCAnno to look for
Returns:
true if the JCAnno was found

containsAnnotation

public boolean containsAnnotation(String annoName)
Determines if a JCAnno with the specified name has already been added to the axis.

Parameters:
annoName - The name of the JCAnno. If the parameter is null, the method will return false;
Returns:
true if a JCAnno of the specified name was found

setAnnotationList

public void setAnnotationList(List annoList)
Sets a List of JCAnno objects on this axis.

Parameters:
annoList - A List of JCAnno objects

getAnnotationList

public List getAnnotationList()
Returns the List of JCAnno objects that have been set on this axis.


removeAllAnnotations

public void removeAllAnnotations()
Removes all JCAnno objects from the internal List.


removeDefaultLabels

public void removeDefaultLabels()
For internal use only.


removeDefaultTicks

public void removeDefaultTicks()
For internal use only.


removeDefaultGrid

public void removeDefaultGrid()
For internal use only.


updateGridObject

protected void updateGridObject(com.klg.jclass.chart.JCGrid chartGrid,
                                double start,
                                double stop,
                                double increment)

updateGrids

protected void updateGrids()

addDefaultLabels

public void addDefaultLabels()
Intended for internal use.


addDefaultTicks

public void addDefaultTicks()
Intended for internal use.


makeDefaultAnnotations

protected void makeDefaultAnnotations()
Create default JCAnno objects.


updateAnnotations

protected void updateAnnotations()
At the end of the layout process, update the default start, stop, and increment values of tick objects.


getAnnoObject

protected com.klg.jclass.chart.JCAnno getAnnoObject(int type)
This method searches an internal List for a JCAnno object of the specified type.

Parameters:
type - The JCAnno type. Valid values include JCAnno.DEFAULT_LABELS, JCAnno.DEFAULT_TICKS, or JCAnno.USER_DEFINED.
Returns:
A JCAnno object of the specified type, or null if such an object does not exist.

getDefaultLabels

public com.klg.jclass.chart.JCAnno getDefaultLabels()
For internal use only. This method returns a JCAnno object of type DEFAULT_LABELS, or null if an object of that type doesn't exist.


getDefaultTicks

public com.klg.jclass.chart.JCAnno getDefaultTicks()
For internal use only. This method returns a JCAnno object of type DEFAULT_TICKS, or null if an object of that type doesn't exist.


makeTickLabels

protected void makeTickLabels()
If the annotation method is VALUE or if the useAnnoTicks flag is set, iterate through the list of JCAnno objects and create JCValueLabels for the tick marks defined by each JCAnno. If useAnnoTicks is true, skip JCAnno objects that have the drawLabel flag set.


setUseAnnoTicks

public void setUseAnnoTicks(boolean useAnnoTicks)
This method is used to set the value of the useAnnoTicks flag. If the flag is true, ticks specified by the JCAnno objects will be drawn when the annotation method is TIME_LABELS, POINT_LABELS, or VALUE_LABELS. If false, ticks will be drawn at the positions of the labels. The useAnnoTicks flag is ignored when the annotation method is VALUE.


getUseAnnoTicks

public boolean getUseAnnoTicks()
This method returns the value of the useAnnoTicks flag. If the flag is true, ticks specified by the JCAnno objects will be drawn when the annotation method is TIME_LABELS, POINT_LABELS, or VALUE_LABELS. If false, ticks will be drawn at the positions of the labels. The useAnnoTicks flag is ignored when the annotation method is VALUE.


getMaxTickOuterExtent

protected int getMaxTickOuterExtent()
This method returns the maximum outer extent of tick marks on this axis.


getGridList

public List getGridList()
Returns the List of JCGrid objects.


getGrid

public com.klg.jclass.chart.JCGrid getGrid(int index)
This method returns the JCGrid object at the specified index.


addGrid

public void addGrid(com.klg.jclass.chart.JCGrid grid)
Adds a JCGrid object to this axis.


removeGrid

public void removeGrid(com.klg.jclass.chart.JCGrid grid)
Removes the specified JCGrid object from this axis.


removeGrid

public void removeGrid(int index)
Removes the JCGrid object at the specified index from this axis.


removeAllGrids

public void removeAllGrids()

containsGrid

public boolean containsGrid(com.klg.jclass.chart.JCGrid grid)
Determines if the specified JCGrid has already been added to the axis.

Parameters:
grid - The JCGrid to look for
Returns:
true if the JCGrid was found

containsGrid

public boolean containsGrid(String gridName)
Determines if a JCGrid with the specified name has already been added to the axis.

Parameters:
gridName - The name of the JCGrid. If the parameter is null, the method will return false;
Returns:
true if a JCGrid of the specified name was found

getDefaultGrid

public com.klg.jclass.chart.JCGrid getDefaultGrid()
For internal use only. Returns the first JCGrid object in the internal List that has all properties set to their defaults.


getMapper

public com.klg.jclass.chart.Mapper getMapper()
Get the current image map mapper. For internal use only.

Returns:
The current image map mapper.

setMapper

public void setMapper(com.klg.jclass.chart.Mapper mapper)
Set the current image map mapper. For internal use only.

Parameters:
mapper - The new image map mapper.

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