adm
Class CCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--adm.CCanvas
Direct Known Subclasses:
CAnimatedCanvas, CRect, CToggleButton

public abstract class CCanvas
extends java.awt.Canvas
implements CInterface, DeviceListener, CConstants

CCanvas is a abstract class. It is responsible for posting the minotorOn and receiving data. It is the base class of the control system display widgets. It uses awt.component paint and update methods.

Users can extend this class to develop simple custom widgets. The derived classes must implement the deviceChanged 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
 
Fields inherited from interface adm.CConstants
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, AXIS_BOTTOM, AXIS_LEFT, AXIS_RIGHT, AXIS_STYLE_LINEAR, AXIS_STYLE_LOG10, AXIS_TOP, CLASS_QUERY, CLRMOD_ALARM, CLRMOD_STATIC, COLUMN, DEVICE_QUERY, DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_UP, FILL_FROM_CENTER, FILL_FROM_EDGE, FRMT_AUTO, FRMT_FLOAT, FRMT_HEX, FRMT_INTEGER, FRMT_OCTAL, FRMT_SCIENTIFIC, HORIZONTAL, LABEL_ALL, LABEL_AXIS, LABEL_NONE, LABEL_VALUE, PROPERTY_QUERY, RANGE_AUTO, RANGE_FROM_PROPERTY, RANGE_STATIC, ROW, STYLE_FILLUNDER, STYLE_LINE, STYLE_POINT, VERTICAL
 
Constructor Summary
CCanvas(int width, int height)
          Constructor Defines the canvas size and uses default foreground and background colors.
CCanvas(int width, int height, java.awt.Color fg, java.awt.Color bg)
          Constructor Defines the canvas size and sets foreground and background colors.
CCanvas(java.lang.String dName, java.lang.String pName)
          Constructor with device name and property name
 
Method Summary
 java.lang.String getDeviceName()
          Return the device name to which this component is connected.
 java.lang.String getPropertyName()
          Return the device property name to which this component is connected.
 void setDeviceAndPropertyName(java.lang.String newDeviceName, java.lang.String newPropertyName)
          Set device name and device property name
 void setDeviceName(java.lang.String newName)
          Set the Device name
 void setPropertyName(java.lang.String newName)
          Set device property name
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
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, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, 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, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CCanvas

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

CCanvas

public CCanvas(int width,
               int height)
Constructor Defines the canvas size and uses default foreground and background colors.
Parameters:
width - component width
height - component height

CCanvas

public CCanvas(int width,
               int height,
               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

setDeviceName

public void setDeviceName(java.lang.String newName)
Set the Device name
Specified by:
setDeviceName in interface CInterface
Parameters:
newName - the name of device you want to connect

getDeviceName

public java.lang.String getDeviceName()
Return the device name to which this component is connected. If device name is not set, return empty string "".
Specified by:
getDeviceName in interface CInterface

setPropertyName

public void setPropertyName(java.lang.String newName)
Set device property name
Specified by:
setPropertyName in interface CInterface
Parameters:
newName - the name of device property you want to connect

getPropertyName

public java.lang.String getPropertyName()
Return the device property name to which this component is connected. If property name is not set, return empty string "".
Specified by:
getPropertyName in interface CInterface

setDeviceAndPropertyName

public void setDeviceAndPropertyName(java.lang.String newDeviceName,
                                     java.lang.String newPropertyName)
Set device name and device property name
Parameters:
newDeviceName - the device name you want to connect
newPropertyName - the device property name you want to connect