JClass 4.5.0 API
Documentation

com.klg.jclass.swing.gauge
Class JCRange

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

public abstract class JCRange
extends JComponent
implements Serializable

A range may be used to draw the circumference of a circular scale. A range is also used to delineate some sub-portion of the scale. For example, on a tachometer gauge you could have a range showing the "red line" region of excessive revolutions per minute (rpm). A gauge can have zero or more ranges associated with it.
By default, the items in a gauge's legend are ranges.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
protected  double innerExtent
          The place to start drawing this range from the center.
protected  double outerExtent
          The place to stop drawing this range.
protected static int rangeCounter
          Static counter for generated range names.
protected  String rangeName
          The name of the range which will appear in the legend.
protected  JCScale scale
          The scale associated with this range.
protected  double startValue
          The scale value (not angle) at which to begin the range.
protected  double stopValue
          The scale value (not angle) at which to stop the range.
 
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
JCRange(Color foreground, JCCircularScale scale, double innerExtent, double outerExtent, double startValue, double stopValue)
          Creates a range with the properties specified in the parameters.
 
Method Summary
 double getInnerExtent()
          Specifies where the inner boundary of the range is.
 double getOuterExtent()
          Returns where the outer boundary of the range is.
 String getRangeName()
          Gets the name of this range.
 JCScale getScale()
          Returns the scale associated with this range.
 double getStartValue()
          Returns the scale value (not angle) at which to begin the range.
 double getStopValue()
          Returns the scale value (not angle) at which to stop the range.
 void redraw()
          Does nothing, overridden in JCCircularRange.
 void setInnerExtent(double innerExtent)
          Sets where the inner boundary of the range is.
 void setOuterExtent(double outerExtent)
          Sets where the outer boundary of the range is.
 void setRangeName(String rangeName)
          Sets the rangeName.
 void setScale(JCScale scale)
          Sets the scale associated with this range.
 void setStartValue(double startValue)
          Sets the scale value (not angle) at which to begin the range.
 void setStopValue(double stopValue)
          Sets the scale value (not angle) at which to stop the range.
 
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, getPreferredSize, 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, paintComponent, 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

scale

protected JCScale scale
The scale associated with this range.

innerExtent

protected double innerExtent
The place to start drawing this range from the center. Values are ratios based on the scale's radius. For example, 0.8 means start drawing this range 80% of the radius' size away from the center.

outerExtent

protected double outerExtent
The place to stop drawing this range. For example, 0.9 means stop drawing this range 90% of the radius' size away from the center.

startValue

protected double startValue
The scale value (not angle) at which to begin the range.

stopValue

protected double stopValue
The scale value (not angle) at which to stop the range.

rangeName

protected String rangeName
The name of the range which will appear in the legend.

rangeCounter

protected static int rangeCounter
Static counter for generated range names.
Constructor Detail

JCRange

public JCRange(Color foreground,
               JCCircularScale scale,
               double innerExtent,
               double outerExtent,
               double startValue,
               double stopValue)
Creates a range with the properties specified in the parameters.
Parameters:
foreground - The color of this range
scale - The scale associated with this range
innerExtent - The place to start drawing this range from the center. Values are ratios based on the scale's radius. For example, 0.8 means start drawing this range 80% of the radius' size away from the center.
outerExtent - The place to stop drawing this range. For example, 0.9 means stop drawing this range 90% of the radius' size away 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

getInnerExtent

public double getInnerExtent()
Specifies where the inner boundary of the range is. The value is a ratio based on the radius of the circular scale. For example, a value of 0.8 means that the inner boundary of this range is at 80% of the radius' size from the center.
Returns:
the innerExtent

setInnerExtent

public void setInnerExtent(double innerExtent)
Sets where the inner boundary of the range is. The value is a ratio based on the radius of the circular scale. For example, a value of 0.8 means that the inner boundary of this range is at 80% of the radius' size from the center.
Parameters:
innerExtent - The inner extent of the range

getOuterExtent

public double getOuterExtent()
Returns where the outer boundary of the range is. The value is a ratio based on the radius of the circular scale. For example, 0.9 means stop drawing this range at a distance that is 90% of the radius's size from the center.
Returns:
the outerExtent

setOuterExtent

public void setOuterExtent(double outerExtent)
Sets where the outer boundary of the range is. The value is a ratio based on the radius of the circular scale. For example, 0.9 means stop drawing this range at a distance that is 90% of the radius's size from the center.
Parameters:
outerExtent - The outer extent of the range

getScale

public JCScale getScale()
Returns the scale associated with this range.
Returns:
The scale associated with this range

setScale

public void setScale(JCScale scale)
Sets the scale associated with this range.
Parameters:
scale - The scale associated with this range

getStartValue

public double getStartValue()
Returns the scale value (not angle) at which to begin the range.
Returns:
the startValue

setStartValue

public void setStartValue(double startValue)
Sets the scale value (not angle) at which to begin the range.
Parameters:
startValue - The start value for the range

getStopValue

public double getStopValue()
Returns the scale value (not angle) at which to stop the range.
Returns:
the stopValue

setStopValue

public void setStopValue(double stopValue)
Sets the scale value (not angle) at which to stop the range.
Parameters:
stopValue - The stop value for the range

getRangeName

public String getRangeName()
Gets the name of this range. This is the name which will appear in the legend. If no name is supplied, a name of the form "Range " will be automatically generated.

setRangeName

public void setRangeName(String rangeName)
Sets the rangeName. This is the name which will appear in the legend.
Parameters:
rangeName - The name to appear in the legend

redraw

public void redraw()
Does nothing, overridden in JCCircularRange.

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