|
|||||||||
| 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
|
+--com.ibm.tspaces.examples.whiteboard.WhiteboardPanel
The panel of the whiteboard. This handles the panel where the lines and points are drawn. All of the TSpaces handling is done inside this object. It implements the Tuplespace Callback interface which gets control everytime a matching request is issued to TupleSpace.
| Field Summary | |
protected static java.awt.Color |
BACKGROUND_COLOR
|
protected boolean |
EraseFlag
|
protected boolean |
Failed
|
protected java.lang.String |
Host
This is the Host where the TupleSpace Server is running |
static int |
LINES
|
protected boolean |
NotActive
|
static int |
POINTS
|
protected int |
Port
This is the port number for the TupleSpace server. |
protected TupleSpace |
TSServer
This holds a reference to the current TupleSpace. |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
WhiteboardPanel()
The constructor |
|
| Method Summary | |
boolean |
call(java.lang.String eventName_,
java.lang.String tsName_,
int sequenceNumber_,
SuperTuple tuple_,
boolean isException_)
Process the callback from the server that notifies us when anyone (including ourselfes) writes to the Whiteboard TupleSpace. |
void |
erase()
Erase the lines that the User has drawn since last Publish. |
void |
eraseAll()
Global Erase of the whiteboard. |
void |
exitcmd()
|
void |
init(Whiteboard caller)
TupleSpace Initiallization routine. |
void |
mouseClicked(java.awt.event.MouseEvent e)
The mouse button was clicked. |
void |
mouseDragged(java.awt.event.MouseEvent e)
The mouse was dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
The mouse entered this panel. |
void |
mouseExited(java.awt.event.MouseEvent e)
The mouse left this panel. |
void |
mouseMoved(java.awt.event.MouseEvent e)
The mouse was moved. |
void |
mousePressed(java.awt.event.MouseEvent e)
The mouse button was pressed. |
void |
mouseReleased(java.awt.event.MouseEvent e)
The mouse button was released. |
void |
paint(java.awt.Graphics g)
Paints the panel. |
void |
paint(java.awt.Graphics g,
java.util.Vector lines,
java.util.Vector colors)
Paints the panel based on the vectos of lines and colors. |
void |
publish()
Publish the current content to tuplespace. |
void |
removeAll()
This is called our parent (Whiteboard) gets a applet destroy() event. |
void |
setDrawMode(int mode)
Set the draw mode. |
void |
term()
This is called when the windowClosing event arrives. |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
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,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
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,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int LINES
public static final int POINTS
protected static java.awt.Color BACKGROUND_COLOR
protected TupleSpace TSServer
protected java.lang.String Host
protected int Port
protected boolean EraseFlag
protected boolean NotActive
protected boolean Failed
| Constructor Detail |
public WhiteboardPanel()
| Method Detail |
public void init(Whiteboard caller)
TupleSpace,
Tuple,
Fieldpublic void term()
TupleSpace.cleanup()public void removeAll()
public void publish()
public void erase()
public void eraseAll()
public void exitcmd()
public boolean call(java.lang.String eventName_,
java.lang.String tsName_,
int sequenceNumber_,
SuperTuple tuple_,
boolean isException_)
eventName_ - the name of the event command that caused this call, that is the
name of the client side command of the thread that registered this call, e.g., in the
case of a read, this would be TupleSpace.READ, **not** TupleSpace.WRITE which is the
corresponding command that caused the actaul event.tsName_ - the name of the tuple space this command was executed on.sequenceNumber_ - the sequenceNumber for this event/commandtuple_ - the returned tuple or a Tuple with an exception insideisException_ - was the command processed normaly or was there an exceptionpublic void paint(java.awt.Graphics g)
g - - the graphics context
public void paint(java.awt.Graphics g,
java.util.Vector lines,
java.util.Vector colors)
g - - the graphics contextlines - - A vector of Rectangle objectscolors - - A vector of color objects.public void setDrawMode(int mode)
mode - - the draw modepublic void mouseDragged(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
e - - the mouse eventpublic void mouseClicked(java.awt.event.MouseEvent e)
e - - the mouse event
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||