Class Circle

Class Circle

java.lang.Object
   |
   +----ObjBaseClass
           |
           +----Circle

public class Circle
extends ObjBaseClass
implements DrawObject, Cloneable

Variable Index

 o baseColors
 o cx
 o cy
 o height
 o obj_id
 o old_height
 o old_width
 o old_x1
 o old_y1
 o r
 o width
 o x1
 o y1

Constructor Index

 o Circle(SketchArea)
constructor
 o Circle(SketchArea, int)
Constructor

Method Index

 o assemble(int)
assembles the Circle object's parameters based on application-specific format before calling superclass's BaseClassAssemble for assembling this resulting packet with the RTP header.
 o clean(Graphics)
the real function to clean up the object on the whiteboard
 o clear(Graphics)
clear the object on the display
 o clone()
clones a circle object by making an exact copy of this circle object with values equal to the original values, except that the starting and ending points of the newly cloned circle are translated by a value of TRANSLATE_X and TRANSLATE_Y defined in the ObjBaseClass.java.
 o draw(int, int, int, int, int, int)
function called to draw object passed from network
 o erase(Graphics, boolean)
function to erase the object while selected
 o getObjID()
 o getType()
get type of the object
 o mouseDown(int, int)
member function to be called when mouse down action
 o mouseDrag(int, int)
puclic member function called when mouse drag
 o mouseUp(int, int)
public member function called when mouse up event
 o moveUP(Graphics, int, int)
mouse up event handler while moving the object
 o moving(Graphics, int, int)
move current object on the whetboard
 o paint(Graphics)
draw the object
 o processInData(byte[])
retrieves Circle object's parameters from the received packet and display the circle on the drawing canvas of the whiteboard.
 o send()
sends this circle object to the multicast network
 o setPenColor(Graphics, int)
specify the color of the object

Variables

 o x1
  public int x1
 o y1
  public int y1
 o r
  public int r
 o cx
  public int cx
 o cy
  public int cy
 o old_x1
  public int old_x1
 o old_y1
  public int old_y1
 o width
  public int width
 o height
  public int height
 o old_width
  public int old_width
 o old_height
  public int old_height
 o baseColors
  public Color baseColors[]
 o obj_id
  public int obj_id

Constructors

 o Circle
  public Circle(SketchArea parent,
                int c)
Constructor
Parameters:
parent - referent to parent class SketchArea
c - color code
Returns:
none
 o Circle
  public Circle(SketchArea parent)
constructor
Parameters:
parent - reference to parent SketchArea
Returns:
none

Methods

 o clone
  public Object clone()
clones a circle object by making an exact copy of this circle object with values equal to the original values, except that the starting and ending points of the newly cloned circle are translated by a value of TRANSLATE_X and TRANSLATE_Y defined in the ObjBaseClass.java.
Returns:
a cloned object.
Overrides:
clone in class Object
 o mouseDown
  public boolean mouseDown(int x,
                           int y)
member function to be called when mouse down action
Parameters:
x - x value
y - y value
Returns:
true
 o mouseUp
  public boolean mouseUp(int x,
                         int y)
public member function called when mouse up event
Parameters:
x - x value
y - y value
Returns:
true
 o send
  public void send()
sends this circle object to the multicast network
 o mouseDrag
  public boolean mouseDrag(int x,
                           int y)
puclic member function called when mouse drag
Parameters:
x - x value
y - y value
Returns:
true
 o moving
  public void moving(Graphics g,
                     int x,
                     int y)
move current object on the whetboard
Parameters:
g - graphics context
x - x value
y - y value
Returns:
void
 o moveUP
  public void moveUP(Graphics g,
                     int x,
                     int y)
mouse up event handler while moving the object
Parameters:
g - graphics context
x - x value
y - y value
Returns:
void
 o paint
  public void paint(Graphics g)
draw the object
Parameters:
g - graphics context
Returns:
void
 o clear
  public void clear(Graphics g)
clear the object on the display
Parameters:
g - graphics context
Returns:
void
 o clean
  public void clean(Graphics g)
the real function to clean up the object on the whiteboard
Parameters:
g - graphics context
Returns:
void
 o erase
  public void erase(Graphics g,
                    boolean send_del_req)
function to erase the object while selected
Parameters:
g - graphics context
Returns:
void
 o setPenColor
  public void setPenColor(Graphics g,
                          int c)
specify the color of the object
Parameters:
g - graphics context
c - color code
Returns:
void
 o getType
  public int getType()
get type of the object
Returns:
type
 o getObjID
  public int getObjID()
 o assemble
  public void assemble(int ObjectType)
assembles the Circle object's parameters based on application-specific format before calling superclass's BaseClassAssemble for assembling this resulting packet with the RTP header. This function is called by mouseUp Event.
Returns:
void
 o processInData
  public void processInData(byte buf[])
retrieves Circle object's parameters from the received packet and display the circle on the drawing canvas of the whiteboard.
Parameters:
buf - buffer that holds parameters in the form of byte array.
Returns:
void
 o draw
  public void draw(int xx1,
                   int yy1,
                   int xx2,
                   int yy2,
                   int col,
                   int obj_id_recvd)
function called to draw object passed from network
Parameters:
xx1 - start point
yy1 - start point
xx2 - end point
yy2 - end point
Returns:
void