adm
Class CTrace

java.lang.Object
  |
  +--java.awt.Component
        |
        +--adm.CTrace

public class CTrace
extends java.awt.Component
implements CConstants

CTrace is a data model for CCartesin widget. It connects to two device/properties with the simultaneous data update. One is the value of x-axis and another is the y-axis. The time stamp is used to trig the trace event. This means only the new data pair with same time stamp will fire up CTraceEvent (send a trace event to Listeners).

CTrace class defines many trace properties. You may specify one of the three axes range styles (x-axis or y-axis), RANGE_AUTO, RANGE_STATIC, RANGE_FROM_PROPRTY with setRangeStyle. The default range style for all axes are RANGE_FROM_PROPRTY. Call setTraceColor method to reset the default trace color (green) and use setTraceStyle to select STYLE_POINT or STYLE_LINE (default) as the trace style.

The setX(Y)DisplayLo(Hi) methods to specify the display range. When any of these methods called, the range style for that axis will be forced to RANGE_STATIC. If the range style is set to RANGE_STATIC and range low and/or range high are not set, the default display range (0 for low and 100 for high) will be used.

Since:
adm0.4
See Also:
Serialized Form

Field Summary
 boolean redraw
           
 
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
CTrace()
          Null constructor.
CTrace(java.lang.String xDName, java.lang.String xPName, java.lang.String yDName, java.lang.String yPName)
          Constructor with parameters
 
Method Summary
 void addTraceListener(CTraceListener tl)
          Add the data listener to receive the notification
 void fireTraceDataChange()
          Fire the event change - notify all the data listener
 java.awt.Color getTraceColor()
          Return the color of this trace
 int getTraceStyle()
          Return the trace style of this trace
 adm.Axis getXAxis()
          Return the X axis of this trace
 java.lang.String getXDeviceName()
          Return the device name to which this component is connected.
 double getXDisplayHi()
          Return x-axis display high
 double getXDisplayLo()
          Return x-axis display low
 java.lang.String getXPropertyName()
          Return the device property name to which this component is connected.
 int getXRangeStyle()
          Return the X axis range style of this trace.
 adm.Axis getYAxis()
          Return the Y axis of this trace
 java.lang.String getYDeviceName()
          Return the device name to which this component is connected.
 double getYDisplayHi()
          Return y-axis display high
 double getYDisplayLo()
          Return y-axis display low
 java.lang.String getYPropertyName()
          Return the device property name to which this component is connected.
 int getYRangeStyle()
          Return the Y axis range style of this trace.
 void removeTraceListener(CTraceListener tl)
          Remove the data listener service
 void setTraceColor(java.awt.Color aColor)
          Set the color of this trace
 void setTraceStyle(int style)
          Set up the trace style of this trace
 void setXAxis(adm.Axis axis)
          Set up the X axis of this trace
 void setXDeviceName(java.lang.String newName)
          Set the Device name
 void setXDisplayHi(double high)
          set x-axis display high.
 void setXDisplayLo(double low)
          set x-axis display low.
 void setXDisplayRange(double low, double high)
          Set X axis display range (low and high).
 void setXPropertyName(java.lang.String newName)
          Set device property name
 void setXRangeStyle(int style)
          Set up the X axis range style of this trace.
 void setYAxis(adm.Axis axis)
          Set up the Y axis of this trace
 void setYAxisPosition(int position)
          Set up the Y axis position of this trace
 void setYDeviceName(java.lang.String newName)
          Set the Device name
 void setYDisplayHi(double high)
          set y-axis display high.
 void setYDisplayLo(double low)
          set y-axis display low.
 void setYDisplayRange(double low, double high)
          Set Y axis display range (low and high).
 void setYPropertyName(java.lang.String newName)
          Set device property name
 void setYRangeStyle(int style)
          Set up the Y axis range style of this trace.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, 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, paint, 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
 

Field Detail

redraw

public boolean redraw
Constructor Detail

CTrace

public CTrace()
Null constructor.

CTrace

public CTrace(java.lang.String xDName,
              java.lang.String xPName,
              java.lang.String yDName,
              java.lang.String yPName)
Constructor with parameters
Parameters:
xDName - the name of device for x value
xPName - the name of property for x value
yDName - the name of device for y value
yDName - the name of property fot y value
Method Detail

setXAxis

public void setXAxis(adm.Axis axis)
Set up the X axis of this trace

getXAxis

public adm.Axis getXAxis()
Return the X axis of this trace

setYAxis

public void setYAxis(adm.Axis axis)
Set up the Y axis of this trace

getYAxis

public adm.Axis getYAxis()
Return the Y axis of this trace

addTraceListener

public void addTraceListener(CTraceListener tl)
Add the data listener to receive the notification

removeTraceListener

public void removeTraceListener(CTraceListener tl)
Remove the data listener service

fireTraceDataChange

public void fireTraceDataChange()
Fire the event change - notify all the data listener

setXDeviceName

public void setXDeviceName(java.lang.String newName)
Set the Device name
Parameters:
newName - the name of device you want to connect

getXDeviceName

public java.lang.String getXDeviceName()
Return the device name to which this component is connected. If device name is not set, return empty string "".

setXPropertyName

public void setXPropertyName(java.lang.String newName)
Set device property name
Parameters:
newName - the name of device property you want to connect

getXPropertyName

public java.lang.String getXPropertyName()
Return the device property name to which this component is connected. If property name is not set, return empty string "".

setYDeviceName

public void setYDeviceName(java.lang.String newName)
Set the Device name
Parameters:
newName - the name of device you want to connect

getYDeviceName

public java.lang.String getYDeviceName()
Return the device name to which this component is connected. If device name is not set, return empty string "".

setYPropertyName

public void setYPropertyName(java.lang.String newName)
Set device property name
Parameters:
newName - the name of device property you want to connect

getYPropertyName

public java.lang.String getYPropertyName()
Return the device property name to which this component is connected. If property name is not set, return empty string "".

setTraceColor

public void setTraceColor(java.awt.Color aColor)
Set the color of this trace

getTraceColor

public java.awt.Color getTraceColor()
Return the color of this trace

getTraceStyle

public int getTraceStyle()
Return the trace style of this trace

setTraceStyle

public void setTraceStyle(int style)
Set up the trace style of this trace

getXRangeStyle

public int getXRangeStyle()
Return the X axis range style of this trace.

setXRangeStyle

public void setXRangeStyle(int style)
Set up the X axis range style of this trace.

getYRangeStyle

public int getYRangeStyle()
Return the Y axis range style of this trace.

setYRangeStyle

public void setYRangeStyle(int style)
Set up the Y axis range style of this trace.

setYAxisPosition

public void setYAxisPosition(int position)
Set up the Y axis position of this trace
Parameters:
position - The Y axis position, which may be one of:
  1. CConstants.AXIX_LEFT
  2. CConstants.AXIS_RIGHT

setXDisplayRange

public void setXDisplayRange(double low,
                             double high)
Set X axis display range (low and high).
Parameters:
low - the x-axis display low value
high - the x-axis display high value

setYDisplayRange

public void setYDisplayRange(double low,
                             double high)
Set Y axis display range (low and high).
Parameters:
low - the y-axis display low value
high - the y-axis display high value

setXDisplayHi

public void setXDisplayHi(double high)
set x-axis display high.
Parameters:
high - the x-axis display high value

setYDisplayHi

public void setYDisplayHi(double high)
set y-axis display high.
Parameters:
high - the y-axis display high value

setXDisplayLo

public void setXDisplayLo(double low)
set x-axis display low.
Parameters:
low - the x-axis display low value

setYDisplayLo

public void setYDisplayLo(double low)
set y-axis display low.
Parameters:
low - the y-axis display low value

getXDisplayHi

public double getXDisplayHi()
Return x-axis display high

getYDisplayHi

public double getYDisplayHi()
Return y-axis display high

getXDisplayLo

public double getXDisplayLo()
Return x-axis display low

getYDisplayLo

public double getYDisplayLo()
Return y-axis display low