|
||||||||
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 | +--javax.swing.JComponent | +--javax.swing.JPanel | +--ControlBeans.CPlotter
This class implements a simple plotter.
Its purpose it to provide the user with a visual graph indicator.
This is a passive component, meaning that it will never itself send any
values to the communicator. It can contain several curves with varying
colors being drawn over a user defined range.
It has been implemented as a Javabean, meaning that it is well suited
to use within visual programming tools such as NetBeans or JBuilder.
AbstractCommunicator
, Serialized FormInner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Fields inherited from interface ControlBeans.ComponentInterface |
DEFAULT_ID |
Constructor Summary | |
CPlotter()
Constructs a new CPlotter. |
Method Summary | |
void |
addComponentListener(ComponentListener l)
Registers a ComponentListener. |
void |
drawCurves(java.awt.Graphics g)
This methods draws the curves, axis and ticks. |
int |
getCapacity()
Gets how many values each curve in this plotter will store. |
java.awt.Color[] |
getColors()
Gets the color for each of the plottable curves in this plotter. |
boolean |
getDrawAxis()
Gets whether or not the x-axis and y-axis will be drawn. |
boolean |
getDrawTicks()
Gets whether or not the ticks will be drawn on the x-axis and y-axis. |
boolean |
getIsReceiver()
Gets whether or not this component will receive values. |
boolean |
getIsSender()
Gets whether or not this component will send values. |
double |
getMajorXTickSpacing()
Gets the number of units between each of the larger lines (ticks) on the scale on the x-axis. |
double |
getMajorYTickSpacing()
Gets the number of units between each of the larger lines (ticks) on the scale on the y-axis. |
double |
getMinorXTickSpacing()
Gets the number of units between each of the smaller lines (ticks) on the scale on the x-axis. |
double |
getMinorYTickSpacing()
Gets the number of units between each of the smaller lines (ticks) on the scale on the y-axis. |
int |
getRefreshrate()
Gets how often this plotter will refresh itself. |
int[] |
getTags()
Returns an array of integers containing all tags for which this plotter will draw curves. |
double |
getXRange()
Gets the range of the x-axis for this plotter. |
double |
getYOffset()
Gets the minimum plottable value on the y-axis for this plotter. |
double |
getYRange()
Gets the range of the y-axis for this plotter. |
void |
paint(java.awt.Graphics g)
This methods draws the curves, axis and ticks. |
void |
putValue(double value,
int aTag,
double time,
int ID)
Sets the value of this component. |
void |
putValue(int value,
int aTag,
double time,
int ID)
Sets the value of this component. |
void |
putValue(java.lang.String value,
int aTag,
double time,
int ID)
Sets the value for this component. |
void |
registerCommunicator(AbstractCommunicator c,
int ID)
The communicator uses this method to alert this component of its presence. |
void |
removeComponentListener(ComponentListener l)
Deregisters the ComponentListener. |
void |
requestValues()
Called by the communicator to make this component send its value(s). |
void |
run()
Starts the automatic refreshing of this plotter. |
void |
setCapacity(int value)
Sets how many values each curve will store. |
void |
setColors(java.awt.Color[] value)
Sets the color for each of the plottable curves in this plotter. |
void |
setDrawAxis(boolean value)
Sets whether or not the x-axis and y-axis will be drawn. |
void |
setDrawTicks(boolean value)
Sets whether or not the ticks will be drawn on the x-axis and y-axis. |
void |
setIsReceiver(boolean value)
Sets whether or not this component should receive values. |
void |
setIsSender(boolean value)
Sets whether or not this component should send values. |
void |
setMajorXTickSpacing(double value)
Sets the number of units between each of the larger lines (ticks) on the scale on the x-axis. |
void |
setMajorYTickSpacing(double value)
Sets the number of units between each of the larger lines (ticks) on the scale on the y-axis. |
void |
setMinorXTickSpacing(double value)
Sets the number of units between each of the smaller lines (ticks) on the scale on the x-axis. |
void |
setMinorYTickSpacing(double value)
Sets the number of units between each of the smaller lines (ticks) on the scale on the y-axis. |
void |
setRefreshrate(int value)
Sets how often this plotter will refresh itself. |
void |
setTags(int[] value)
Sets the tags for which this plotter will draw curves. |
void |
setXRange(double value)
Sets the range of the x-axis for this plotter. |
void |
setYOffset(double value)
Sets the minimum plottable value on the y-axis for this plotter. |
void |
setYRange(double value)
Sets the range of the y-axis for this plotter. |
void |
update(java.awt.Graphics g)
This methods draws the curves, axis and ticks. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getWidth,
getVisibleRect,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CPlotter()
Method Detail |
public void run()
registerCommunicator
method and should therefore not
be called directly by the user.registerCommunicator(ControlBeans.AbstractCommunicator, int)
public boolean getDrawAxis()
true
if the two axis will be drawn,
false
otherwise.public void setDrawAxis(boolean value)
value
- true
if this component should draw the two axis,
false
otherwise.public boolean getDrawTicks()
true
if the ticks will be drawn,
false
otherwise.getMajorXTickSpacing()
,
getMajorYTickSpacing()
,
getMinorXTickSpacing()
,
getMinorYTickSpacing()
public void setDrawTicks(boolean value)
value
- true
if the ticks should be drawn,
false
otherwise.public boolean getIsReceiver()
true
if this component will receive values from the
communicator;
false
otherwise.public void setIsReceiver(boolean value)
value
- true
if this component should receive values
from the communicator;
false
otherwise.public boolean getIsSender()
true
if this component will send values to the
communicator;
false
otherwise.public void setIsSender(boolean value)
value
- true
if this component should send values
to the communicator;
false
otherwise.public int getCapacity()
public void setCapacity(int value)
value
- the desired capacity of the curvespublic int getRefreshrate()
public void setRefreshrate(int value)
value
- the desired time between each refresh in millisecondspublic int[] getTags()
getColors()
public void setTags(int[] value)
value
- an integer array containing the tags for this componentpublic double getMajorXTickSpacing()
public void setMajorXTickSpacing(double value)
value
- the desired spacing between the larger lines on the x-axispublic double getMajorYTickSpacing()
public void setMajorYTickSpacing(double value)
value
- the desired spacing between the larger lines on the y-axispublic double getMinorXTickSpacing()
public void setMinorXTickSpacing(double value)
value
- the desired spacing between the smaller lines on the x-axispublic double getMinorYTickSpacing()
public void setMinorYTickSpacing(double value)
value
- the desired spacing between the smaller lines on the y-axispublic double getXRange()
public void setXRange(double value)
value
- the desired number of units on the x-axis over which this
plotter should plot valuespublic double getYOffset()
public void setYOffset(double value)
value
- the desired minimum value of the y-axis for this plotterpublic double getYRange()
public void setYRange(double value)
value
- the desired number of units on the y-axis over which this
plotter should plot valuespublic java.awt.Color[] getColors()
getTags()
public void setColors(java.awt.Color[] value)
value
- an array of Colors where value[0] will correspond
to the curve whose index is stored in tags[0],
value[1] to tags[1], and so on.setTags(int[])
public void addComponentListener(ComponentListener l)
l
- the ComponentListener to register.public void removeComponentListener(ComponentListener l)
l
- the ComponentListener to remove.public void registerCommunicator(AbstractCommunicator c, int ID)
run
method.c
- the communicator in questionID
- the ID number assigned to this component and is stored in
myID
run()
,
putValue(int, int, double, int)
,
putValue(double, int, double, int)
,
putValue(java.lang.String, int, double, int)
public void putValue(int value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void putValue(double value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void putValue(java.lang.String value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void drawCurves(java.awt.Graphics g)
drawAxis
and
drawTicks
. paint(Graphics g)
.g
- the graphics context of this plotter, typically obtained by
calling getGraphics()
getDrawAxis()
,
getDrawTicks()
,
paint(java.awt.Graphics)
public void paint(java.awt.Graphics g)
drawAxis
and
drawTicks
. g
- the graphics context of this plotter, typically obtained by calling
getGraphics()
getDrawAxis()
,
getDrawTicks()
public void update(java.awt.Graphics g)
drawAxis
and
drawTicks
. paint(Graphics g)
.g
- the graphics context of this plotter, typically obtained by
calling getGraphics()
getDrawAxis()
,
getDrawTicks()
,
paint(java.awt.Graphics)
public void requestValues()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |