JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing.gauge
Class JCAbstractTick

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.swing.gauge.JCAbstractTick
All Implemented Interfaces:
ImageObserver, JCTick, MenuContainer, Serializable
Direct Known Subclasses:
JCCircularTick, JCLinearTick

public abstract class JCAbstractTick
extends JComponent
implements JCTick, Serializable

A graduated scale marker object. It comprises a set of uniformly spaced tick marks.

See Also:
JCAbstractTick, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  boolean automatic
          The automatic boolean determines whether tick increments are calculated automatically or set by the incrementValue property.
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  Color fontColor
          The color of the font labeling ticks.
protected  double incrementValue
          If not automatic, the scale values at which tick marks are to be placed.
protected  double innerExtent
          The percentage of the scale's radius (as a decimal) at at which to begin drawing ticks radially outward.
protected  double labelExtent
          The percentage, expressed as a decimal fraction of the scale's radius, at which to place tick labels.
protected  com.klg.jclass.swing.gauge.JCLabelGenerator labelGenerator
          A custom label generator.
protected  double outerExtent
          The percentage of the scale's radius or width/height (as a decimal) at which to stop drawing the ticks.
protected  int precision
          If precisionUseDefault is false, use this precision.
protected  boolean precisionUseDefault
          If true, use gauge-determined precision.
protected  boolean reversed
          Asks: "Is the tick reversed?".
protected  com.klg.jclass.swing.gauge.JCScale scale
          The scale associated with this tick object.
protected  double startValue
          The startValue is the scale value at which to begin this set of tick marks.
protected  double 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  com.klg.jclass.swing.gauge.JCTickStyle tickStyle
          The JCTickStyle controlling the shape of the tick.
protected  double tickWidth
          The width of a tick in pixels.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCAbstractTick(com.klg.jclass.swing.gauge.JCScale scale, boolean automatic, double startValue, double stopValue, double incrementValue, boolean precisionUseDefault, int precision, double tickWidth, boolean drawLabels, boolean drawTicks, double labelExtent, double innerExtent, double outerExtent, Color tickColor, com.klg.jclass.swing.gauge.JCTickStyle tickStyle, Font font, Color fontColor)
          Creates a tick object and sets its properties.
JCAbstractTick(com.klg.jclass.swing.gauge.JCScale scale, double startValue, double stopValue)
          Creates ticks.
 
Method Summary
protected  void calcPrecision(double min, double max)
          Determines and sets a "nice" precision to use if useDefaultPrecision is set to true.
protected  void calcTicks(Graphics g, int width)
          If automatic, this method is called to determine and set the start/stop and increment values for laying out ticks.
 boolean getAutomatic()
          Returns the automatic Boolean for this tick object.
 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.
 double getInnerExtent()
          Returns the percentage of the scale's radius (as a decimal) at which to begin drawing ticks radially outward.
 double getLabelExtent()
          Returns the position, expressed as a decimal fraction of the scale's size, where tick labels are placed (the size is the scale's radius or its width/height, depending on the linear scale's orientation).
 com.klg.jclass.swing.gauge.JCLabelGenerator getLabelGenerator()
          Returns the label generator associated with this tick.
 double getOuterExtent()
          Returns the percentage of the scale's radius (as a decimal) at which to stop drawing the ticks.
 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 are used before the decimal place (for example, -3 means numbering will be in multiples of 1000).
 boolean getPrecisionUseDefault()
          If true, uses 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, use this value as the start value.
 double getStopValue()
          In non-automatic mode, use 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()
          Asks: "Is the tick reversed?".
static double niceNum(double x, int exp, boolean round)
          Given x, nudges it towards a "nice" number.
 void paintChildren(Graphics g)
          Controls whether labels should be drawn according to the drawLabels boolean.
 void redraw()
          Call this instead of paint so that the repaintEnabled flag can be checked.
 void redraw(boolean redrawLabels)
          Does nothing.
 void redrawLabels()
          Does nothing.
 void setAutomatic(boolean automatic)
          Sets the automatic Boolean for this tick object.
 void setDrawLabels(boolean drawLabels)
          Sets 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 labeling ticks.
 void setIncrementValue(double incrementValue)
          In non-automatic mode, use this value as the increment value.
 void setInnerExtent(double innerExtent)
          Sets the percentage of the scale's radius (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 radius (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)
          Sets the color in which 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.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scale

protected com.klg.jclass.swing.gauge.JCScale scale
The scale associated with this tick object.


automatic

protected boolean automatic
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.


startValue

protected double startValue
The startValue is the scale value at which to begin this set of tick marks.


stopValue

protected double stopValue
The stopValue is the scale value at which this set of tick marks ends.


incrementValue

protected double incrementValue
If not automatic, the scale values at which tick marks are to be placed.


precisionUseDefault

protected boolean precisionUseDefault
If true, use gauge-determined precision. If false, use the precision property to determine the number of decimal places on tick labels.


precision

protected int 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.


tickWidth

protected double tickWidth
The width of a tick in pixels.


reversed

protected boolean reversed
Asks: "Is the tick reversed?".


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.


labelExtent

protected double labelExtent
The percentage, expressed as a decimal fraction of the scale's radius, at which to place tick labels.


innerExtent

protected double innerExtent
The percentage of the scale's radius (as a decimal) at at which to begin drawing ticks radially outward.


outerExtent

protected double outerExtent
The percentage of the scale's radius or width/height (as a decimal) at which to stop drawing the ticks.


tickColor

protected Color tickColor
The color in which to draw ticks.


tickStyle

protected com.klg.jclass.swing.gauge.JCTickStyle tickStyle
The JCTickStyle controlling the shape of the tick.


fontColor

protected Color fontColor
The color of the font labeling ticks.


labelGenerator

protected com.klg.jclass.swing.gauge.JCLabelGenerator labelGenerator
A custom label generator.

Constructor Detail

JCAbstractTick

public JCAbstractTick(com.klg.jclass.swing.gauge.JCScale scale,
                      double startValue,
                      double stopValue)
Creates ticks. A scale, startValue, and stopValue need to be supplied. The other properties take on their default values.

Parameters:
scale - the associated circular scale
startValue - where the tick marks are to begin
stopValue - where the tick marks are to end

JCAbstractTick

public JCAbstractTick(com.klg.jclass.swing.gauge.JCScale scale,
                      boolean automatic,
                      double startValue,
                      double stopValue,
                      double incrementValue,
                      boolean precisionUseDefault,
                      int precision,
                      double tickWidth,
                      boolean drawLabels,
                      boolean drawTicks,
                      double labelExtent,
                      double innerExtent,
                      double outerExtent,
                      Color tickColor,
                      com.klg.jclass.swing.gauge.JCTickStyle tickStyle,
                      Font font,
                      Color fontColor)
Creates a tick object and sets its properties.

Parameters:
scale - the associated circular or linear scale
automatic - whether to automatically calculate the tick start, stop, and increment values from the scale's min and max, or to use the provided values
startValue - where the tick marks are to begin
stopValue - where the tick marks are to end
incrementValue - the tick interval
precisionUseDefault - sets whether tick labels use a default precision, or use precision
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 precisionUseDefault is set to true.
tickWidth - the width of a tick mark
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 as a decimal fraction of the scale's radius or width/height
outerExtent - the place where the tick mark ends, expressed as a decimal fraction of the scale's radius or width/height
tickColor - the color of the tick mark
tickStyle - a JCTickStyle enum
font - the font for tick labels
fontColor - the tick label's color
Method Detail

paintChildren

public void paintChildren(Graphics g)
Controls whether labels should be drawn according to the drawLabels boolean.

Overrides:
paintChildren in class JComponent
Parameters:
g -

calcTicks

protected void calcTicks(Graphics g,
                         int width)
If automatic, this method is called to determine and set the start/stop and increment values for laying out ticks. The goal is to have as many ticks/labels as will fit without the ticks or labels overlapping.

Parameters:
g - the graphics used to get font metric information
width - width in pixels to lay out ticks

calcPrecision

protected void calcPrecision(double min,
                             double max)
Determines and sets a "nice" precision to use if useDefaultPrecision is set to true.

Parameters:
min -
max -

niceNum

public static double niceNum(double x,
                             int exp,
                             boolean round)
Given x, nudges it towards a "nice" number. Here, "nice" means that the least significant digit is a 0, 1, 2, or 5. The desired exponent to use is provided, so that there is a consistency with default_precision.

Parameters:
x -
exp -
round -
Returns:

getScale

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

Specified by:
getScale in interface JCTick
Returns:
the scale for the JCAbstractTick component

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.

Specified by:
getLabelGenerator in interface JCTick
Returns:
the labelGenerator

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.

Specified by:
setLabelGenerator in interface JCTick
Parameters:
labelGenerator - the labelGenerator which implements the JCLabelGenerator interface

getAutomatic

public boolean getAutomatic()
Returns the automatic Boolean for this tick object.

Specified by:
getAutomatic in interface JCTick
Returns:
the automatic setting for this tick, where true means ticks and increments are dynamically determined by the gauge; otherwise, startValue, stopValue, and incrementValue are used to lay out ticks

setAutomatic

public void setAutomatic(boolean automatic)
Sets the automatic Boolean for this tick object.

Specified by:
setAutomatic in interface JCTick
Parameters:
automatic - the automatic setting for this tick, where true means ticks and increments are dynamically determined by the gauge; otherwise, startValue, stopValue, and incrementValue are used to lay out ticks.

getStartValue

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

Specified by:
getStartValue in interface JCTick
Returns:
the startValue

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.

Specified by:
setStartValue in interface JCTick
Parameters:
startValue - the start value

getStopValue

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

Specified by:
getStopValue in interface JCTick
Returns:
the stopValue

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.

Specified by:
setStopValue in interface JCTick
Parameters:
stopValue - the stop value

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.

Specified by:
getIncrementValue in interface JCTick
Returns:
the spacing between adjacent tick marks

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.

Specified by:
setIncrementValue in interface JCTick
Parameters:
incrementValue - the spacing between adjacent tick marks

getPrecisionUseDefault

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

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

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.

Specified by:
setPrecisionUseDefault in interface JCTick
Parameters:
precisionUseDefault -

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 are used before the decimal place (for example, -3 means numbering will be in multiples of 1000). Overridden if precisionUseDefault is set to true.

Specified by:
getPrecision in interface JCTick
Returns:
the precision code for formatting numbers in a tick label

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.

Specified by:
setPrecision in interface JCTick
Parameters:
precision - an integer

getTickWidth

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

Specified by:
getTickWidth in interface JCTick
Returns:
the width of the tick to be drawn

setTickWidth

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

Specified by:
setTickWidth in interface JCTick
Parameters:
tickWidth - the width in pixels of the tick to be drawn

isReversed

public boolean isReversed()
Asks: "Is the tick reversed?".

Specified by:
isReversed in interface JCTick
Returns:
whether the tick is reversed or not

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 example, 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).

Specified by:
setReversed in interface JCTick
Parameters:
reversed - is the tick's direction reversed?

getDrawLabels

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

Specified by:
getDrawLabels in interface JCTick
Returns:
the boolean controlling the drawing of labels

setDrawLabels

public void setDrawLabels(boolean drawLabels)
Sets the Boolean controlling the drawing of labels. True means draw the labels, false means hide the labels.

Specified by:
setDrawLabels in interface JCTick
Parameters:
drawLabels - 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.

Specified by:
getDrawTicks in interface JCTick
Returns:
the boolean controlling the drawing of ticks

setDrawTicks

public void setDrawTicks(boolean drawTicks)
Sets the Boolean controlling the drawing of ticks. True means draw the ticks, false means hide the ticks.

Specified by:
setDrawTicks in interface JCTick
Parameters:
drawTicks - the boolean controlling the drawing of ticks

getLabelExtent

public double getLabelExtent()
Returns the position, expressed as a decimal fraction of the scale's size, where tick labels are placed (the size is the scale's radius or its width/height, depending on the linear scale's orientation).

Specified by:
getLabelExtent in interface JCTick
Returns:
the fraction representing the position at which labels are placed

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.

Specified by:
setLabelExtent in interface JCTick
Parameters:
labelExtent -

getInnerExtent

public double getInnerExtent()
Returns the percentage of the scale's radius (as a decimal) at which to begin drawing ticks radially outward.

Specified by:
getInnerExtent in interface JCTick
Returns:
the inner extent of the tick mark

setInnerExtent

public void setInnerExtent(double innerExtent)
Sets the percentage of the scale's radius (as a decimal) at at which to begin drawing ticks radially outward.

Specified by:
setInnerExtent in interface JCTick
Parameters:
innerExtent - the inner extent of the tick mark

getOuterExtent

public double getOuterExtent()
Returns the percentage of the scale's radius (as a decimal) at which to stop drawing the ticks.

Specified by:
getOuterExtent in interface JCTick
Returns:
the outerExtent of the tick mark

setOuterExtent

public void setOuterExtent(double outerExtent)
Sets the percentage of the scale's radius (as a decimal) at which to stop drawing the ticks.

Specified by:
setOuterExtent in interface JCTick
Parameters:
outerExtent - the outerExtent of the tick mark

getTickColor

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

Specified by:
getTickColor in interface JCTick
Returns:
the color of the tick mark

setTickColor

public void setTickColor(Color tickColor)
Sets the color in which to draw ticks.

Specified by:
setTickColor in interface JCTick
Parameters:
tickColor - the color of the tick mark

getTickStyle

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

Specified by:
getTickStyle in interface JCTick
Returns:
the tick style
See Also:
JCTickStyle

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.

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

getFontColor

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

Specified by:
getFontColor in interface JCTick
Returns:
the font color

setFontColor

public void setFontColor(Color fontColor)
Sets the color of the font labeling ticks.

Specified by:
setFontColor in interface JCTick
Parameters:
fontColor - the font color

redraw

public void redraw(boolean redrawLabels)
Does nothing. Overridden in JCCircularTick or JCLinearTick.

Parameters:
redrawLabels -

redraw

public void redraw()
Call this instead of paint so that the repaintEnabled flag can be checked. No repaint will occur if that flag is false.


redrawLabels

public void redrawLabels()
Does nothing. Overridden in JCCircularTick or JCLinearTick.


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