com.elj.gauges.level
Class LevelGauge

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--com.elj.gauges.level.LevelGauge
All Implemented Interfaces:
javax.accessibility.Accessible, java.io.Externalizable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class LevelGauge
extends java.awt.Panel
implements java.io.Externalizable

This bean component allows the user to pipe the data through retrieval tools and check the level of the of data between the minimum and maximum.

This bean provides powerful designing aspects by providing following user friendly properties
Name the name of the gauge
Caption the caption of the gauge
Maximum the maximum value of the level
Minimum the minimum value of the level
CaptionFont represents the font which is used to display the caption
NumberFont represents the font which is used to display the number
BorderColor the border color
ZoneColor represents the color of the zone cell below the warning area
WarningZoneColor represents the warning area cell color
AlarmZoneColor represents the alarm area cell color which resides above the warning level
Value the current value
Warning represents bottom level of the warning area
Alarm represents the bottom level of the alarm area

See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
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
LevelGauge()
          Creates a LevelGauge.
 
Method Summary
 int getAlarm()
          Gets the alarm value specified in the level guage
 java.awt.Color getAlarmZoneColor()
          Gets the alarm zone color of the level guage
 java.awt.Color getBorderColor()
          Gets the border color of the level guage
 java.lang.String getCaption()
          Gets the caption of the levelguage
 java.awt.Font getCaptionFont()
          Gets the font style of the caption text
 java.util.Locale getLocale()
          Returns the value of locale.
 int getMaximum()
          Gets the maximum value of the scale in a level guage
 int getMinimum()
          Gets the minimum value of the scale in a level guage
 java.lang.String getName()
          Gets the name or the handle of the object
 java.awt.Font getNumbersFont()
          Gets the font style of the numbers text
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this bean.
 int getValue()
          Gets the current value of the gauge
 int getWarning()
          Gets the warning value specified in the level guage
 java.awt.Color getWarningZoneColor()
          Gets the warning zone color of the level guage
 java.awt.Color getZoneColor()
          Gets the zone color of the level guage
 void paint(java.awt.Graphics g)
          Paints this bean.
 void readExternal(java.io.ObjectInput in)
           
 void setAlarm(int level)
          Sets the alarm level value of the gauge
 void setAlarmZoneColor(java.awt.Color color)
          Sets the alarm zone color of the values represented in a level guage
 void setBackground(java.awt.Color c)
          Sets the Background color.
 void setBorderColor(java.awt.Color color)
          Sets the border color of the level guage
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this bean.
 void setCaption(java.lang.String theCaption)
          Sets the caption text of this bean
 void setCaptionFont(java.awt.Font f)
          Sets the caption font of this bean
 void setCursor(java.awt.Cursor c)
          Sets value of the cursor.
 void setEnabled(boolean b)
          sets Enablity.
 void setFont(java.awt.Font f)
          Sets the font.
 void setForeground(java.awt.Color c)
          Sets the Foreground color.
 void setLocale(java.util.Locale l)
          Sets value of the locale.
 void setMaximum(int theMaximum)
          Sets the maximum level value of the gauge
 void setMinimum(int theMinimum)
          Sets the minimum level value of the gauge
 void setName(java.lang.String theName)
          Sets the name of this bean
 void setNumbersFont(java.awt.Font f)
          Sets the numbers font of this bean
 void setValue(int theValue)
          Sets the value to be represented in the level guage
 void setVisible(boolean b)
          sets Visiblity.
 void setWarning(int level)
          Sets the warning level value of the gauge
 void setWarningZoneColor(java.awt.Color color)
          Sets the warning zone color of the values represented in a level guage
 void setZoneColor(java.awt.Color color)
          Sets the zone color of the values represented in a level guage
 java.lang.String toString()
          Returns string representation of this bean
 void writeExternal(java.io.ObjectOutput out)
          Externalizable interface implementation to save and retrieve the state of this bean
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setComponentOrientation, setDropTarget, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LevelGauge

public LevelGauge()
Creates a LevelGauge.
Method Detail

setMinimum

public void setMinimum(int theMinimum)
Sets the minimum level value of the gauge
Parameters:
theMinimum - lowest level of the gauge

setMaximum

public void setMaximum(int theMaximum)
Sets the maximum level value of the gauge
Parameters:
theMaximum - highest level of the gauge

setWarning

public void setWarning(int level)
Sets the warning level value of the gauge
Parameters:
level - warning zone starts from this level value

setAlarm

public void setAlarm(int level)
Sets the alarm level value of the gauge
Parameters:
level - alarm zone starts from this level value

setName

public void setName(java.lang.String theName)
Sets the name of this bean
Overrides:
setName in class java.awt.Component
Parameters:
theName - specifies the name of this bean

setCaption

public void setCaption(java.lang.String theCaption)
Sets the caption text of this bean
Parameters:
theCaption - the caption text on this bean

setCaptionFont

public void setCaptionFont(java.awt.Font f)
Sets the caption font of this bean
Parameters:
theCaption - the caption font of this bean

getCaptionFont

public java.awt.Font getCaptionFont()
Gets the font style of the caption text
Returns:
the caption font style from graphics context

setNumbersFont

public void setNumbersFont(java.awt.Font f)
Sets the numbers font of this bean
Parameters:
f - the numbers font of this bean

getNumbersFont

public java.awt.Font getNumbersFont()
Gets the font style of the numbers text
Returns:
the numbers font style from graphics context

setValue

public void setValue(int theValue)
Sets the value to be represented in the level guage
Parameters:
theValue - the value to be represented

setBorderColor

public void setBorderColor(java.awt.Color color)
Sets the border color of the level guage
Parameters:
color - a backgrond color graphics object

setZoneColor

public void setZoneColor(java.awt.Color color)
Sets the zone color of the values represented in a level guage
Parameters:
color - a zone color graphics object

setWarningZoneColor

public void setWarningZoneColor(java.awt.Color color)
Sets the warning zone color of the values represented in a level guage
Parameters:
color - a warning zone color graphics object

setAlarmZoneColor

public void setAlarmZoneColor(java.awt.Color color)
Sets the alarm zone color of the values represented in a level guage
Parameters:
color - a alarm zone color graphics object

getMinimum

public int getMinimum()
Gets the minimum value of the scale in a level guage

getMaximum

public int getMaximum()
Gets the maximum value of the scale in a level guage

getName

public java.lang.String getName()
Gets the name or the handle of the object
Overrides:
getName in class java.awt.Component

getCaption

public java.lang.String getCaption()
Gets the caption of the levelguage

getValue

public int getValue()
Gets the current value of the gauge

getWarning

public int getWarning()
Gets the warning value specified in the level guage

getAlarm

public int getAlarm()
Gets the alarm value specified in the level guage

getBorderColor

public java.awt.Color getBorderColor()
Gets the border color of the level guage

getZoneColor

public java.awt.Color getZoneColor()
Gets the zone color of the level guage

getWarningZoneColor

public java.awt.Color getWarningZoneColor()
Gets the warning zone color of the level guage

getAlarmZoneColor

public java.awt.Color getAlarmZoneColor()
Gets the alarm zone color of the level guage

paint

public void paint(java.awt.Graphics g)
Paints this bean.

This method is called when the contents of the bean should be painted in response to the bean first being shown or damage needing repair. The clip rectangle in the Graphics parameter will be set to the area which needs to be painted. For performance reasons, Beans with zero width or height aren't considered to need painting when they are first shown, and also aren't considered to need repair.

Overrides:
paint in class java.awt.Container
Parameters:
g - the graphics context to use for painting.

toString

public java.lang.String toString()
Returns string representation of this bean
Overrides:
toString in class java.awt.Component
Returns:
string representaion of this bean

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Moves and resizes this bean. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.
Overrides:
setBounds in class java.awt.Component
Parameters:
x - x-coordinate of this bean.
y - y-coordinate of this bean.
width - the new width of this bean.
height - the new height of this bean.

setForeground

public void setForeground(java.awt.Color c)
Sets the Foreground color.
Overrides:
setForeground in class java.awt.Component
Parameters:
newColor - New text color.

setBackground

public void setBackground(java.awt.Color c)
Sets the Background color.
Overrides:
setBackground in class java.awt.Component
Parameters:
newColor - New background color.

setFont

public void setFont(java.awt.Font f)
Sets the font.
Overrides:
setFont in class java.awt.Container
Parameters:
font - The value of font to be set.

setVisible

public void setVisible(boolean b)
sets Visiblity.
Overrides:
setVisible in class java.awt.Component
Parameters:
b - flag representing visibility of bean.

setEnabled

public void setEnabled(boolean b)
sets Enablity.
Overrides:
setEnabled in class java.awt.Component
Parameters:
b - flag representing enability of bean.

setLocale

public void setLocale(java.util.Locale l)
Sets value of the locale.
Overrides:
setLocale in class java.awt.Component
Parameters:
l - current value of the locale.

getLocale

public java.util.Locale getLocale()
Returns the value of locale.
Overrides:
getLocale in class java.awt.Component
Returns:
the current value of locale

setCursor

public void setCursor(java.awt.Cursor c)
Sets value of the cursor.
Overrides:
setCursor in class java.awt.Component
Parameters:
c - current value of the cursor.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this bean.
Overrides:
getPreferredSize in class java.awt.Container
Returns:
a dimension object indicating this bean's preferred size.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalizable interface implementation to save and retrieve the state of this bean
Specified by:
writeExternal in interface java.io.Externalizable

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable