ElegantJ Gauges Java API Specification v1.1

com.elegantj.gauges.needle
Class NeedleGauge

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bycom.elegantj.gauges.needle.NeedleGauge
All Implemented Interfaces:
javax.accessibility.Accessible, java.io.Externalizable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

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

This class implements Needle demo guage which enables continuous monitoring of the signals visually. The component is implemented as a bean and provides properties that help it to interface with other data retrieving tools.

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 needle
Minimum the minimum value of the needle
CaptionFont represents the font which is used to display the caption
NumberFont represents the font which is used to display the number
PanelColor represents the color of the background panel under which this bean resides
Unit represents specified unit system to display the value
NewZoneValues represents the each zone , Each zone has the name, zone color , low value ,high value, grad value, subgrad value
NeedleValue represents the value of the gauge
ScaleGrad represents the scale system of this bean

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
 com.elegantj.editors.C1 c1
           
 
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
NeedleGauge()
          Creates a NeedleGauge.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
static java.util.Vector createVector(java.lang.String str)
          Converts the zone values into vector from string representation.
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.
 java.lang.String getCaption()
          Gets the caption specified for the needle gauge
 java.awt.Font getCaptionFont()
          Gets the font of the caption
 java.lang.String getLicenseKey()
          Gets the license key
 java.util.Locale getLocale()
          Returns the value of locale.
 double getMaximum()
          Gets the maximum value that the meter can indicate
 double getMinimum()
          Gets the minimum value that the meter can indicate
 java.lang.String getName()
          Gets the name or the handle of the object
 double getNeedleValue()
          Gets the value that the meter is currently indicating
 java.util.Vector getNewZoneValues()
          Gets the zone values.
 java.awt.Font getNumbersFont()
          Gets the font of the numbers
 java.awt.Color getPanelColor()
          Gets the panel color
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this bean.
 double getScaleGrad()
          Gets the scale grading value
 java.lang.String getUnit()
          Gets the name or the handle of the object
 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 isLightweight()
          Returns true if this Component is displayable
 void readExternal(java.io.ObjectInput in)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void setBackground(java.awt.Color c)
          Sets the Background color.
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this bean.
 void setCaption(java.lang.String s)
          Sets the caption of the for the needle gauge
 void setCaptionFont(java.awt.Font f)
          Sets the font of the caption
 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 setLicenseKey(java.lang.String key)
          Sets the license key
 void setLocale(java.util.Locale l)
          Sets value of the locale.
 void setMaximum(double s)
          Sets the maximum value of the gauge for each zone
 void setMinimum(double s)
          Sets the minimum value of the gauge for each zone
 void setName(java.lang.String s)
          Sets the name or the handle of the object
 void setNeedleValue(double s)
          Sets the needle value specified by the user
 void setNewZoneValues(java.lang.String str)
          Sets the zone values .
 void setNewZoneValues(java.util.Vector oVect)
          Sets the zone values .
 void setNumbersFont(java.awt.Font f)
          Sets the font of the numbers
 void setPanelColor(java.awt.Color theColor)
          Sets the panel color
 void setScaleGrad(double s)
          Sets the gradings of the scale of the gauge
 void setUnit(java.lang.String n)
          Sets the Unit
 void setVisible(boolean b)
          sets Visiblity.
 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, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

c1

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

NeedleGauge

public NeedleGauge()
Creates a NeedleGauge.

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

setPanelColor

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


getPanelColor

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

Returns:
panel color

setUnit

public void setUnit(java.lang.String n)
Sets the Unit

Parameters:
n - the unit string representation

getUnit

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

Returns:
string representation of the unit

setCaptionFont

public void setCaptionFont(java.awt.Font f)
Sets the font of the caption


getCaptionFont

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

Returns:
the caption font style

setNumbersFont

public void setNumbersFont(java.awt.Font f)
Sets the font of the numbers


getNumbersFont

public java.awt.Font getNumbersFont()
Gets the font of the numbers

Returns:
the numbers font style

setMinimum

public void setMinimum(double s)
Sets the minimum value of the gauge for each zone

Parameters:
s - the minimum value.

setMaximum

public void setMaximum(double s)
Sets the maximum value of the gauge for each zone

Parameters:
s - the maximum value.

setCaption

public void setCaption(java.lang.String s)
Sets the caption of the for the needle gauge

Parameters:
s - the caption string

setScaleGrad

public void setScaleGrad(double s)
Sets the gradings of the scale of the gauge

Parameters:
s - the scale gradings

setNeedleValue

public void setNeedleValue(double s)
Sets the needle value specified by the user

Parameters:
s - the needle current value

setNewZoneValues

public void setNewZoneValues(java.util.Vector oVect)
Sets the zone values .

Parameters:
oVect - a vector containing the list of zones

getNewZoneValues

public java.util.Vector getNewZoneValues()
Gets the zone values.

Returns:
vector type object containing the list of zones

setNewZoneValues

public void setNewZoneValues(java.lang.String str)
Sets the zone values .

Parameters:
str - a string representing the list of zones

createVector

public static java.util.Vector createVector(java.lang.String str)
Converts the zone values into vector from string representation.


setName

public void setName(java.lang.String s)
Sets the name or the handle of the object

Parameters:
s - the name of this bean

getName

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

Returns:
the name of this bean

getMinimum

public double getMinimum()
Gets the minimum value that the meter can indicate

Returns:
the lowest value

getMaximum

public double getMaximum()
Gets the maximum value that the meter can indicate

Returns:
the highest value

getCaption

public java.lang.String getCaption()
Gets the caption specified for the needle gauge

Returns:
the caption string

getScaleGrad

public double getScaleGrad()
Gets the scale grading value

Returns:
the graded value

getNeedleValue

public double getNeedleValue()
Gets the value that the meter is currently indicating

Returns:
the current value

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.


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

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.