org.jscience.awt.meters
Class RoundLEDMeter

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by org.jscience.awt.meters.Meter
                  extended by org.jscience.awt.meters.RoundLEDMeter
All Implemented Interfaces:
java.awt.event.AdjustmentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class RoundLEDMeter
extends Meter

DOCUMENT ME!

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class org.jscience.awt.meters.Meter
caption, DEFAULTFONTNAME, DEFAULTFONTSIZE, DEFAULTFONTSTYLE, font, fontName, fontSize, fontStyle, hasHighlight, hasLabels, height, highlightBrighterColor, highlightDarkerColor, labelDist, labelPercent, labels, meterGranularity, meterImage, meterMode, METERRANGE, MODEAVG, MODENONE, MODEPEAK, MODEPEAKHOLD, MODERMS, MODEVU, needleColor, NEEDLECOLOR, numberOfSections, panelColor, PANELCOLOR, textColor, TEXTCOLOR, value, width
 
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
RoundLEDMeter()
          Creates a new RoundLEDMeter object.
RoundLEDMeter(int radius, boolean isVertical, int numberOfSections, java.lang.String labelsString, boolean labelsOnTopLeft, java.lang.String caption, boolean topLeftCaption, int value, Blinker blinker)
          Creates a new RoundLEDMeter object.
RoundLEDMeter(int radius, boolean isVertical, int meterMode, java.lang.String fontName, int fontStyle, int fontSize, java.lang.String caption, boolean topLeftCaption, boolean hasLabels, java.lang.String labelsString, boolean labelsOnTopLeft, int value, int numberOfSections, java.awt.Color panelColor, java.awt.Color textColor, Blinker blinker)
          RoundLEDMeter class constructor with all agruments
RoundLEDMeter(int radius, boolean isVertical, java.lang.String caption, int value, Blinker blinker)
          Creates a new RoundLEDMeter object.
 
Method Summary
static void main(java.lang.String[] args)
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          Paint the component and the meter's value
 void setColorRange(java.awt.Color color, int minPercentValue, int maxPercentValue)
          Set the meter's color over a range of percent values
 void setLabelsString(java.lang.String labelString)
          Overloaded method to prevent the meter label string from being changed at runtime.
 void setNumberOfSections(int numberOfSections)
          Overloaded method to prevent the number of meter sections from being changed at runtime.
 
Methods inherited from class org.jscience.awt.meters.Meter
adjustmentValueChanged, getCaption, getFont, getFontName, getFontSize, getFontStyle, getHasLabels, getHeight, getHighlight, getLabelPercent, getLabelsString, getMeterMode, getNeedleColor, getNumberOfSections, getPanelColor, getTextColor, getValue, getWidth, round, setCaption, setFont, setFontName, setFontSize, setFontStyle, setHasLabels, setHeight, setHighlight, setLabelPercent, setMeterMode, setNeedleColor, setPanelColor, setTextColor, setValue, setWidth, sizeToFit
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoundLEDMeter

public RoundLEDMeter(int radius,
                     boolean isVertical,
                     int meterMode,
                     java.lang.String fontName,
                     int fontStyle,
                     int fontSize,
                     java.lang.String caption,
                     boolean topLeftCaption,
                     boolean hasLabels,
                     java.lang.String labelsString,
                     boolean labelsOnTopLeft,
                     int value,
                     int numberOfSections,
                     java.awt.Color panelColor,
                     java.awt.Color textColor,
                     Blinker blinker)
RoundLEDMeter class constructor with all agruments

Parameters:
radius - radius is the radius of the LEDs that will be used in the meter.
isVertical - isVertical true if meter is vertical false if meter should be horizontal.
meterMode - meterMode is not currently used
fontName - fontName is the name of the font for labelling
fontStyle - fontStyle is the name of the font style for labelling
fontSize - fontSize is the size of the font for labelling
caption - caption is the caption to label the meter with
topLeftCaption - topLeftCaption if true causes the caption to be placed at the top of vertical meters and at the left of horizontal meters. False causes the caption to be place at the bottom or the right of the meter.
hasLabels - hasLabels is true if the meter has labels and it is desired they are displayed.
labelsString - labelsString is the string of comma separated label strings used to label the meter. There should be one entry for each section of the meter.
labelsOnTopLeft - labelsOnTopLeft is true if the labels should be on the left of the vertical meter LEDs or on top of a horizontal meter LEDs. If false the labels will be on the right or on the bottom of the LEDs.
value - value is the value the meter should initially display
numberOfSections - numberOfSections is the number of meter sections. NOTE: this value can only be set in the constructor. It cannot be changed at runtime.
panelColor - panelColor is the color of the panel surrounding the meter.
textColor - textColor is the color used for the labelling text
blinker - blinker is the blinker used to drive the LED state machine. A blinker is passed in so applications using this meter can have synchronized LEDs.

RoundLEDMeter

public RoundLEDMeter(int radius,
                     boolean isVertical,
                     int numberOfSections,
                     java.lang.String labelsString,
                     boolean labelsOnTopLeft,
                     java.lang.String caption,
                     boolean topLeftCaption,
                     int value,
                     Blinker blinker)
Creates a new RoundLEDMeter object.

Parameters:
radius - DOCUMENT ME!
isVertical - DOCUMENT ME!
numberOfSections - DOCUMENT ME!
labelsString - DOCUMENT ME!
labelsOnTopLeft - DOCUMENT ME!
caption - DOCUMENT ME!
topLeftCaption - DOCUMENT ME!
value - DOCUMENT ME!
blinker - DOCUMENT ME!

RoundLEDMeter

public RoundLEDMeter(int radius,
                     boolean isVertical,
                     java.lang.String caption,
                     int value,
                     Blinker blinker)
Creates a new RoundLEDMeter object.

Parameters:
radius - DOCUMENT ME!
isVertical - DOCUMENT ME!
caption - DOCUMENT ME!
value - DOCUMENT ME!
blinker - DOCUMENT ME!

RoundLEDMeter

public RoundLEDMeter()
Creates a new RoundLEDMeter object.

Method Detail

paint

public void paint(java.awt.Graphics g)
Paint the component and the meter's value

Overrides:
paint in class java.awt.Container
Parameters:
g - g is the graphics context the painting will occur on

setColorRange

public void setColorRange(java.awt.Color color,
                          int minPercentValue,
                          int maxPercentValue)
Set the meter's color over a range of percent values

Parameters:
color - color is the color to set the specified range of meter values to.
minPercentValue - minPercentValue specifies the start of the color range
maxPercentValue - maxPercentValue specifies the end of the color range

setNumberOfSections

public void setNumberOfSections(int numberOfSections)
Overloaded method to prevent the number of meter sections from being changed at runtime. In essience, this method can be called once during initialization (by the base class) but never again.

Overrides:
setNumberOfSections in class Meter
Parameters:
numberOfSections - numberOfSections the initial number of sections value

setLabelsString

public void setLabelsString(java.lang.String labelString)
Overloaded method to prevent the meter label string from being changed at runtime. In essience, this method can be called once during initialization (by the base class) but never again.

Overrides:
setLabelsString in class Meter
Parameters:
labelString - labelString is the string of labels to set

main

public static void main(java.lang.String[] args)
DOCUMENT ME!

Parameters:
args - DOCUMENT ME!