JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing.gauge
Interface JCTick

All Known Implementing Classes:
JCAbstractTick

public interface JCTick

The interface for tick objects. Those wishing to use their own tick objects should implement this interface. A graduated marks on a scale. A JCTick object comprises a set of uniformly spaced tick marks.


Method Summary
 boolean getAutomatic()
          The automatic boolean determines whether tick increments are calculated automatically or set by the incrementValue property.
 boolean getDrawLabels()
          Returns the Boolean controlling the drawing of labels.
 boolean getDrawTicks()
          Returns the Boolean controlling the drawing of ticks.
 Color getFontColor()
          Returns the color of the font labeling ticks.
 double getIncrementValue()
          In non-automatic mode, use this value as the increment value; that is, it places ticks at every incrementValue along the scale.
 double getInnerExtent()
          Returns the percentage of the scale's radius (as a decimal) at which to begin drawing ticks.
 double getLabelExtent()
          Returns the position, expressed as a decimal fraction of the scale's size, where tick labels are placed.
 com.klg.jclass.swing.gauge.JCLabelGenerator getLabelGenerator()
          Returns the label generator associated with this tick.
 double getOuterExtent()
          Returns the percentage of the scale's size parameter (as a decimal) at which to stop drawing the ticks.
 int getPrecision()
          Returns the format for numbers in a tick label.
 boolean getPrecisionUseDefault()
          If true, uses the gauge-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.
 com.klg.jclass.swing.gauge.JCScale getScale()
          Returns the scale associated with this tick.
 double getStartValue()
          In non-automatic mode, usez this value as the start value.
 double getStopValue()
          In non-automatic mode, usez this value as the stop value.
 Color getTickColor()
          Returns the color in which to draw ticks.
 com.klg.jclass.swing.gauge.JCTickStyle getTickStyle()
          Returns the JCTickStyle controlling the shape of the tick.
 double getTickWidth()
          Returns the width, in pixels, of the tick mark.
 boolean isReversed()
          Is the tick reversed? By setting this property to true, a mirror image of the tick shape is obtained.
 void setAutomatic(boolean automatic)
          Sets the automatic Boolean for this tick object.
 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 setFontColor(Color fontColor)
          Sets the color of the font used to label ticks.
 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(double innerExtent)
          Sets the percentage of the scale's size (as a decimal) at at which to begin drawing ticks radially outward.
 void setLabelExtent(double labelExtent)
          Sets the percentage, expressed as a decimal fraction of the scale's size, at which to place the center of the tick label objects.
 void setLabelGenerator(com.klg.jclass.swing.gauge.JCLabelGenerator labelGenerator)
          Sets the label generator associated with this tick.
 void setOuterExtent(double outerExtent)
          Sets the percentage of the scale's size (as a decimal) at which to stop drawing the ticks.
 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 setPrecisionUseDefault(boolean precisionUseDefault)
          If true, uses the gauge-determined precision for tick labels; otherwise, uses the current value of precision property to label tick marks.
 void setReversed(boolean reversed)
          Sets the reversed property of the tick.
 void setStartValue(double startValue)
          In non-automatic mode, use this value as the start value.
 void setStopValue(double stopValue)
          In non-automatic mode, use this value as the stop value.
 void setTickColor(Color tickColor)
          The color to use to draw ticks.
 void setTickStyle(com.klg.jclass.swing.gauge.JCTickStyle tickStyle)
          Sets the JCTickStyle controlling the shape of the tick.
 void setTickWidth(double tickWidth)
          Sets the width in pixels of the tick mark.
 

Method Detail

getAutomatic

public boolean getAutomatic()
The automatic boolean determines whether tick increments are calculated automatically or set by the incrementValue property. If true, tick increments are calculated by the gauge. If false, the incrementValue property is used to set the tick spacing.

Returns:
true if tick increments are to be calculated automatically

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

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

getFontColor

public Color getFontColor()
Returns the color of the font labeling ticks.

Returns:
the font color

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

getInnerExtent

public double getInnerExtent()
Returns the percentage of the scale's radius (as a decimal) at which to begin drawing ticks. The tick marks are drawn between the inner extent and the outer extent.

Returns:
the inner extent of the tick mark

getLabelExtent

public double getLabelExtent()
Returns the position, expressed as a decimal fraction of the scale's size, where tick labels are placed. The size parameter depends on what type of scale is in use.

Returns:
the fraction representing the position at which labels are placed

getLabelGenerator

public com.klg.jclass.swing.gauge.JCLabelGenerator getLabelGenerator()
Returns the label generator associated with this tick. If non-null, it will be called, and expected to return a JComponent which will be the label for a tick mark.

Returns:
the labelGenerator

getOuterExtent

public double getOuterExtent()
Returns the percentage of the scale's size parameter (as a decimal) at which to stop drawing the ticks. The size depends on the type of scale. For a circular scale it is its radius or for a linear scale, the width or height, depending on its orientation.

Returns:
the outer extent of the tick mark

getPrecision

public int getPrecision()
Returns the format for numbers in a tick label. As implemented in JCAbstractTick, 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

getPrecisionUseDefault

public boolean getPrecisionUseDefault()
If true, uses the gauge-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

getScale

public com.klg.jclass.swing.gauge.JCScale getScale()
Returns the scale associated with this tick.

Returns:
the scale for the JCTick component

getStartValue

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

Returns:
the start value

getStopValue

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

Returns:
the stop value

getTickColor

public Color getTickColor()
Returns the color in which to draw ticks.

Returns:
the color of the tick mark

getTickStyle

public com.klg.jclass.swing.gauge.JCTickStyle getTickStyle()
Returns the JCTickStyle controlling the shape of the tick.

Returns:
the tick style

getTickWidth

public double getTickWidth()
Returns the width, in pixels, of the tick mark.

Returns:
the width of the tick to be drawn

isReversed

public boolean isReversed()
Is the tick reversed? By setting this property to true, a mirror image of the tick shape is obtained.

Returns:
the flag indicating whether to use the mirror image

setAutomatic

public void setAutomatic(boolean automatic)
Sets the automatic Boolean for this tick object. true means ticks and increments are dynamically determined by the gauge. Otherwise, startValue, stopValue, and incrementValue are used to lay out ticks.

Parameters:
automatic - whether automatic or code-controlled tick spacing is used

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

setFontColor

public void setFontColor(Color fontColor)
Sets the color of the font used to label ticks.

Parameters:
fontColor - the font color

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

setInnerExtent

public void setInnerExtent(double innerExtent)
Sets the percentage of the scale's size (as a decimal) at at which to begin drawing ticks radially outward. The size parameter is the radius in a circular scale, or the width or height, depending on the orientation, in a linear scale.

Parameters:
innerExtent - the inner extent of the tick mark

setLabelExtent

public void setLabelExtent(double labelExtent)
Sets the percentage, expressed as a decimal fraction of the scale's size, at which to place the center of the tick label objects.

Parameters:
labelExtent - the label extent

setLabelGenerator

public void setLabelGenerator(com.klg.jclass.swing.gauge.JCLabelGenerator labelGenerator)
Sets the label generator associated with this tick. If non-null, it will be called, and expected to return a JComponent, which will be the label for a tick mark. See the code in examples.elements.StopWatchExample for an example.

Parameters:
labelGenerator - the labelGenerator which implements the JCLabelGenerator interface

setOuterExtent

public void setOuterExtent(double outerExtent)
Sets the percentage of the scale's size (as a decimal) at which to stop drawing the ticks. The size parameter is the radius in a circular scale, or the width or height, depending on the orientation, in a linear scale.

Parameters:
outerExtent - the outer extent of the tick mark

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

setPrecisionUseDefault

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

Parameters:
precisionUseDefault - whether or not to use the gauge-determined precision

setReversed

public void setReversed(boolean reversed)
Sets the reversed property of the tick. If the tick is reversed it draws in the opposite direction (for linear scales it points left or up instead of right or down, for circular scales it points towards the center instead of away from the center).

Parameters:
reversed - Is the tick's direction reversed?

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

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

setTickColor

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

Parameters:
tickColor - the color of the tick mark

setTickStyle

public void setTickStyle(com.klg.jclass.swing.gauge.JCTickStyle tickStyle)
Sets the JCTickStyle controlling the shape of the tick. Users may define their own tick style, if desired.

Parameters:
tickStyle - one of the built-in tick styles, or a user-supplied style
See Also:
JCTickStyle

setTickWidth

public void setTickWidth(double tickWidth)
Sets the width in pixels of the tick mark.

Parameters:
tickWidth - the width in pixels of the tick to be drawn

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