JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCAnno

java.lang.Object
  |
  +--com.klg.jclass.chart.JCAnno
All Implemented Interfaces:
Serializable

public class JCAnno
extends Object
implements Serializable

An instance of this class is used to define a series of tick marks on a JCAxis.

See Also:
Serialized Form

Field Summary
static int DEFAULT_INNER_EXTENT
           
static int DEFAULT_LABEL_EXTENT
           
static int DEFAULT_LABELS
           
static int DEFAULT_OUTER_EXTENT
           
static int DEFAULT_TICKS
           
protected  int defInnerExtent
           
protected  int defLabelExtent
           
protected  int defOuterExtent
           
protected  int defPrecision
           
protected  boolean drawLabels
          If true, draw tick labels; otherwise, no tick labels are drawn.
protected  boolean drawTicks
          If true, draw tick marks; otherwise, no tick marks are drawn.
protected  com.klg.jclass.chart.DerivedDouble incrementValue
          If not automatic, the scale values at which tick marks are to be placed.
protected  com.klg.jclass.chart.DerivedInt innerExtent
          The pixel length of a tick within the plot area.
protected  Color labelColor
          The color in which to draw labels.
protected  com.klg.jclass.chart.DerivedInt labelExtent
          The distance in pixels of a label from the axis.
protected  String name
           
protected  com.klg.jclass.chart.DerivedInt outerExtent
          The pixel length of a tick outside of the plot area.
protected  com.klg.jclass.chart.JCAxis parent
           
protected  com.klg.jclass.chart.DerivedInt precision
          If precisionUseDefault is false, use this precision.
protected  com.klg.jclass.chart.DerivedDouble startValue
          The startValue is the scale value at which to begin this set of tick marks.
protected  com.klg.jclass.chart.DerivedDouble stopValue
          The stopValue is the scale value at which this set of tick marks ends.
protected  Color tickColor
          The color in which to draw ticks.
protected  int type
           
static int USER_DEFINED
           
 
Constructor Summary
JCAnno()
          Creates a JCAnno object with default properties.
JCAnno(int type, com.klg.jclass.chart.JCAxis parent, Color tickColor)
          Creates a JCAnno with startValue, stopValue, and incrementValue initialized to the min, max, and tickSpacing values of the parent JCAxis.
JCAnno(int type, com.klg.jclass.chart.JCAxis parent, double startValue, double stopValue, double incrementValue, int precision, boolean drawLabels, boolean drawTicks, int labelExtent, int innerExtent, int outerExtent, Color tickColor, Color labelColor)
          Creates a tick object and sets its properties.
 
Method Summary
 int getDefaultInnerExtent()
           
 int getDefaultLabelExtent()
           
 int getDefaultOuterExtent()
           
 int getDefaultPrecision()
           
 boolean getDrawLabels()
          Returns the Boolean controlling the drawing of labels.
 boolean getDrawLabelsIsDefault()
          Returns true if the drawLabels property has the default value.
 boolean getDrawTicks()
          Returns the Boolean controlling the drawing of ticks.
 boolean getDrawTicksIsDefault()
          Returns true if the drawTicks property has the default value.
 boolean getIncrementIsDefault()
           
 double getIncrementValue()
          In non-automatic mode, use this value as the increment value; that is, it places ticks at every incrementValue along the scale.
 int getInnerExtent()
          This method returns the distance (in pixels) that tick marks extend into the plot area.
 boolean getInnerExtentIsDefault()
           
 Color getLabelColor()
          Returns the color in which to draw labels.
 int getLabelExtent()
          Returns the distance (in pixels) of tick labels from the axis.
 boolean getLabelExtentIsDefault()
           
 String getName()
          Returns the name of this tick object.
 int getOuterExtent()
          This method returns the distance (in pixels) that tick marks extend beyond the plot area.
 boolean getOuterExtentIsDefault()
           
 com.klg.jclass.chart.JCAxis getParent()
          Returns the parent JCAxis.
 int getPrecision()
          Returns the format for numbers in a tick label.
 boolean getPrecisionIsDefault()
          If true, uses the axis-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.
 double getStartValue()
          In non-automatic mode, uses this value as the start value.
 boolean getStartValueIsDefault()
           
 double getStopValue()
          In non-automatic mode, uses this value as the stop value.
 boolean getStopValueIsDefault()
           
 Color getTickColor()
          Returns the color in which to draw ticks.
 int getType()
          Intended for internal use.
protected  void setChanged(boolean c, int cf)
          Calls the setChanged() method of the parent axis.
 void setDefaultInnerExtent(int defValue)
           
 void setDefaultLabelExtent(int defValue)
           
 void setDefaultOuterExtent(int defValue)
           
 void setDefaultPrecision(int defValue)
           
 void setDrawLabels(boolean drawLabels)
          Returns the Boolean controlling the drawing of labels.
 void setDrawTicks(boolean drawTicks)
          Sets the boolean controlling the drawing of ticks.
 void setIncrementIsDefault(boolean isDefault)
           
 void setIncrementValue(double incrementValue)
          In non-automatic mode, use this value as the increment value; that is, it places ticks at every incrementValue along the scale.
 void setInnerExtent(int innerExtent)
          Sets the pixel length of tick marks within the plot area.
 void setInnerExtentIsDefault(boolean isDefault)
           
 void setLabelColor(Color labelColor)
          The color to use to draw labels.
 void setLabelExtent(int labelExtent)
          Sets the pixel distance at which to place the tick label objects.
 void setLabelExtentIsDefault(boolean isDefault)
           
 void setName(String name)
          Sets the name of this tick object.
 void setOuterExtent(int outerExtent)
          Sets the pixel length of tick marks outside of the plot area.
 void setOuterExtentIsDefault(boolean isDefault)
           
 void setParent(com.klg.jclass.chart.JCAxis axis)
          Sets the parent JCAxis.
 void setPrecision(int precision)
          Sets the format for numbers in a tick label; positive values denote the number of places after the decimal point (for example, 3 means multiples of 0.001), negative values indicate the positive number of zeros are used before the decimal place (for example, -3 means numbering will be in multiples of 1000).
 void setPrecisionIsDefault(boolean isDefault)
          If true, uses the axis-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.
 void setStartValue(double startValue)
          In non-automatic mode, use this value as the start value.
 void setStartValueIsDefault(boolean isDefault)
           
 void setStopValue(double stopValue)
          In non-automatic mode, use this value as the stop value.
 void setStopValueIsDefault(boolean isDefault)
           
 void setTickColor(Color tickColor)
          The color to use to draw ticks.
 void setType(int type)
          Intended for internal use.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LABELS

public static final int DEFAULT_LABELS
See Also:
Constant Field Values

DEFAULT_TICKS

public static final int DEFAULT_TICKS
See Also:
Constant Field Values

USER_DEFINED

public static final int USER_DEFINED
See Also:
Constant Field Values

DEFAULT_INNER_EXTENT

public static final int DEFAULT_INNER_EXTENT
See Also:
Constant Field Values

DEFAULT_OUTER_EXTENT

public static final int DEFAULT_OUTER_EXTENT
See Also:
Constant Field Values

DEFAULT_LABEL_EXTENT

public static final int DEFAULT_LABEL_EXTENT
See Also:
Constant Field Values

parent

protected com.klg.jclass.chart.JCAxis parent

name

protected String name

startValue

protected com.klg.jclass.chart.DerivedDouble startValue
The startValue is the scale value at which to begin this set of tick marks.


stopValue

protected com.klg.jclass.chart.DerivedDouble stopValue
The stopValue is the scale value at which this set of tick marks ends.


incrementValue

protected com.klg.jclass.chart.DerivedDouble incrementValue
If not automatic, the scale values at which tick marks are to be placed.


defPrecision

protected int defPrecision

precision

protected com.klg.jclass.chart.DerivedInt precision
If precisionUseDefault is false, use this precision. If it is true, the value of this property will be automatically calculated and the calculated value will overwrite any previous value this property might have.


drawLabels

protected boolean drawLabels
If true, draw tick labels; otherwise, no tick labels are drawn.


drawTicks

protected boolean drawTicks
If true, draw tick marks; otherwise, no tick marks are drawn.


defLabelExtent

protected int defLabelExtent

labelExtent

protected com.klg.jclass.chart.DerivedInt labelExtent
The distance in pixels of a label from the axis.


defInnerExtent

protected int defInnerExtent

innerExtent

protected com.klg.jclass.chart.DerivedInt innerExtent
The pixel length of a tick within the plot area.


defOuterExtent

protected int defOuterExtent

outerExtent

protected com.klg.jclass.chart.DerivedInt outerExtent
The pixel length of a tick outside of the plot area.


tickColor

protected Color tickColor
The color in which to draw ticks.


labelColor

protected Color labelColor
The color in which to draw labels.


type

protected int type
Constructor Detail

JCAnno

public JCAnno()
Creates a JCAnno object with default properties.


JCAnno

public JCAnno(int type,
              com.klg.jclass.chart.JCAxis parent,
              Color tickColor)
Creates a JCAnno with startValue, stopValue, and incrementValue initialized to the min, max, and tickSpacing values of the parent JCAxis.


JCAnno

public JCAnno(int type,
              com.klg.jclass.chart.JCAxis parent,
              double startValue,
              double stopValue,
              double incrementValue,
              int precision,
              boolean drawLabels,
              boolean drawTicks,
              int labelExtent,
              int innerExtent,
              int outerExtent,
              Color tickColor,
              Color labelColor)
Creates a tick object and sets its properties.

Parameters:
type - The tick object type. Valid values are DEFAULT_LABELS, DEFAULT_TICKS, and USER_DEFINED.
parent - The JCAxis associated with this JCAnno.
startValue - where the tick marks are to begin
stopValue - where the tick marks are to end
incrementValue - the (non-default) tick interval
precision - The format of the tick label; positive values denote the number of places after the decimal point (for example, 3 means multiples of 0.001), and negative values indicate the positive number of zeros to be used before the decimal place (for example, -3 means numbering will be in multiples of 1000). Overridden if precisionIsDefault is set to true.
drawLabels - whether tick labels are to be drawn
drawTicks - whether tick marks are to be drawn
labelExtent - the radial or linear distance to the center of a tick label, expressed as a decimal fraction of the scale's radius or width/height
innerExtent - the place where the tick mark starts, expressed in pixels
outerExtent - the place where the tick mark ends, expressed in pixels
tickColor - the color of the tick mark
labelColor - the color of the labels.
Method Detail

getParent

public com.klg.jclass.chart.JCAxis getParent()
Returns the parent JCAxis.


setParent

public void setParent(com.klg.jclass.chart.JCAxis axis)
Sets the parent JCAxis.


getName

public String getName()
Returns the name of this tick object.


setName

public void setName(String name)
Sets the name of this tick object.


getDrawLabels

public boolean getDrawLabels()
Returns the Boolean controlling the drawing of labels. true means draw the labels, false means hide the labels.

Returns:
the boolean controlling the drawing of labels

getDrawLabelsIsDefault

public boolean getDrawLabelsIsDefault()
Returns true if the drawLabels property has the default value.


getDrawTicksIsDefault

public boolean getDrawTicksIsDefault()
Returns true if the drawTicks property has the default value.


getDrawTicks

public boolean getDrawTicks()
Returns the Boolean controlling the drawing of ticks. true means draw the ticks, false means hide the ticks.

Returns:
the boolean controlling the drawing of ticks

getIncrementValue

public double getIncrementValue()
In non-automatic mode, use this value as the increment value; that is, it places ticks at every incrementValue along the scale. In automatic mode, the calculated increment value will overwrite this value.

Returns:
the spacing between adjacent tick marks

getIncrementIsDefault

public boolean getIncrementIsDefault()

getInnerExtent

public int getInnerExtent()
This method returns the distance (in pixels) that tick marks extend into the plot area.

Returns:
the inner extent of the tick mark

getInnerExtentIsDefault

public boolean getInnerExtentIsDefault()

getDefaultInnerExtent

public int getDefaultInnerExtent()

getLabelExtent

public int getLabelExtent()
Returns the distance (in pixels) of tick labels from the axis.

Returns:
The pixel distance of labels from the axis.

getLabelExtentIsDefault

public boolean getLabelExtentIsDefault()

getDefaultLabelExtent

public int getDefaultLabelExtent()

getOuterExtent

public int getOuterExtent()
This method returns the distance (in pixels) that tick marks extend beyond the plot area.

Returns:
the outer extent of the tick mark

getOuterExtentIsDefault

public boolean getOuterExtentIsDefault()

getDefaultOuterExtent

public int getDefaultOuterExtent()

getPrecision

public int getPrecision()
Returns the format for numbers in a tick label. Positive values denote the number of places after the decimal point (for example, 3 means multiples of 0.001); negative values indicate the positive number of zeros that are used before the decimal place (for example, -3 means numbering will be in multiples of 1000). Overridden if precisionUseDefault is set to true.

Returns:
the precision code for formatting numbers in a tick label

getPrecisionIsDefault

public boolean getPrecisionIsDefault()
If true, uses the axis-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.

Returns:
a Boolean indicating whether or not a label's precision is calculated by the gauge or gotten from the precision property

getDefaultPrecision

public int getDefaultPrecision()

getStartValue

public double getStartValue()
In non-automatic mode, uses this value as the start value. In automatic mode, the calculated start value will overwrite this value.

Returns:
the start value

getStartValueIsDefault

public boolean getStartValueIsDefault()

getStopValue

public double getStopValue()
In non-automatic mode, uses this value as the stop value. In automatic mode, the calculated stop value will overwrite this value.

Returns:
the stop value

getStopValueIsDefault

public boolean getStopValueIsDefault()

getTickColor

public Color getTickColor()
Returns the color in which to draw ticks. If a tick color has not been specified for this JCAnno object, return the parent's foreground color. If the parent is undefined, or if the parent's foreground color is null, return Color.black.

Returns:
the color of the tick mark

getLabelColor

public Color getLabelColor()
Returns the color in which to draw labels. If a label color has not been specified for this JCAnno object, return the parent's foreground color. If the parent is undefined, or if the parent's foreground color is null, return Color.black.

Returns:
the color of the tick mark

setDrawLabels

public void setDrawLabels(boolean drawLabels)
Returns the Boolean controlling the drawing of labels. true means draw the labels; false means hide the labels.

Parameters:
drawLabels - the boolean controlling the drawing of labels

setDrawTicks

public void setDrawTicks(boolean drawTicks)
Sets the boolean controlling the drawing of ticks. true means draw the ticks; false means hide the ticks.

Parameters:
drawTicks - the boolean controlling the drawing of ticks

setIncrementValue

public void setIncrementValue(double incrementValue)
In non-automatic mode, use this value as the increment value; that is, it places ticks at every incrementValue along the scale. In automatic mode, the calculated increment value will overwrite this value.

Parameters:
incrementValue - the spacing between adjacent tick marks

setIncrementIsDefault

public void setIncrementIsDefault(boolean isDefault)

setInnerExtent

public void setInnerExtent(int innerExtent)
Sets the pixel length of tick marks within the plot area.

Parameters:
innerExtent - the inner extent of the tick mark

setInnerExtentIsDefault

public void setInnerExtentIsDefault(boolean isDefault)

setDefaultInnerExtent

public void setDefaultInnerExtent(int defValue)

setLabelExtent

public void setLabelExtent(int labelExtent)
Sets the pixel distance at which to place the tick label objects.

Parameters:
labelExtent - the label extent

setLabelExtentIsDefault

public void setLabelExtentIsDefault(boolean isDefault)

setDefaultLabelExtent

public void setDefaultLabelExtent(int defValue)

setOuterExtent

public void setOuterExtent(int outerExtent)
Sets the pixel length of tick marks outside of the plot area.

Parameters:
outerExtent - the outer extent of the tick mark

setOuterExtentIsDefault

public void setOuterExtentIsDefault(boolean isDefault)

setDefaultOuterExtent

public void setDefaultOuterExtent(int defValue)

setPrecision

public void setPrecision(int precision)
Sets the format for numbers in a tick label; positive values denote the number of places after the decimal point (for example, 3 means multiples of 0.001), negative values indicate the positive number of zeros are used before the decimal place (for example, -3 means numbering will be in multiples of 1000). Overridden if precisionUseDefault is set to true.

Parameters:
precision - an integer that specifies the number of decimal places for the values in tick labels

setPrecisionIsDefault

public void setPrecisionIsDefault(boolean isDefault)
If true, uses the axis-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.

Parameters:
isDefault - whether or not to use the axis-determined precision

setDefaultPrecision

public void setDefaultPrecision(int defValue)

setStartValue

public void setStartValue(double startValue)
In non-automatic mode, use this value as the start value. In automatic mode, the calculated start value will overwrite this value.

Parameters:
startValue - the start value

setStartValueIsDefault

public void setStartValueIsDefault(boolean isDefault)

setStopValue

public void setStopValue(double stopValue)
In non-automatic mode, use this value as the stop value. In automatic mode, the calculated stop value will overwrite this value.

Parameters:
stopValue - the stop value

setStopValueIsDefault

public void setStopValueIsDefault(boolean isDefault)

setTickColor

public void setTickColor(Color tickColor)
The color to use to draw ticks.

Parameters:
tickColor - the color of the tick mark

setLabelColor

public void setLabelColor(Color labelColor)
The color to use to draw labels.

Parameters:
labelColor - the color of the label

setType

public void setType(int type)
Intended for internal use. Sets the type property of this JCAnno object. Valid values are JCAnno.DEFAULT_LABELS, JCAnno.DEFAULT_TICKS, or JCAnno.USER_DEFINED.


getType

public int getType()
Intended for internal use. Returns the type property of this JCAnno object. Possible values are JCAnno.DEFAULT_LABELS, JCAnno.DEFAULT_TICKS, or JCAnno.USER_DEFINED.


setChanged

protected void setChanged(boolean c,
                          int cf)
Calls the setChanged() method of the parent axis.

Parameters:
c - new value for Changed
cf - the value with which to update the changed flag

toString

public String toString()
Overrides:
toString in class Object

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