Class prominence.chat.Whiteboard
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class prominence.chat.Whiteboard
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----prominence.chat.Whiteboard
  -  public class Whiteboard
  -  extends Canvas
  -  implements Client
A whiteboard tool; this is a Canvas that implements
the Client interface, and is added to the Chat
Frame. Drawings from other clients are displayed on the
Canvas.
    -  See Also:
    
-  Client, Chat
   
  -   o o
-  The outbound message stream.
  
-   oX oX
-  The x coordinate of the last mouse action.
  
-   oY oY
-  The y coordinate of the last mouse action.
   
  -   Whiteboard() Whiteboard()
-  Creates a new Whiteboard with an off-white background.
   
  -   disconnected() disconnected()
-  Disconnects this tool; in this case, sets the drawing Color
to red.
  
-   mouseDown(Event, int, int) mouseDown(Event, int, int)
-  The mouse button has been pressed; transmit the coordinates.
  
-   mouseDrag(Event, int, int) mouseDrag(Event, int, int)
-  The mouse has been dragged; draw a segment to the screen and
transmit the coordinates.
  
-   mouseUp(Event, int, int) mouseUp(Event, int, int)
-  The mouse button has been released; draw the last segment to
the screen, transmit the coordinates and send the complete
message.
  
-   preferredSize() preferredSize()
-  Returns the preferred size of this component.
  
-   receive(DataInputStream) receive(DataInputStream)
-  Receives a message from a peer Whiteboard.
  
-   scribble(int, int) scribble(int, int)
-  Draws a line segment to the screen between oX, oY
and the new coordinates.
  
-   setMessageOutput(MessageOutput) setMessageOutput(MessageOutput)
-  Assigns a message output stream over which this tool
can communicate.
  
-   transmit(int, int) transmit(int, int)
-  Transmits new coordinates to the message stream, and assigns new values
to oX and oY.
   
 o
o
  protected MessageOutput o
  -  The outbound message stream.
 oX
oX
  protected int oX
  -  The x coordinate of the last mouse action.
 oY
oY
  protected int oY
  -  The y coordinate of the last mouse action.
   
 Whiteboard
Whiteboard
  public Whiteboard()
  -  Creates a new Whiteboard with an off-white background.
   
 setMessageOutput
setMessageOutput
  public void setMessageOutput(MessageOutput o)
  -  Assigns a message output stream over which this tool
can communicate. This method is called by the GenericClient
class with a message stream that is multiplexed to peer
Whiteboard's of other clients.
  
    -  Parameters:
    
-  o - The message output stream
    
-  See Also:
    
-  GenericClient
  
 
 receive
receive
  public void receive(DataInputStream dI)
  -  Receives a message from a peer Whiteboard.
  
    -  Parameters:
    
-  dI - A stream from which the message can be read.
    
-  See Also:
    
-  receive
  
 
 disconnected
disconnected
  public void disconnected()
  -  Disconnects this tool; in this case, sets the drawing Color
to red.
 preferredSize
preferredSize
  public Dimension preferredSize()
  -  Returns the preferred size of this component.
  
    -  Overrides:
    
-  preferredSize in class Component
  
 
 mouseDown
mouseDown
  public boolean mouseDown(Event e,
                           int x,
                           int y)
  -  The mouse button has been pressed; transmit the coordinates.
  
    -  Overrides:
    
-  mouseDown in class Component
    
-  See Also:
    
-  transmit
  
 
 mouseDrag
mouseDrag
  public boolean mouseDrag(Event e,
                           int x,
                           int y)
  -  The mouse has been dragged; draw a segment to the screen and
transmit the coordinates.
  
    -  Overrides:
    
-  mouseDrag in class Component
    
-  See Also:
    
-  scribble, transmit
  
 
 mouseUp
mouseUp
  public boolean mouseUp(Event e,
                         int x,
                         int y)
  -  The mouse button has been released; draw the last segment to
the screen, transmit the coordinates and send the complete
message.
  
    -  Overrides:
    
-  mouseUp in class Component
    
-  See Also:
    
-  scribble, transmit
  
 
 transmit
transmit
  protected void transmit(int x,
                          int y)
  -  Transmits new coordinates to the message stream, and assigns new values
to oX and oY.
  
    -  Parameters:
    
-  x - The x mouse coordinate
    -  y - The y mouse coordinate
  
 
 scribble
scribble
  protected void scribble(int x,
                          int y)
  -  Draws a line segment to the screen between oX, oY
and the new coordinates.
  
    -  Parameters:
    
-  x - The x mouse coodinate
    -  y - the y mouse coordinate
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index