|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--org.concord.util.Gauge
Value gauge.
Graphic component that shows a simple scalar value as a vertical bar.
This component can also represent multiple scalar values additively with stacked vertical rectangles.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.awt.Color[] |
barColors
|
protected java.awt.Rectangle[] |
bars
|
static double |
DEFAULT_MAX_VALUE
|
static double |
DEFAULT_MIN_VALUE
|
static double |
DEFAULT_VALUE
|
protected java.awt.event.MouseMotionAdapter |
dragGauge
|
protected boolean |
drawBoundary
|
protected boolean |
editable
|
protected int |
gaugeHeight
|
protected int[] |
gaugeValues
|
protected int |
gaugeWidth
|
protected int |
majorTickLength
|
protected int |
majorTicks
|
protected int |
majorTickValue
|
protected double |
max
|
protected java.lang.String |
maxString
|
protected double |
min
|
protected int |
minorTickLength
|
protected int |
minorTicks
|
protected int |
minorTickValue
|
protected java.lang.String |
minString
|
protected int |
numberOfBars
|
protected java.util.Vector |
oldBars
|
protected double |
range
|
protected java.awt.event.MouseAdapter |
setGauge
|
protected java.awt.event.ComponentAdapter |
sizeChanged
|
protected int |
tickSpace
|
protected double[] |
values
|
protected java.lang.String[] |
valueStrings
|
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 org.concord.util.ValueGraph |
colors |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Gauge()
Gauge constructor. |
Method Summary | |
protected int |
findBarIndex(int x,
int y)
|
protected double |
getBarValue(int index,
int x,
int y)
|
java.awt.Color |
getColor()
Returns color associated with a particular index. |
java.awt.Color |
getColor(int index)
Returns color associated with a particular index. |
boolean |
getEditable()
Returns editable state. |
double |
getMax()
Get the maximum value of the gauge. |
double |
getMin()
Get the minimum value of the gauge. |
double |
getRange()
Returns the range of values shown by this gauge. |
double |
getValue()
Get value of gauge sub-bar. |
double |
getValue(int index)
Get value of gauge sub-bar at index. |
static void |
main(java.lang.String[] args)
|
void |
paintComponent(java.awt.Graphics g)
|
void |
setColor(java.awt.Color color)
Sets the color. |
void |
setColor(java.awt.Color color,
int index)
Sets the color associated with a particular index. |
void |
setEditable(boolean value)
Make gauges editable. |
protected void |
setGaugeSize(java.awt.Dimension size)
|
void |
setMajorTickMarks(int ticks)
|
void |
setMax(double value)
Set the maximum value of the gauge. |
void |
setMin(double value)
Set the minimum value of the gauge. |
void |
setMinorTickMarks(int ticks)
|
void |
setNumberOfBars(int number)
|
void |
setScaleMax(int scale)
|
protected void |
setValueFromMouseEvent(java.awt.event.MouseEvent event)
|
void |
updateValue(double value)
|
void |
updateValue(double value,
int index)
Updates gauge sub-bar at index with new value. |
void |
updateValue(float value)
|
void |
updateValue(float value,
int index)
|
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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, 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, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, 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 |
public static final double DEFAULT_MIN_VALUE
public static final double DEFAULT_MAX_VALUE
public static final double DEFAULT_VALUE
protected double min
protected double max
protected double[] values
protected double range
protected int gaugeWidth
protected int gaugeHeight
protected int majorTicks
protected int minorTicks
protected int tickSpace
protected int majorTickLength
protected int minorTickLength
protected int majorTickValue
protected int minorTickValue
protected java.lang.String[] valueStrings
protected java.lang.String minString
protected java.lang.String maxString
protected boolean editable
protected boolean drawBoundary
protected java.util.Vector oldBars
protected java.awt.Rectangle[] bars
protected java.awt.Color[] barColors
protected int numberOfBars
protected int[] gaugeValues
protected java.awt.event.ComponentAdapter sizeChanged
protected java.awt.event.MouseMotionAdapter dragGauge
protected java.awt.event.MouseAdapter setGauge
Constructor Detail |
public Gauge()
Method Detail |
protected int findBarIndex(int x, int y)
protected double getBarValue(int index, int x, int y)
protected void setValueFromMouseEvent(java.awt.event.MouseEvent event)
protected void setGaugeSize(java.awt.Dimension size)
public void setNumberOfBars(int number)
public boolean getEditable()
public void setEditable(boolean value)
public double getRange()
public void setMin(double value)
value
- - double minumum value.public double getMin()
public void setMax(double value)
value
- - double maxumum value.public double getMax()
public void setScaleMax(int scale)
public void updateValue(double value, int index)
updateValue
in interface ValueGraph
x
- double value to update.index
- int index of sub-bar.public void updateValue(double value)
updateValue
in interface ValueGraph
public void updateValue(float value, int index)
updateValue
in interface ValueGraph
public void updateValue(float value)
updateValue
in interface ValueGraph
public double getValue(int index)
index
- int index of sub-bar.public double getValue()
public java.awt.Color getColor(int index)
getColor
in interface ValueGraph
index
- int index of sub-bar.public void setColor(java.awt.Color color, int index)
setColor
in interface ValueGraph
color
- Color of sub-bar.index
- int index of sub-bar.public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- Color of gauge.public void setMajorTickMarks(int ticks)
public void setMinorTickMarks(int ticks)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |