JClass DesktopViews 6.3.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.JCAbstractRange
                          |
                          +--com.klg.jclass.swing.gauge.JCCircularRange
All Implemented Interfaces:
ImageObserver, JCRange, MenuContainer, Serializable

public class JCCircularRange
extends JCAbstractRange
implements Serializable

A circular 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

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  int innerArcStartCompensator
           
protected  int innerArcStopCompensator
           
 
Fields inherited from class com.klg.jclass.swing.gauge.JCAbstractRange
image, innerExtent, outerExtent, rangeCounter, rangeName, scale, scaleImage, 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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCCircularRange(Color foreground, com.klg.jclass.swing.gauge.JCCircularScale scale, double innerExtent, double outerExtent, double startValue, double stopValue)
          Creates a circular range.
 
Method Summary
protected  void drawImage(Graphics g, Image image, Rectangle bounds)
           
protected  Polygon getCircularRangeShape(double startAngle, double stopAngle, double radiusSize, double innerRadius, double outerRadius)
           
 com.klg.jclass.swing.gauge.JCCircularScale getCircularScale()
          Returns the circular scale associated with this range.
 int getInnerArcStartCompensator()
          Compensates for awt drawArc precision problems when drawing the inner arc of the range.
 int getInnerArcStopCompensator()
          Compensates for awt drawArc precision problems when drawing the inner arc of the range.
 Dimension getPreferredSize()
          Returns 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)
          Compensates for awt drawArc precision problems when drawing the inner arc of the range.
 void setInnerArcStopCompensator(int innerArcStopCompensator)
          Compensates for awt drawArc precision problems when drawing the inner arc of the range.
 
Methods inherited from class com.klg.jclass.swing.gauge.JCAbstractRange
getImage, getInnerExtent, getOuterExtent, getRangeName, getScale, getScaleImage, getStartValue, getStopValue, setImage, setInnerExtent, setOuterExtent, setRangeName, setScaleImage, setStartValue, setStopValue
 
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, 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, paintChildren, 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
 
Methods inherited from interface com.klg.jclass.swing.gauge.JCRange
getForeground
 

Field Detail

innerArcStartCompensator

protected int innerArcStartCompensator

innerArcStopCompensator

protected int innerArcStopCompensator
Constructor Detail

JCCircularRange

public JCCircularRange(Color foreground,
                       com.klg.jclass.swing.gauge.JCCircularScale scale,
                       double innerExtent,
                       double outerExtent,
                       double startValue,
                       double stopValue)
Creates a circular range.

Parameters:
foreground - the range's color
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

getCircularScale

public com.klg.jclass.swing.gauge.JCCircularScale getCircularScale()
Returns the circular scale associated with this range.

Returns:
the circular scale associated with this range

getPreferredSize

public Dimension getPreferredSize()
Returns 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()
Compensates 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)
Compensates 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()
Compensates 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)
Compensates 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
Parameters:
g -

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 JCAbstractRange

getCircularRangeShape

protected Polygon getCircularRangeShape(double startAngle,
                                        double stopAngle,
                                        double radiusSize,
                                        double innerRadius,
                                        double outerRadius)

drawImage

protected void drawImage(Graphics g,
                         Image image,
                         Rectangle bounds)

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