ElegantJ Gauges Java API Specification v1.1

com.elegantj.gauges.level
Class LevelGauge

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bycom.elegantj.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
KeyboardEnabled represents the keyboard enability to increase or decrease the value
IndicatorType the indicator type such as up to down, down to up, left to right or right to left
IndicatorGap the gap between two consecutive indicating parts
TickValuesVisible the tick values visibility
InnerBorder the inner border of the gauge
OuterBorder the outer border of the gauge
BorderGap the gap between inner border and outer border
ActiveIndicatorOn the mouse activity to move the indicator such as move on mouse click or mouse drag
TickZoneGap the gap between indicator and ticks
ValuesZoneGap the gap between indicator and tick values
Caption the caption text to be displayed
CaptionFont the caption text font style
CaptionColor the caption text color
CaptionLocation the caption text location
MajorTickSpacing the gap between two consecutive major ticks
MajorTickColor the major tick color
MajorTickLength the major tick length
MajorTickWidth the major tick width
MinorTickSpacing the gap between two consecutive minor ticks
MinorTickColor the minor tick color
MinorTickLength the minor tick length
MinorTickWidth the minor tick width
HeaderVisible the header visibility
HeaderText the text to be displayed on header
HeaderFont the header text font style
HeaderBackground the header background
HeaderForeground the header text color
HeaderSpacing the spacing above and below the header text
FooterVisible the footer visibility
FooterText the text to be displayed on footer
FooterFont the footer text font style
FooterBackground the footer background
FooterForeground the foooter text color
FooterSpacing the spacing above and below the footer text
Minimum the minimum value of the scale
Maximum the maximum value of the scale
Value the indicator value
Warning the lowest value of the warning zone area
Alarm the lowest value of the alarm zone area
ZoneColor the normal zone background color
WarningZoneColor the warning zone background color
AlarmZoneColor the alarm zone background color
ActiveZoneColor the normal zone color of the values, when it is active
ActiveWarningZoneColor the warning zone color of the values, when it is active
ActiveAlarmZoneColorthe alarm zone color of the values, when it is active
DisabledZoneColor the normal zone color of the values, when it is active and disabled
DisabledWarningZoneColor the warning zone color of the values, when it is active and disabled
DisabledAlarmZoneColor the alarm zone color of the values, when it is active and disabled

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BLOCK_DECREMENT
          Specifies the block decrement of a value
static int BLOCK_INCREMENT
          Specifies the block increment of a value
 com.elegantj.editors.C1 c1
           
static int DOWN_UP_INDICATOR
          Indicates values down to up
static int LEFT_RIGHT_INDICATOR
          Indicates values left to right
static int LOWERED
          Lowered border
static int MAXIMUM
          Specifies the maximum value
static int MINIMUM
          Specifies the minimum value
static int MOVE_OFF
          Does not move indicator on any mouse activity
static int MOVE_ON_MOUSE_DRAG
          Moves indicator on mouse click
static int MOVE_ON_MOUSE_PRESS
          Moves indicator on mouse drag
static int NONE
          No border
static int POINT1
          point 1 border width
static int POINT2
          point 2 border width
static int POINT3
          point 3 border width
static int POINT4
          point 4 border width
static int POINT5
          point 5 border width
static int RAISED
          Raised border
static int RIGHT_LEFT_INDICATOR
          Indicates values right to left
static int SIMPLE
          Simple border
static int UNIT_DECREMENT
          Specifies the unit decrement of a value
static int UNIT_INCREMENT
          Specifies the unit increment of a value
static int UP_DOWN_INDICATOR
          Indicates values up to down
 
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
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void adjustValue(int type)
          Adjusts the value with given adjustment constant.
protected  void allocImage()
          Initialize the off-screen level gauge image.
 void draw(java.awt.Graphics g)
          Renders basic level gauge.
 void drawCaption(java.awt.Graphics g)
          Renders caption text.
 void drawFooter(java.awt.Graphics g)
          Renders footer text.
 void drawHeader(java.awt.Graphics g)
          Renders header text.
 void drawMajorTicks(java.awt.Graphics g)
          Renders the major ticks of the gauge.
 void drawMinorTicks(java.awt.Graphics g)
          Renders the minor ticks of the gauge.
 void drawValues(java.awt.Graphics g)
          Renders values of the levels.
 void drawZones(java.awt.Graphics g)
          Renders all the level zones.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Support for reporting bound property This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
 void fireValueChange(int oldValue, int newValue)
          Invokes this method when the value has been changed
 java.awt.Color getActiveAlarmZoneColor()
          Gets the alarm zone color of the level guage, when it is active
 int getActiveIndicatorOn()
          Gets the mouse activity to move the indicator
 java.awt.Color getActiveWarningZoneColor()
          Gets the warning zone color of the level guage, when it is active
 java.awt.Color getActiveZoneColor()
          Gets the normal zone color of the level guage, when it is active
 int getAdjustedBorderGap()
          Gets the gap between inner border and outer border adjusted to the gauge
 java.awt.Point getAdjustedCaptionLocation()
          Gets the caption location adjusted to the gauge
 int getAdjustedIndicatorGap()
          Gets the gap between indicating parts adjusted to the gauge
 int getAdjustedMajorTickLength()
          Gets the major tick length adjusted to the gauge
 int getAdjustedMajorTickWidth()
          Gets the major tick width adjusted to the gauge
 int getAdjustedMinorTickLength()
          Gets the minor tick length adjusted to the gauge
 int getAdjustedMinorTickWidth()
          Gets the minor tick width adjusted to the gauge
 int getAdjustedTickZoneGap()
          Gets the gap between ticks and zone adjusted to the gauge
 int getAdjustedValuesZoneGap()
          Gets the gap between tick values and zone adjusted to the gauge
 int getAlarm()
          Gets the alarm value specified in the level guage
 java.awt.Color getAlarmZoneColor()
          Gets the alarm zone background color
 int getBlockIncrement(int direction)
          Returns the amount to change the value by, given a block (usually "page") up/down request.
 java.awt.Color getBorderColor()
          Gets the outer border color of the level guage
 int getBorderGap()
          Gets the gap between inner border and outer border
 java.lang.String getCaption()
          Gets the caption text
 java.awt.Color getCaptionColor()
          Gets the caption text color
 java.awt.Font getCaptionFont()
          Gets the caption text font
 java.awt.Point getCaptionLocation()
          Gets the caption text location.
 java.awt.Color getDisabledAlarmZoneColor()
          Gets the alarm zone color of the level guage, when it is active and disabled
 java.awt.Color getDisabledWarningZoneColor()
          Gets the warning zone color of the level guage, when it is active and disabled
 java.awt.Color getDisabledZoneColor()
          Gets the normal zone color of the level guage, when it is active and disabled
 java.awt.Color getFooterBackground()
          Gets the footer background color
 java.awt.Font getFooterFont()
          Gets the footer font
 java.awt.Color getFooterForeground()
          Gets the footer foreground color
 int getFooterHeight()
          Returns the footer height, 0 if header is not visible
 int getFooterSpacing()
          Gets the spacing above and below the footer text
 java.lang.String getFooterText()
          Gets the text to be displayed on footer
 java.awt.Color getHeaderBackground()
          Gets the header background color
 java.awt.Font getHeaderFont()
          Gets the header font
 java.awt.Color getHeaderForeground()
          Gets the header foreground color
 int getHeaderHeight()
          Returns the header height, 0 if header is not visible
 int getHeaderSpacing()
          Gets the spacing above and below the header text
 java.lang.String getHeaderText()
          Gets the text to be displayed on header
 java.awt.Rectangle getIndicatorBounds()
          Returns the indcator bounds
 int getIndicatorGap()
          Gets the gap between two consecutive indicating parts
 int getIndicatorType()
          Gets the indicator type
 GaugeBorder getInnerBorder()
          Gets the inner border of the gauge
 java.lang.String getLicenseKey()
          Gets the license key
 java.util.Locale getLocale()
          Returns the value of locale.
 java.awt.Color getMajorTickColor()
          Gets the major tick color
 int getMajorTickLength()
          Gets the major tick length.
 int getMajorTickSpacing()
          Gets the gap between two consecutive major ticks
 int getMajorTickWidth()
          Gets the major tick width.
 int getMaximum()
          Gets the maximum value of the scale
 int getMinimum()
          Gets the minimum value of the scale
 java.awt.Color getMinorTickColor()
          Gets the minor tick color
 int getMinorTickLength()
          Gets the minor tick length.
 int getMinorTickSpacing()
          Gets the gap between two consecutive minor ticks
 int getMinorTickWidth()
          Gets the minor tick width.
 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
 GaugeBorder getOuterBorder()
          Gets the outer border of the gauge
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this bean.
 int getTickZoneGap()
          Gets the gap between ticks and indicator
 int getUnitIncrement(int direction)
          Returns the amount to change the value by, given a unit up/down request.
 int getValue()
          Gets the current value of the gauge
 int getValuesZoneGap()
          Gets the gap between tick values and indicator
 int getWarning()
          Gets the warning value specified in the level guage
 java.awt.Color getWarningZoneColor()
          Gets the warning zone background color
 java.awt.Color getZoneColor()
          Gets the normal zone background color
 boolean isFocusTraversable()
          Returns the value of a flag that indicates whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
 boolean isFooterVisible()
          Gets the footer visibility
 boolean isHeaderVisible()
          Gets the header visibility
 boolean isKeyboardEnabled()
          Gets the enability to increase or decrease the value by keyboard navigation
 boolean isLightweight()
          Returns true if this Component is displayable
 boolean isTickValuesVisible()
          Gets the tick values visibility
 void paint(java.awt.Graphics g)
          Paints this component.
protected  void processKeyEvent(java.awt.event.KeyEvent e)
           
protected  void processMouseEvent(java.awt.event.MouseEvent e)
           
protected  void processMouseMotionEvent(java.awt.event.MouseEvent e)
           
 void readExternal(java.io.ObjectInput in)
           
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void renderCustomFeatures(java.awt.Graphics g)
          Renders any extra gadgets or embellishments to the level gauge.
 void renderImage()
          Renders Image.
 void setActiveAlarmZoneColor(java.awt.Color color)
          Sets the alarm zone color of the values, when it is active
 void setActiveIndicatorOn(int nType)
          Sets the mouse activity to move the indicator
 void setActiveWarningZoneColor(java.awt.Color color)
          Sets the warning zone color of the values, when it is active
 void setActiveZoneColor(java.awt.Color color)
          Sets the normal zone color of the values, when it is active
 void setAlarm(int level)
          Sets the alarm level value of the gauge
 void setAlarmZoneColor(java.awt.Color color)
          Sets the alarm zone background color
 void setBackground(java.awt.Color c)
          Sets the Background color.
 void setBorderColor(java.awt.Color color)
          Deprecated. use SetOuterBorder
 void setBorderGap(int nGap)
          Sets the gap between inner border and outer border, Considers default value, if it is -1
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this bean.
 void setCaption(java.lang.String s)
          Sets the caption text
 void setCaptionColor(java.awt.Color theColor)
          Sets the caption text color
 void setCaptionFont(java.awt.Font theFont)
          Sets the caption text font
 void setCaptionLocation(java.awt.Point thePoint)
          Sets the caption text location.
 void setCursor(java.awt.Cursor c)
          Sets value of the cursor.
 void setDisabledAlarmZoneColor(java.awt.Color color)
          Sets the alarm zone color of the values, when it is active and disabled
 void setDisabledWarningZoneColor(java.awt.Color color)
          Sets the warning zone color of the values, when it is active and disabled
 void setDisabledZoneColor(java.awt.Color color)
          Sets the normal zone color of the values, when it is active and disabled
 void setEnabled(boolean b)
          sets Enablity.
 void setFont(java.awt.Font f)
          Sets the font.
 void setFooterBackground(java.awt.Color theColor)
          Sets the footer background color
 void setFooterFont(java.awt.Font theFont)
          Sets the footer font
 void setFooterForeground(java.awt.Color theColor)
          Sets the footer foreground color
 void setFooterSpacing(int spacing)
          Sets the spacing above and below the footer text
 void setFooterText(java.lang.String s)
          Sets the text to be displayed on footer
 void setFooterVisible(boolean b)
          Sets the footer visibility
 void setForeground(java.awt.Color c)
          Sets the Foreground color.
 void setHeaderBackground(java.awt.Color theColor)
          Sets the header background color
 void setHeaderFont(java.awt.Font theFont)
          Sets the header font
 void setHeaderForeground(java.awt.Color theColor)
          Sets the header foreground color
 void setHeaderSpacing(int spacing)
          Sets the spacing above and below the header text
 void setHeaderText(java.lang.String s)
          Sets the text to be displayed on header
 void setHeaderVisible(boolean b)
          Sets the header visibility
 void setIndicatorGap(int nGap)
          Sets the gap between two consecutive indicating parts, Considers default value, if it is -1
 void setIndicatorType(int nType)
          Sets the Indicator Type such as left to right, tight to left, up to down or down to up
 void setInnerBorder(GaugeBorder border)
          Sets the inner border of the gauge
 void setKeyboardEnabled(boolean b)
          Sets the enability to increase or decrease the value by keyboard navigation such as (up, down, page up, page down, home and end)
 void setLicenseKey(java.lang.String key)
          Sets the license key
 void setLocale(java.util.Locale l)
          Sets value of the locale.
 void setMajorTickColor(java.awt.Color theColor)
          Sets the major tick color
 void setMajorTickLength(int val)
          Sets the major tick length.
 void setMajorTickSpacing(int spacing)
          Sets the gap between two consecutive major ticks
 void setMajorTickWidth(int val)
          Sets the major tick width.
 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 setMinorTickColor(java.awt.Color theColor)
          Sets the minor tick color
 void setMinorTickLength(int val)
          Sets the minor tick length.
 void setMinorTickSpacing(int spacing)
          Sets the gap between two consecutive minor ticks
 void setMinorTickWidth(int val)
          Sets the minor tick width.
 void setName(java.lang.String theName)
          Sets the name of this bean
 void setNumbersFont(java.awt.Font f)
          Deprecated. use SetFont
 void setOuterBorder(GaugeBorder border)
          Sets the outer border of the gauge
 void setPointValue(int x, int y)
          Sets the value of the given point co-ordinates
 void setTickValuesVisible(boolean b)
          Sets the tick values visibility
 void setTickZoneGap(int nGap)
          Sets the gap between ticks and indicator, Considers default value, if it is -1
 void setValue(int theValue)
          Sets the value to be represented in the level guage
 void setValuesZoneGap(int nGap)
          Sets the gap between tick values and indicator, Considers default value, if it is -1
 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 background color
 void setZoneColor(java.awt.Color color)
          Sets the normal zone background color
 java.lang.String toString()
          Returns string representation of this bean
 void update(java.awt.Graphics g)
          Updates this component
 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, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POINT1

public static final int POINT1
point 1 border width

See Also:
Constant Field Values

POINT2

public static final int POINT2
point 2 border width

See Also:
Constant Field Values

POINT3

public static final int POINT3
point 3 border width

See Also:
Constant Field Values

POINT4

public static final int POINT4
point 4 border width

See Also:
Constant Field Values

POINT5

public static final int POINT5
point 5 border width

See Also:
Constant Field Values

NONE

public static final int NONE
No border

See Also:
Constant Field Values

SIMPLE

public static final int SIMPLE
Simple border

See Also:
Constant Field Values

RAISED

public static final int RAISED
Raised border

See Also:
Constant Field Values

LOWERED

public static final int LOWERED
Lowered border

See Also:
Constant Field Values

MOVE_ON_MOUSE_DRAG

public static final int MOVE_ON_MOUSE_DRAG
Moves indicator on mouse click

See Also:
Constant Field Values

MOVE_ON_MOUSE_PRESS

public static final int MOVE_ON_MOUSE_PRESS
Moves indicator on mouse drag

See Also:
Constant Field Values

MOVE_OFF

public static final int MOVE_OFF
Does not move indicator on any mouse activity

See Also:
Constant Field Values

LEFT_RIGHT_INDICATOR

public static final int LEFT_RIGHT_INDICATOR
Indicates values left to right

See Also:
Constant Field Values

RIGHT_LEFT_INDICATOR

public static final int RIGHT_LEFT_INDICATOR
Indicates values right to left

See Also:
Constant Field Values

UP_DOWN_INDICATOR

public static final int UP_DOWN_INDICATOR
Indicates values up to down

See Also:
Constant Field Values

DOWN_UP_INDICATOR

public static final int DOWN_UP_INDICATOR
Indicates values down to up

See Also:
Constant Field Values

UNIT_INCREMENT

public static final int UNIT_INCREMENT
Specifies the unit increment of a value

See Also:
Constant Field Values

UNIT_DECREMENT

public static final int UNIT_DECREMENT
Specifies the unit decrement of a value

See Also:
Constant Field Values

BLOCK_INCREMENT

public static final int BLOCK_INCREMENT
Specifies the block increment of a value

See Also:
Constant Field Values

BLOCK_DECREMENT

public static final int BLOCK_DECREMENT
Specifies the block decrement of a value

See Also:
Constant Field Values

MAXIMUM

public static final int MAXIMUM
Specifies the maximum value

See Also:
Constant Field Values

MINIMUM

public static final int MINIMUM
Specifies the minimum value

See Also:
Constant Field Values

c1

public transient com.elegantj.editors.C1 c1
Constructor Detail

LevelGauge

public LevelGauge()
Creates a LevelGauge.

Method Detail

setLicenseKey

public void setLicenseKey(java.lang.String key)
Sets the license key

Parameters:
key - the license key

getLicenseKey

public java.lang.String getLicenseKey()
Gets the license key

Returns:
the license key

setName

public void setName(java.lang.String theName)
Sets the name of this bean

Parameters:
theName - specifies the name of this bean

getName

public java.lang.String getName()
Gets the name or the handle of the object


setKeyboardEnabled

public void setKeyboardEnabled(boolean b)
Sets the enability to increase or decrease the value by keyboard navigation such as (up, down, page up, page down, home and end)

Parameters:
b - true to enable the keyboard navigation

isKeyboardEnabled

public boolean isKeyboardEnabled()
Gets the enability to increase or decrease the value by keyboard navigation

Returns:
true if keyboard navigation is enabled, otherwise false

setIndicatorType

public void setIndicatorType(int nType)
Sets the Indicator Type such as left to right, tight to left, up to down or down to up

Parameters:
nType - one of the constants : LEFT_RIGHT_INDICATOR, RIGHT_LEFT_INDICATOR, TOP_BOTTOM_INDICATOR, BOTTOM_TOP_INDICATOR

getIndicatorType

public int getIndicatorType()
Gets the indicator type

Returns:
one of the constants : LEFT_RIGHT_INDICATOR, RIGHT_LEFT_INDICATOR, TOP_BOTTOM_INDICATOR, BOTTOM_TOP_INDICATOR

setIndicatorGap

public void setIndicatorGap(int nGap)
Sets the gap between two consecutive indicating parts, Considers default value, if it is -1

Parameters:
nGap - the gap between two consecutive indicating parts

getIndicatorGap

public int getIndicatorGap()
Gets the gap between two consecutive indicating parts

Returns:
the gap between two consecutive indicating parts

setTickValuesVisible

public void setTickValuesVisible(boolean b)
Sets the tick values visibility

Parameters:
b - true to visible the tick values

isTickValuesVisible

public boolean isTickValuesVisible()
Gets the tick values visibility

Returns:
true to visible the tick values, otherwise false

setInnerBorder

public void setInnerBorder(GaugeBorder border)
Sets the inner border of the gauge

Parameters:
border - the inner border of the gauge

getInnerBorder

public GaugeBorder getInnerBorder()
Gets the inner border of the gauge

Returns:
the inner border of the gauge

setOuterBorder

public void setOuterBorder(GaugeBorder border)
Sets the outer border of the gauge

Parameters:
border - the outer border of the gauge

getOuterBorder

public GaugeBorder getOuterBorder()
Gets the outer border of the gauge

Returns:
the outer border of the gauge

setBorderGap

public void setBorderGap(int nGap)
Sets the gap between inner border and outer border, Considers default value, if it is -1

Parameters:
nGap - the gap between inner border and outer border

getBorderGap

public int getBorderGap()
Gets the gap between inner border and outer border

Returns:
the gap between inner border and outer border

setActiveIndicatorOn

public void setActiveIndicatorOn(int nType)
Sets the mouse activity to move the indicator

Parameters:
nType - one of the constants : MOVE_ON_MOUSE_DRAG, MOVE_ON_MOUSE_CLICK, MOVE_OFF

getActiveIndicatorOn

public int getActiveIndicatorOn()
Gets the mouse activity to move the indicator

Returns:
one of the constants : MOVE_ON_MOUSE_DRAG, MOVE_ON_MOUSE_CLICK, MOVE_OFF

setTickZoneGap

public void setTickZoneGap(int nGap)
Sets the gap between ticks and indicator, Considers default value, if it is -1

Parameters:
nGap - the gap between ticks and indicator

getTickZoneGap

public int getTickZoneGap()
Gets the gap between ticks and indicator

Returns:
the gap between ticks and indicator

setValuesZoneGap

public void setValuesZoneGap(int nGap)
Sets the gap between tick values and indicator, Considers default value, if it is -1

Parameters:
nGap - the gap between tick values and indicator

getValuesZoneGap

public int getValuesZoneGap()
Gets the gap between tick values and indicator

Returns:
the gap between tick values and indicator

setCaption

public void setCaption(java.lang.String s)
Sets the caption text

Parameters:
s - a string specifies the caption

getCaption

public java.lang.String getCaption()
Gets the caption text

Returns:
a string specifies the caption

setCaptionFont

public void setCaptionFont(java.awt.Font theFont)
Sets the caption text font

Parameters:
theFont - a Font specifies the caption text font

getCaptionFont

public java.awt.Font getCaptionFont()
Gets the caption text font

Returns:
a Font specifies the caption text font

setCaptionColor

public void setCaptionColor(java.awt.Color theColor)
Sets the caption text color

Parameters:
theColor - a Color specifies the caption text color

getCaptionColor

public java.awt.Color getCaptionColor()
Gets the caption text color

Returns:
a Color specifies the caption text color

setCaptionLocation

public void setCaptionLocation(java.awt.Point thePoint)
Sets the caption text location. Considers default value, if it is -1, -1

Parameters:
thePoint - a Point specifies the caption text location

getCaptionLocation

public java.awt.Point getCaptionLocation()
Gets the caption text location.

Returns:
a Point specifies the caption text location

setMajorTickSpacing

public void setMajorTickSpacing(int spacing)
Sets the gap between two consecutive major ticks

Parameters:
spacing - the gap between two consecutive major ticks

getMajorTickSpacing

public int getMajorTickSpacing()
Gets the gap between two consecutive major ticks

Returns:
the gap between two consecutive major ticks

setMajorTickColor

public void setMajorTickColor(java.awt.Color theColor)
Sets the major tick color

Parameters:
theColor - the major tick color

getMajorTickColor

public java.awt.Color getMajorTickColor()
Gets the major tick color

Returns:
the major tick color

setMajorTickLength

public void setMajorTickLength(int val)
Sets the major tick length. Considers default value, if it is -1

Parameters:
val - the major tick length

getMajorTickLength

public int getMajorTickLength()
Gets the major tick length.

Returns:
the major tick length

setMajorTickWidth

public void setMajorTickWidth(int val)
Sets the major tick width. Considers default value, if it is -1

Parameters:
val - the major tick width

getMajorTickWidth

public int getMajorTickWidth()
Gets the major tick width.

Returns:
the major tick width

setMinorTickSpacing

public void setMinorTickSpacing(int spacing)
Sets the gap between two consecutive minor ticks

Parameters:
spacing - the gap between two consecutive minor ticks

getMinorTickSpacing

public int getMinorTickSpacing()
Gets the gap between two consecutive minor ticks

Returns:
the gap between two consecutive minor ticks

setMinorTickColor

public void setMinorTickColor(java.awt.Color theColor)
Sets the minor tick color

Parameters:
theColor - the minor tick color

getMinorTickColor

public java.awt.Color getMinorTickColor()
Gets the minor tick color

Returns:
the minor tick color

setMinorTickLength

public void setMinorTickLength(int val)
Sets the minor tick length. Considers default value, if it is -1

Parameters:
val - the minor tick length

getMinorTickLength

public int getMinorTickLength()
Gets the minor tick length.

Returns:
the minor tick length

setMinorTickWidth

public void setMinorTickWidth(int val)
Sets the minor tick width. Considers default value, if it is -1

Parameters:
val - the minor tick width

getMinorTickWidth

public int getMinorTickWidth()
Gets the minor tick width.

Returns:
the minor tick width

setHeaderVisible

public void setHeaderVisible(boolean b)
Sets the header visibility

Parameters:
b - true to visible the header

isHeaderVisible

public boolean isHeaderVisible()
Gets the header visibility

Returns:
true to visible the header

setHeaderText

public void setHeaderText(java.lang.String s)
Sets the text to be displayed on header

Parameters:
s - the header text

getHeaderText

public java.lang.String getHeaderText()
Gets the text to be displayed on header

Returns:
the header text

setHeaderFont

public void setHeaderFont(java.awt.Font theFont)
Sets the header font

Parameters:
theFont - the header font

getHeaderFont

public java.awt.Font getHeaderFont()
Gets the header font

Returns:
the header font

setHeaderBackground

public void setHeaderBackground(java.awt.Color theColor)
Sets the header background color

Parameters:
theColor - the header background color

getHeaderBackground

public java.awt.Color getHeaderBackground()
Gets the header background color

Returns:
the header background color

setHeaderForeground

public void setHeaderForeground(java.awt.Color theColor)
Sets the header foreground color

Parameters:
theColor - the header foreground color

getHeaderForeground

public java.awt.Color getHeaderForeground()
Gets the header foreground color

Returns:
the header foreground color

setHeaderSpacing

public void setHeaderSpacing(int spacing)
Sets the spacing above and below the header text

Parameters:
spacing - the spacing above and below the header text

getHeaderSpacing

public int getHeaderSpacing()
Gets the spacing above and below the header text

Returns:
the spacing above and below the header text

setFooterVisible

public void setFooterVisible(boolean b)
Sets the footer visibility

Parameters:
b - true to visible the footer

isFooterVisible

public boolean isFooterVisible()
Gets the footer visibility

Returns:
true to visible the footer

setFooterText

public void setFooterText(java.lang.String s)
Sets the text to be displayed on footer

Parameters:
s - the footer text

getFooterText

public java.lang.String getFooterText()
Gets the text to be displayed on footer

Returns:
the footer text

setFooterFont

public void setFooterFont(java.awt.Font theFont)
Sets the footer font

Parameters:
theFont - the footer font

getFooterFont

public java.awt.Font getFooterFont()
Gets the footer font

Returns:
the footer font

setFooterBackground

public void setFooterBackground(java.awt.Color theColor)
Sets the footer background color

Parameters:
theColor - the footer background color

getFooterBackground

public java.awt.Color getFooterBackground()
Gets the footer background color

Returns:
the footer background color

setFooterForeground

public void setFooterForeground(java.awt.Color theColor)
Sets the footer foreground color

Parameters:
theColor - the footer foreground color

getFooterForeground

public java.awt.Color getFooterForeground()
Gets the footer foreground color

Returns:
the footer foreground color

setFooterSpacing

public void setFooterSpacing(int spacing)
Sets the spacing above and below the footer text

Parameters:
spacing - the spacing above and below the footer text

getFooterSpacing

public int getFooterSpacing()
Gets the spacing above and below the footer text

Returns:
the spacing above and below the footer text

setMinimum

public void setMinimum(int theMinimum)
Sets the minimum level value of the gauge

Parameters:
theMinimum - lowest level of the gauge

getMinimum

public int getMinimum()
Gets the minimum value of the scale


setMaximum

public void setMaximum(int theMaximum)
Sets the maximum level value of the gauge

Parameters:
theMaximum - highest level of the gauge

getMaximum

public int getMaximum()
Gets the maximum value of the scale


setValue

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

Parameters:
theValue - the value to be represented

getValue

public int getValue()
Gets the current value 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

getWarning

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


setAlarm

public void setAlarm(int level)
Sets the alarm level value of the gauge

Parameters:
level - alarm zone starts from this level value

getAlarm

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


setZoneColor

public void setZoneColor(java.awt.Color color)
Sets the normal zone background color

Parameters:
color - a normal zone background color

getZoneColor

public java.awt.Color getZoneColor()
Gets the normal zone background color


setWarningZoneColor

public void setWarningZoneColor(java.awt.Color color)
Sets the warning zone background color

Parameters:
color - a warning zone background color

getWarningZoneColor

public java.awt.Color getWarningZoneColor()
Gets the warning zone background color


setAlarmZoneColor

public void setAlarmZoneColor(java.awt.Color color)
Sets the alarm zone background color

Parameters:
color - a alarm zone background color

getAlarmZoneColor

public java.awt.Color getAlarmZoneColor()
Gets the alarm zone background color


setActiveZoneColor

public void setActiveZoneColor(java.awt.Color color)
Sets the normal zone color of the values, when it is active

Parameters:
color - an active normal zone color

getActiveZoneColor

public java.awt.Color getActiveZoneColor()
Gets the normal zone color of the level guage, when it is active


setActiveWarningZoneColor

public void setActiveWarningZoneColor(java.awt.Color color)
Sets the warning zone color of the values, when it is active

Parameters:
color - an active warning zone color

getActiveWarningZoneColor

public java.awt.Color getActiveWarningZoneColor()
Gets the warning zone color of the level guage, when it is active


setActiveAlarmZoneColor

public void setActiveAlarmZoneColor(java.awt.Color color)
Sets the alarm zone color of the values, when it is active

Parameters:
color - an active alarm zone color

getActiveAlarmZoneColor

public java.awt.Color getActiveAlarmZoneColor()
Gets the alarm zone color of the level guage, when it is active


setDisabledZoneColor

public void setDisabledZoneColor(java.awt.Color color)
Sets the normal zone color of the values, when it is active and disabled

Parameters:
color - a disabled normal zone color

getDisabledZoneColor

public java.awt.Color getDisabledZoneColor()
Gets the normal zone color of the level guage, when it is active and disabled


setDisabledWarningZoneColor

public void setDisabledWarningZoneColor(java.awt.Color color)
Sets the warning zone color of the values, when it is active and disabled

Parameters:
color - a disabled warning zone color

getDisabledWarningZoneColor

public java.awt.Color getDisabledWarningZoneColor()
Gets the warning zone color of the level guage, when it is active and disabled


setDisabledAlarmZoneColor

public void setDisabledAlarmZoneColor(java.awt.Color color)
Sets the alarm zone color of the values, when it is active and disabled

Parameters:
color - a disabled alarm zone color

getDisabledAlarmZoneColor

public java.awt.Color getDisabledAlarmZoneColor()
Gets the alarm zone color of the level guage, when it is active and disabled


setNumbersFont

public void setNumbersFont(java.awt.Font f)
Deprecated. use SetFont

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

setBorderColor

public void setBorderColor(java.awt.Color color)
Deprecated. use SetOuterBorder

Sets the outer border color of the level guage

Parameters:
color - a outer border color

getBorderColor

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


allocImage

protected void allocImage()
Initialize the off-screen level gauge image.


update

public void update(java.awt.Graphics g)
Updates this component


paint

public void paint(java.awt.Graphics g)
Paints this component. 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.

Parameters:
g - the graphics context to use for painting.

renderImage

public void renderImage()
Renders Image.


draw

public void draw(java.awt.Graphics g)
Renders basic level gauge.


drawZones

public void drawZones(java.awt.Graphics g)
Renders all the level zones.


drawMajorTicks

public void drawMajorTicks(java.awt.Graphics g)
Renders the major ticks of the gauge.


drawMinorTicks

public void drawMinorTicks(java.awt.Graphics g)
Renders the minor ticks of the gauge.


drawValues

public void drawValues(java.awt.Graphics g)
Renders values of the levels.


drawCaption

public void drawCaption(java.awt.Graphics g)
Renders caption text.


drawHeader

public void drawHeader(java.awt.Graphics g)
Renders header text.


drawFooter

public void drawFooter(java.awt.Graphics g)
Renders footer text.


renderCustomFeatures

public void renderCustomFeatures(java.awt.Graphics g)
Renders any extra gadgets or embellishments to the level gauge. Method for subclasses to override.


setPointValue

public void setPointValue(int x,
                          int y)
Sets the value of the given point co-ordinates


adjustValue

public void adjustValue(int type)
Adjusts the value with given adjustment constant.

Parameters:
type - the one of the constants : UNIT_INCREMENT, UNIT_DECREMENT, BLOCK_INCREMENT, BLOCK_DECREMENT, MAXIMUM, MINIMUM

getUnitIncrement

public int getUnitIncrement(int direction)
Returns the amount to change the value by, given a unit up/down request.

Returns:
direction - is -1 or 1 for up/down respectively

getBlockIncrement

public int getBlockIncrement(int direction)
Returns the amount to change the value by, given a block (usually "page") up/down request.

Returns:
direction - is -1 or 1 for up/down respectively

getIndicatorBounds

public java.awt.Rectangle getIndicatorBounds()
Returns the indcator bounds


getHeaderHeight

public int getHeaderHeight()
Returns the header height, 0 if header is not visible


getFooterHeight

public int getFooterHeight()
Returns the footer height, 0 if header is not visible


getAdjustedIndicatorGap

public int getAdjustedIndicatorGap()
Gets the gap between indicating parts adjusted to the gauge

Returns:
the indicator gap

getAdjustedBorderGap

public int getAdjustedBorderGap()
Gets the gap between inner border and outer border adjusted to the gauge

Returns:
the border gap

getAdjustedTickZoneGap

public int getAdjustedTickZoneGap()
Gets the gap between ticks and zone adjusted to the gauge

Returns:
the gap between ticks and zone

getAdjustedValuesZoneGap

public int getAdjustedValuesZoneGap()
Gets the gap between tick values and zone adjusted to the gauge

Returns:
the gap between tick values and zone

getAdjustedCaptionLocation

public java.awt.Point getAdjustedCaptionLocation()
Gets the caption location adjusted to the gauge

Returns:
the caption location

getAdjustedMajorTickLength

public int getAdjustedMajorTickLength()
Gets the major tick length adjusted to the gauge

Returns:
the major tick length

getAdjustedMajorTickWidth

public int getAdjustedMajorTickWidth()
Gets the major tick width adjusted to the gauge

Returns:
the major tick width

getAdjustedMinorTickLength

public int getAdjustedMinorTickLength()
Gets the minor tick length adjusted to the gauge

Returns:
the minor tick length

getAdjustedMinorTickWidth

public int getAdjustedMinorTickWidth()
Gets the minor tick width adjusted to the gauge

Returns:
the minor tick width

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)

processMouseMotionEvent

protected void processMouseMotionEvent(java.awt.event.MouseEvent e)

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.

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.


setBackground

public void setBackground(java.awt.Color c)
Sets the Background color.


setFont

public void setFont(java.awt.Font f)
Sets the font.


setVisible

public void setVisible(boolean b)
sets Visiblity.

Parameters:
b - flag representing visibility of bean.

setEnabled

public void setEnabled(boolean b)
sets Enablity.

Parameters:
b - flag representing enability of bean.

setLocale

public void setLocale(java.util.Locale l)
Sets value of the locale.

Parameters:
l - current value of the locale.

getLocale

public java.util.Locale getLocale()
Returns the value of locale.

Returns:
the current value of locale

setCursor

public void setCursor(java.awt.Cursor c)
Sets value of the cursor.

Parameters:
c - current value of the cursor.

isFocusTraversable

public boolean isFocusTraversable()
Returns the value of a flag that indicates whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.

Returns:
true if this component is focus-traverable, false otherwise.

isLightweight

public boolean isLightweight()
Returns true if this Component is displayable

Returns:
true if this component has a lightweight peer; false if it has a native peer or no peer.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this bean.

Returns:
a dimension object indicating this bean's preferred size.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired in response to an explicit setFont, setBackground, or SetForeground on the current component. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - The PropertyChangeListener to be removed

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Support for reporting bound property This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.


addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener


removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener


fireValueChange

public void fireValueChange(int oldValue,
                            int newValue)
Invokes this method when the value has been changed

Parameters:
oldValue - the old value
newValue - the new (changed) value

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
Throws:
java.io.IOException

readExternal

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

toString

public java.lang.String toString()
Returns string representation of this bean

Returns:
string representaion of this bean

ElegantJ Gauges Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.