|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--adm.CCanvas | +--adm.CAnimatedCanvas | +--adm.CBits
CBits is an awt component bean. It displays and controls an integer
property's value in the control system as bit patterns. The size, bound,
foreground, background and the font of the label on the widget can be
set like an awt component.
The bits display range can be set through the setDisplayBits (int, int),
setStartBit (int) and setEndBit (int) methods. The default bits display
range is 0 to 15.
By default it is a monitor widget only (the controllable property is set
to false). Since version 0.3 it is can used to control the individual
bits by calling setControllable(true). If the controllable property is
set to true, the individual bit rectangle works like a push button.
Pushing the bit button the value will change from 0 to 1 or 1 to 0.
There are three label styles with a default of LABEL_NONE. If LABEL_AXIS
(or LABEL_VALUE) is used, start/end bit numbers and a arrow indicating
increasing bit number will be shown. All the information including the
device and property name is shown when LABEL_ALL is used.
CBits has four directions which can be selected. The bits can start from
right (direction = DIR_LEFT), left (direction = DIR_RIGHT), top (direction
= DIR_DOWN) or bottom (direction = DIR_UP).
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
CBits()
Null constructor. |
|
CBits(int direction)
Construct a CBits class with specific direction. |
|
CBits(java.lang.String dName,
java.lang.String pName)
Constructor with device name and property name |
Method Summary | |
void |
deviceChanged(DeviceEvent event)
|
int |
getDirection()
Return the direction |
int |
getEndBit()
Return the endBit |
int |
getStartBit()
Return the startBit |
boolean |
isControllable()
Return true if this widget is controllabel. |
void |
mouseClicked(java.awt.event.MouseEvent me)
|
void |
mouseEntered(java.awt.event.MouseEvent me)
MouseListener interface |
void |
mouseExited(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
mouseReleased(java.awt.event.MouseEvent me)
Handles mouse release. |
void |
setControllable(boolean b)
Set the controllable parameter. |
void |
setDirection(int newDir)
Set bit position direction |
void |
setDisplayBits(int sBit,
int eBit)
Set the startBit and endBit. |
void |
setEndBit(int eBit)
Set the endBit. |
void |
setStartBit(int sBit)
Set the startBit. |
Methods inherited from class adm.CAnimatedCanvas |
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 |
public CBits()
public CBits(java.lang.String dName, java.lang.String pName)
dName
- device namepName
- property namepublic CBits(int direction)
direction
- the direction of the bits display, which be one of:
Method Detail |
public int getStartBit()
public int getEndBit()
public void setStartBit(int sBit)
sBit
- start bit positionpublic void setEndBit(int eBit)
eBit
- end bit positionpublic void setDisplayBits(int sBit, int eBit)
sBit
- start bit positioneBit
- end bit positionpublic int getDirection()
public void setDirection(int newDir)
newDir
- the new direction, which be one of:
public void setControllable(boolean b)
b
- = true (this widget can used to control value)
= false (only used to monitor the value)public boolean isControllable()
public void mouseEntered(java.awt.event.MouseEvent me)
public void mouseExited(java.awt.event.MouseEvent me)
public void mousePressed(java.awt.event.MouseEvent me)
public void mouseClicked(java.awt.event.MouseEvent me)
public void mouseReleased(java.awt.event.MouseEvent me)
public void deviceChanged(DeviceEvent event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |