org.jscience.awt.meters
Class Meter

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
All Implemented Interfaces:
java.awt.event.AdjustmentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
AnalogMeter, LEDMeter, RoundLEDMeter

public abstract class Meter
extends java.awt.Panel
implements java.awt.event.AdjustmentListener

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
protected  java.lang.String caption
          DOCUMENT ME!
static java.lang.String DEFAULTFONTNAME
          DOCUMENT ME!
static int DEFAULTFONTSIZE
          DOCUMENT ME!
static int DEFAULTFONTSTYLE
          DOCUMENT ME!
protected  java.awt.Font font
          DOCUMENT ME!
protected  java.lang.String fontName
          DOCUMENT ME!
protected  int fontSize
          DOCUMENT ME!
protected  int fontStyle
          DOCUMENT ME!
protected  boolean hasHighlight
          DOCUMENT ME!
protected  boolean hasLabels
          DOCUMENT ME!
protected  int height
          DOCUMENT ME!
protected  java.awt.Color highlightBrighterColor
          DOCUMENT ME!
protected  java.awt.Color highlightDarkerColor
          DOCUMENT ME!
protected  int labelDist
          DOCUMENT ME!
protected  int labelPercent
          DOCUMENT ME!
protected  java.util.Vector labels
          DOCUMENT ME!
protected  double meterGranularity
          DOCUMENT ME!
protected  java.awt.Image meterImage
          DOCUMENT ME!
protected  int meterMode
          DOCUMENT ME!
static int METERRANGE
          DOCUMENT ME!
static int MODEAVG
          DOCUMENT ME!
static int MODENONE
          DOCUMENT ME!
static int MODEPEAK
          DOCUMENT ME!
static int MODEPEAKHOLD
          DOCUMENT ME!
static int MODERMS
          DOCUMENT ME!
static int MODEVU
          DOCUMENT ME!
protected  java.awt.Color needleColor
          DOCUMENT ME!
static java.awt.Color NEEDLECOLOR
          DOCUMENT ME!
protected  int numberOfSections
          DOCUMENT ME!
protected  java.awt.Color panelColor
          DOCUMENT ME!
static java.awt.Color PANELCOLOR
          DOCUMENT ME!
protected  java.awt.Color textColor
          DOCUMENT ME!
static java.awt.Color TEXTCOLOR
          DOCUMENT ME!
protected  int value
          DOCUMENT ME!
protected  int width
          DOCUMENT ME!
 
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
Meter(int width, int height, int meterMode, java.lang.String fontName, int fontStyle, int fontSize, java.lang.String caption, boolean hasLabels, java.lang.String labelsString, int value, boolean hasHighlight, int numberOfSections, java.awt.Color panelColor, java.awt.Color needleColor, java.awt.Color textColor)
          Creates a new Meter object.
 
Method Summary
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          DOCUMENT ME!
 java.lang.String getCaption()
          DOCUMENT ME!
 java.awt.Font getFont()
          DOCUMENT ME!
 java.lang.String getFontName()
          DOCUMENT ME!
 int getFontSize()
          DOCUMENT ME!
 int getFontStyle()
          DOCUMENT ME!
 boolean getHasLabels()
          DOCUMENT ME!
 int getHeight()
          DOCUMENT ME!
 boolean getHighlight()
          DOCUMENT ME!
 int getLabelPercent()
          DOCUMENT ME!
 java.lang.String getLabelsString()
          DOCUMENT ME!
 int getMeterMode()
          DOCUMENT ME!
 java.awt.Color getNeedleColor()
          DOCUMENT ME!
 int getNumberOfSections()
          DOCUMENT ME!
 java.awt.Color getPanelColor()
          Gets the panel color
 java.awt.Color getTextColor()
          DOCUMENT ME!
 int getValue()
          DOCUMENT ME!
 int getWidth()
          DOCUMENT ME!
protected  int round(double d)
          DOCUMENT ME!
 void setCaption(java.lang.String caption)
          DOCUMENT ME!
 void setFont(java.awt.Font font)
          DOCUMENT ME!
 void setFontName(java.lang.String fontName)
          DOCUMENT ME!
 void setFontSize(int fontSize)
          DOCUMENT ME!
 void setFontStyle(int fontStyle)
          DOCUMENT ME!
 void setHasLabels(boolean hasLabels)
          DOCUMENT ME!
 void setHeight(int height)
          DOCUMENT ME!
 void setHighlight(boolean hasHighlight)
          DOCUMENT ME!
 void setLabelPercent(int percent)
          DOCUMENT ME!
 void setLabelsString(java.lang.String s)
          DOCUMENT ME!
 void setMeterMode(int meterMode)
          DOCUMENT ME!
 void setNeedleColor(java.awt.Color needleColor)
          DOCUMENT ME!
 void setNumberOfSections(int numberOfSections)
          DOCUMENT ME!
 void setPanelColor(java.awt.Color panelColor)
          Sets the panel color
 void setTextColor(java.awt.Color textColor)
          DOCUMENT ME!
 void setValue(int newValue)
          DOCUMENT ME!
 void setWidth(int width)
          DOCUMENT ME!
protected  void sizeToFit()
          DOCUMENT ME!
 
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, paint, 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
 

Field Detail

METERRANGE

public static final int METERRANGE
DOCUMENT ME!

See Also:
Constant Field Values

PANELCOLOR

public static final java.awt.Color PANELCOLOR
DOCUMENT ME!


NEEDLECOLOR

public static final java.awt.Color NEEDLECOLOR
DOCUMENT ME!


TEXTCOLOR

public static final java.awt.Color TEXTCOLOR
DOCUMENT ME!


DEFAULTFONTNAME

public static final java.lang.String DEFAULTFONTNAME
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTFONTSTYLE

public static final int DEFAULTFONTSTYLE
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTFONTSIZE

public static final int DEFAULTFONTSIZE
DOCUMENT ME!

See Also:
Constant Field Values

MODENONE

public static final int MODENONE
DOCUMENT ME!

See Also:
Constant Field Values

MODEPEAK

public static final int MODEPEAK
DOCUMENT ME!

See Also:
Constant Field Values

MODEPEAKHOLD

public static final int MODEPEAKHOLD
DOCUMENT ME!

See Also:
Constant Field Values

MODEAVG

public static final int MODEAVG
DOCUMENT ME!

See Also:
Constant Field Values

MODERMS

public static final int MODERMS
DOCUMENT ME!

See Also:
Constant Field Values

MODEVU

public static final int MODEVU
DOCUMENT ME!

See Also:
Constant Field Values

meterImage

protected java.awt.Image meterImage
DOCUMENT ME!


width

protected int width
DOCUMENT ME!


height

protected int height
DOCUMENT ME!


meterMode

protected int meterMode
DOCUMENT ME!


meterGranularity

protected double meterGranularity
DOCUMENT ME!


value

protected int value
DOCUMENT ME!


hasHighlight

protected boolean hasHighlight
DOCUMENT ME!


hasLabels

protected boolean hasLabels
DOCUMENT ME!


labelDist

protected int labelDist
DOCUMENT ME!


labelPercent

protected int labelPercent
DOCUMENT ME!


labels

protected java.util.Vector labels
DOCUMENT ME!


numberOfSections

protected int numberOfSections
DOCUMENT ME!


font

protected java.awt.Font font
DOCUMENT ME!


fontName

protected java.lang.String fontName
DOCUMENT ME!


fontStyle

protected int fontStyle
DOCUMENT ME!


fontSize

protected int fontSize
DOCUMENT ME!


caption

protected java.lang.String caption
DOCUMENT ME!


panelColor

protected java.awt.Color panelColor
DOCUMENT ME!


highlightBrighterColor

protected java.awt.Color highlightBrighterColor
DOCUMENT ME!


highlightDarkerColor

protected java.awt.Color highlightDarkerColor
DOCUMENT ME!


needleColor

protected java.awt.Color needleColor
DOCUMENT ME!


textColor

protected java.awt.Color textColor
DOCUMENT ME!

Constructor Detail

Meter

public Meter(int width,
             int height,
             int meterMode,
             java.lang.String fontName,
             int fontStyle,
             int fontSize,
             java.lang.String caption,
             boolean hasLabels,
             java.lang.String labelsString,
             int value,
             boolean hasHighlight,
             int numberOfSections,
             java.awt.Color panelColor,
             java.awt.Color needleColor,
             java.awt.Color textColor)
Creates a new Meter object.

Parameters:
width - DOCUMENT ME!
height - DOCUMENT ME!
meterMode - DOCUMENT ME!
fontName - DOCUMENT ME!
fontStyle - DOCUMENT ME!
fontSize - DOCUMENT ME!
caption - DOCUMENT ME!
hasLabels - DOCUMENT ME!
labelsString - DOCUMENT ME!
value - DOCUMENT ME!
hasHighlight - DOCUMENT ME!
numberOfSections - DOCUMENT ME!
panelColor - DOCUMENT ME!
needleColor - DOCUMENT ME!
textColor - DOCUMENT ME!
Method Detail

sizeToFit

protected void sizeToFit()
DOCUMENT ME!


adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
DOCUMENT ME!

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
e - DOCUMENT ME!

round

protected int round(double d)
DOCUMENT ME!

Parameters:
d - DOCUMENT ME!
Returns:
DOCUMENT ME!

getWidth

public int getWidth()
DOCUMENT ME!

Overrides:
getWidth in class java.awt.Component
Returns:
DOCUMENT ME!

setWidth

public void setWidth(int width)
DOCUMENT ME!

Parameters:
width - DOCUMENT ME!

getHeight

public int getHeight()
DOCUMENT ME!

Overrides:
getHeight in class java.awt.Component
Returns:
DOCUMENT ME!

setHeight

public void setHeight(int height)
DOCUMENT ME!

Parameters:
height - DOCUMENT ME!

getMeterMode

public int getMeterMode()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setMeterMode

public void setMeterMode(int meterMode)
DOCUMENT ME!

Parameters:
meterMode - DOCUMENT ME!

getFont

public java.awt.Font getFont()
DOCUMENT ME!

Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component
Returns:
DOCUMENT ME!

setFont

public void setFont(java.awt.Font font)
DOCUMENT ME!

Overrides:
setFont in class java.awt.Container
Parameters:
font - DOCUMENT ME!

getFontName

public java.lang.String getFontName()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontName

public void setFontName(java.lang.String fontName)
DOCUMENT ME!

Parameters:
fontName - DOCUMENT ME!

getFontStyle

public int getFontStyle()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontStyle

public void setFontStyle(int fontStyle)
DOCUMENT ME!

Parameters:
fontStyle - DOCUMENT ME!

getFontSize

public int getFontSize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontSize

public void setFontSize(int fontSize)
DOCUMENT ME!

Parameters:
fontSize - DOCUMENT ME!

getCaption

public java.lang.String getCaption()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setCaption

public void setCaption(java.lang.String caption)
DOCUMENT ME!

Parameters:
caption - DOCUMENT ME!

getHasLabels

public boolean getHasLabels()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setHasLabels

public void setHasLabels(boolean hasLabels)
DOCUMENT ME!

Parameters:
hasLabels - DOCUMENT ME!

getLabelPercent

public int getLabelPercent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLabelPercent

public void setLabelPercent(int percent)
DOCUMENT ME!

Parameters:
percent - DOCUMENT ME!

getLabelsString

public java.lang.String getLabelsString()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLabelsString

public void setLabelsString(java.lang.String s)
DOCUMENT ME!

Parameters:
s - DOCUMENT ME!

getValue

public int getValue()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setValue

public void setValue(int newValue)
DOCUMENT ME!

Parameters:
newValue - DOCUMENT ME!

getHighlight

public boolean getHighlight()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setHighlight

public void setHighlight(boolean hasHighlight)
DOCUMENT ME!

Parameters:
hasHighlight - DOCUMENT ME!

getNumberOfSections

public int getNumberOfSections()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setNumberOfSections

public void setNumberOfSections(int numberOfSections)
DOCUMENT ME!

Parameters:
numberOfSections - DOCUMENT ME!

getPanelColor

public java.awt.Color getPanelColor()
Gets the panel color

Returns:
Color - The panel's color

setPanelColor

public void setPanelColor(java.awt.Color panelColor)
Sets the panel color

Parameters:
panelColor - Meter panel color

getNeedleColor

public java.awt.Color getNeedleColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setNeedleColor

public void setNeedleColor(java.awt.Color needleColor)
DOCUMENT ME!

Parameters:
needleColor - DOCUMENT ME!

getTextColor

public java.awt.Color getTextColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setTextColor

public void setTextColor(java.awt.Color textColor)
DOCUMENT ME!

Parameters:
textColor - DOCUMENT ME!