|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--adm.CStripChart
CStripChart is a container widget that holds up to 8 Pen instances. It
does not implement DeviceListener but gets the data from each Pen at
specified time intervals. The new data will be plotted on the right
side of the strip chart and the old data will be shifted to the left.
The device name and property name must be set for each Pen added to
the CStripChart. The color of the Pen is optional. The default Pen color
will be used if it has not been set. The default Pen color defined in
CStripChart class is brown, orange, green, blue, purple, pink, cyan,
navy for pen[0], pen[1], ..., pen[7].
The Pen in the CStripChart can share a common display range (y-axis)
using method setCommonAxis (true). By default, all the pens have their
own display range.
Initially the information of the first Pen will be displayed on the y
axis label and device/property name label in the color of the first Pen.
The value and color of the label will change to a specific Pen if the
user clicks on the plot line of that Pen. Due to a java 1.1.X bug, this
feature only works with the jre 1.2.
The methods setDisplayRange (int, int), setDisplayHi (int) and
setDisplayLo (int) in the CStripChart class will force setting the range
style to RANGE_STATIC and common axis to true. When using a common axis,
the minimum display low and the maximum display high of all pens are
used as the display range if the user does not specify the display
range. The display range of each pen can be set individually using
the setDisplayHi(double)/setDispalyLo(double) or
setDisplayRange(double, double) methods in the Pen class.
The y-axis is forced to a common axis when the range style is set to
RANGE_AUTO.
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 | |
CStripChart()
Null Constructor |
Method Summary | |
java.awt.Component |
add(CPen pen)
Overwrite the Container's add for visual tool |
void |
addPen(CPen newPen)
Add a new pen to StripChart if there is a Pen available. |
void |
addPen(java.lang.String dName,
java.lang.String pName)
Add a new Pen to StripChart if there is a Pen available. |
void |
addPen(java.lang.String dName,
java.lang.String pName,
java.awt.Color penColor)
Add a new Pen to StripChart if there is a Pen available. |
void |
addPen(java.lang.String dName,
java.lang.String pName,
java.awt.Color penColor,
double min,
double max)
Add a new Pen to StripChart if there is a Pen available. |
double |
getDisplayHi()
Return display high |
double |
getDisplayLo()
Return display low |
int |
getDisplayPeriod()
Return the displayPeriod in seconds. |
java.awt.Font |
getFont()
Return the font of the text on the component |
int |
getLabelStyle()
Return the label style property |
int |
getRangeStyle()
Return the range style property |
boolean |
isCommonAxis()
Return the commonAxis property. |
void |
mouseClicked(java.awt.event.MouseEvent me)
For mouseListener interface handle mouse click If click on one of the drawing line, the y axis and channel name will show the value of that line. |
void |
mouseEntered(java.awt.event.MouseEvent me)
For mouseListener interface |
void |
mouseExited(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
mouseReleased(java.awt.event.MouseEvent me)
|
void |
paint(java.awt.Graphics g)
Draw offscreen graphics and repaint it onto the screen. |
boolean |
pensAvailable()
Returns true if there are Pen on the stripChart available (max available Pen is 8). |
void |
run()
Sleep a updatePeriod and call repaint method to update the chart |
void |
setBackground(java.awt.Color newBg)
Set component background color |
void |
setBounds(int x,
int y,
int w,
int h)
Set the bounds of the canvas. |
void |
setCommonAxis(boolean b)
Set up commonAxis property. |
void |
setDisplayHi(double hi)
Set the display high. |
void |
setDisplayLo(double lo)
Set the display low. |
void |
setDisplayPeriod(int seconds)
Set the total display time period. |
void |
setDisplayRange(double lo,
double hi)
Set the display limits. |
void |
setFont(java.awt.Font newFont)
Set text font for labeling and displaying values. |
void |
setForeground(java.awt.Color newFg)
Set compoenet foreground color |
void |
setLabelStyle(int label)
Set the label style property of stripChart |
void |
setRangeStyle(int newRangeStyle)
Set the range style property of stripChart |
void |
setSize(int newWidth,
int newHeight)
Overwrite parent setSize method to force repaint the background. |
void |
update(java.awt.Graphics g)
Overwrite the parent update method so it only call this.paint(g) |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setLayout,
validate |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
contains,
contains,
createImage,
createImage,
disable,
dispatchEvent,
enable,
enable,
enableInputMethods,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CStripChart()
Method Detail |
public boolean pensAvailable()
public void addPen(CPen newPen)
newPen
- a new CPen classpublic void addPen(java.lang.String dName, java.lang.String pName)
dName
- the device name for the pen to connectpName
- the property name for the pen to connectpublic void addPen(java.lang.String dName, java.lang.String pName, java.awt.Color penColor)
dName
- the device name for the pen to connectpName
- the property name for the pen to connectpenColor
- the color of the penpublic void addPen(java.lang.String dName, java.lang.String pName, java.awt.Color penColor, double min, double max)
dName
- the device name for the pen to connectpName
- the property name for the pen to connectpenColor
- the color of the penmin
- the display range Lowmax
- the display range Highpublic java.awt.Component add(CPen pen)
newPens
- a CPen object.public void setLabelStyle(int label)
newLab
- the new label style, which may be one of:
public int getLabelStyle()
public void setRangeStyle(int newRangeStyle)
newRangeStyle
- the new range style, which may be one of:
public int getRangeStyle()
public void setCommonAxis(boolean b)
public boolean isCommonAxis()
public void setDisplayPeriod(int seconds)
seconds
- the total display period in secondspublic int getDisplayPeriod()
public void setDisplayRange(double lo, double hi)
lo
- the display lowhi
- the display high
hi must be larger than lo otherwise nothing is changed.public void setDisplayHi(double hi)
hi
- the display high
hi must be larger than displayLo otherwise nothing is changed.public void setDisplayLo(double lo)
lo
- the display low
lo must be smaller than displayHi otherwise nothing is changed.public double getDisplayHi()
public double getDisplayLo()
public void run()
public final void update(java.awt.Graphics g)
public final void paint(java.awt.Graphics g)
public void mouseEntered(java.awt.event.MouseEvent me)
public void mouseExited(java.awt.event.MouseEvent me)
public void mouseReleased(java.awt.event.MouseEvent me)
public void mousePressed(java.awt.event.MouseEvent me)
public void mouseClicked(java.awt.event.MouseEvent me)
public void setSize(int newWidth, int newHeight)
newWidth
- width of the componentnewHeight
- height of the componentpublic void setBounds(int x, int y, int w, int h)
x
- component X locationy
- component Y locationw
- component widthh
- component heightpublic void setFont(java.awt.Font newFont)
newFont
- font for any text on the componentpublic java.awt.Font getFont()
public void setBackground(java.awt.Color newBg)
newBg
- the background color of componentpublic void setForeground(java.awt.Color newFg)
newFg
- the foreground color of component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |