adm
Class CBar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--adm.CCanvas
                    |
                    +--adm.CAnimatedCanvas
                          |
                          +--adm.CIndicator
                                |
                                +--adm.CBar

public class CBar
extends CIndicator

CBar is an awt component bean. It displays a property's value in the control system as a moving rectangular filled area. The size, bound, foreground, background and the font of the label on the bar can be set like as for an awt component.

The color of the filled rectangular is the same as the foreground if the color mode property is set to CLRMOD_STATIC (default). It will change from foreground color to yellow or red depending on the property's value and warning and alarm limits when CLRMOD_ALARM is used.

There are four label styles; the default label style is LABEL_NONE. If LABEL_AXIS is used; the tick marks and display range will appear on the CBar widget. In addition to the tick marks and display range, the property's value will also shown on the widget if LABEL_VALUE is selected. All the information including the device and property name will on the widget when LABEL_ALL is used.

The orientation of the CBar can be either VERTICAL (default) or HORIZONTAL. Finally the fill style can be set to FILL_FROM_EDGE (default) or FILL_FROM_CENTER using the setFillStyle (int) method.

Since:
adm0.1
See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
CBar()
          Null Constructor.
CBar(int w, int h)
          Constructor Defines the canvas size and use default foreground and background color
CBar(int w, int h, java.awt.Color fg, java.awt.Color bg)
          Constructor Defines the canvas size and sets foreground and background colors.
CBar(java.lang.String dName, java.lang.String pName)
          Constructor with device name and property name.
 
Method Summary
 int getFillMode()
          Get the fill mode
 void setFillMode(int newFillMode)
          Set the fill mode
 
Methods inherited from class adm.CIndicator
getOrientation, setOrientation
 
Methods inherited from class adm.CAnimatedCanvas
deviceChanged, getBackground, getColorMode, getDisplayHi, getDisplayLo, getFont, getForeground, getFrameWidth, getLabelStyle, getRangeStyle, paint, setBackground, setBounds, setBounds, setColorMode, setDisplayHi, setDisplayLo, setDisplayRange, setFont, setForeground, setFrameWidth, setLabelStyle, setRangeStyle, setSize, setSize, update
 
Methods inherited from class adm.CCanvas
getDeviceName, getPropertyName, setDeviceAndPropertyName, setDeviceName, setPropertyName
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setComponentOrientation, setCursor, setDropTarget, setEnabled, setLocale, setLocation, setLocation, setName, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CBar

public CBar()
Null Constructor.

CBar

public CBar(java.lang.String dName,
            java.lang.String pName)
Constructor with device name and property name.
Parameters:
dName - device name
pName - property name

CBar

public CBar(int w,
            int h)
Constructor Defines the canvas size and use default foreground and background color
Parameters:
width - component width
height - component height

CBar

public CBar(int w,
            int h,
            java.awt.Color fg,
            java.awt.Color bg)
Constructor Defines the canvas size and sets foreground and background colors.
Parameters:
width - component width
height - component height
fg - foreground color
bg - background color
Method Detail

getFillMode

public int getFillMode()
Get the fill mode

setFillMode

public void setFillMode(int newFillMode)
Set the fill mode
Parameters:
newFillMode - new fill mode, which may be one of:
  1. CConstants.FILL_FROM_EDGE
  2. CConstants.FILL_FROM_CENTER