JClass 4.5.0 API
Documentation

com.klg.jclass.swing.gauge
Class JCCircularRange

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.swing.gauge.JCRange
                          |
                          +--com.klg.jclass.swing.gauge.JCCircularRange

public class JCCircularRange
extends JCRange
implements Serializable

A range is used to demarcate some sub-portion of the scale. For example, on a tachometer gauge you could have a range to delimit the "red line" range of revolutions per minute (rpm). A gauge can have zero or more ranges associated with it.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
protected  int innerArcStartCompensator
           
protected  int innerArcStopCompensator
           
 
Fields inherited from class com.klg.jclass.swing.gauge.JCRange
innerExtent, outerExtent, rangeCounter, rangeName, scale, startValue, stopValue
 
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
 
Constructor Summary
JCCircularRange(Color foreground, JCCircularScale scale, double innerExtent, double outerExtent, double startValue, double stopValue)
          Create a circular range.
 
Method Summary
 int getInnerArcStartCompensator()
          Compensate for awt drawArc precision problems when drawing the inner arc of the range.
 int getInnerArcStopCompensator()
          Compensate for awt drawArc precision problems when drawing the inner arc of the range.
 Dimension getPreferredSize()
          Return the preferred size of this range which will be the preferred size of the scale.
 void paintComponent(Graphics g)
          This routine will draw a circular range.
 void redraw()
          Call this instead of paint so that the repaintEnabled flag can be checked.
 void setInnerArcStartCompensator(int innerArcStartCompensator)
          Compensate for awt drawArc precision problems when drawing the inner arc of the range.
 void setInnerArcStopCompensator(int innerArcStopCompensator)
          Compensate for awt drawArc precision problems when drawing the inner arc of the range.
 
Methods inherited from class com.klg.jclass.swing.gauge.JCRange
getInnerExtent, getOuterExtent, getRangeName, getScale, getStartValue, getStopValue, setInnerExtent, setOuterExtent, setRangeName, setScale, setStartValue, setStopValue
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

innerArcStartCompensator

protected int innerArcStartCompensator

innerArcStopCompensator

protected int innerArcStopCompensator
Constructor Detail

JCCircularRange

public JCCircularRange(Color foreground,
                       JCCircularScale scale,
                       double innerExtent,
                       double outerExtent,
                       double startValue,
                       double stopValue)
Create a circular range.
Parameters:
scale - The scale associated with this range
innerExtent - The ratio of the radius's length to start drawing this range from the center. For example, 0.8 means start drawing this range 80% of the radius's size from the center.
outerExtent - The ratio of the radius's length to end drawing this range from the center. For example, 0.9 means stop drawing this range 90% of the radius's size from the center.
startValue - The scale value (not angle) at which to begin the range
stopValue - The scale value (not angle) at which to stop the range
Method Detail

getPreferredSize

public Dimension getPreferredSize()
Return the preferred size of this range which will be the preferred size of the scale.
Overrides:
getPreferredSize in class JComponent
Returns:
the preferred size

getInnerArcStartCompensator

public int getInnerArcStartCompensator()
Compensate for awt drawArc precision problems when drawing the inner arc of the range. This applies to the J version only.
Returns:
the amount by which to overdraw in the inner arc start angle

setInnerArcStartCompensator

public void setInnerArcStartCompensator(int innerArcStartCompensator)
Compensate for awt drawArc precision problems when drawing the inner arc of the range. This applies to the J version only.
Parameters:
innerArcStartCompensator - the amount by which to overdraw in the inner arc start angle

getInnerArcStopCompensator

public int getInnerArcStopCompensator()
Compensate for awt drawArc precision problems when drawing the inner arc of the range. This applies to the J version only.
Returns:
the amount by which to overdraw in the inner arc stop angle

setInnerArcStopCompensator

public void setInnerArcStopCompensator(int innerArcStopCompensator)
Compensate for awt drawArc precision problems when drawing the inner arc of the range. This applies to the J version only.
Parameters:
innerArcStopCompensator - the amount by which to overdraw in the inner arc stop angle

paintComponent

public void paintComponent(Graphics g)
This routine will draw a circular range.
Overrides:
paintComponent in class JComponent

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.
Overrides:
redraw in class JCRange

Copyright© 1999-2000 KL Group Inc.
All rights reserved.