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
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 |
innerArcStartCompensator
protected int innerArcStartCompensator
innerArcStopCompensator
protected int innerArcStopCompensator
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 rangeinnerExtent
- 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 rangestopValue
- The scale value (not angle) at which to stop the range
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