Class Circle
Class Circle
java.lang.Object
|
+----ObjBaseClass
|
+----Circle
- public class Circle
- extends ObjBaseClass
- implements DrawObject, Cloneable
-
baseColors
-
-
cx
-
-
cy
-
-
height
-
-
obj_id
-
-
old_height
-
-
old_width
-
-
old_x1
-
-
old_y1
-
-
r
-
-
width
-
-
x1
-
-
y1
-
-
Circle(SketchArea)
- constructor
-
Circle(SketchArea, int)
- Constructor
-
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.
-
clean(Graphics)
- the real function to clean up the object on the whiteboard
-
clear(Graphics)
- clear the object on the display
-
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.
-
draw(int, int, int, int, int, int)
- function called to draw object passed from network
-
erase(Graphics, boolean)
- function to erase the object while selected
-
getObjID()
-
-
getType()
- get type of the object
-
mouseDown(int, int)
- member function to be called when mouse down action
-
mouseDrag(int, int)
- puclic member function called when mouse drag
-
mouseUp(int, int)
- public member function called when mouse up event
-
moveUP(Graphics, int, int)
- mouse up event handler while moving the object
-
moving(Graphics, int, int)
- move current object on the whetboard
-
paint(Graphics)
- draw the object
-
processInData(byte[])
- retrieves Circle object's parameters from the received packet and
display the circle on the drawing canvas of the whiteboard.
-
send()
- sends this circle object to the multicast network
-
setPenColor(Graphics, int)
- specify the color of the object
x1
public int x1
y1
public int y1
r
public int r
cx
public int cx
cy
public int cy
old_x1
public int old_x1
old_y1
public int old_y1
width
public int width
height
public int height
old_width
public int old_width
old_height
public int old_height
baseColors
public Color baseColors[]
obj_id
public int obj_id
Circle
public Circle(SketchArea parent,
int c)
- Constructor
- Parameters:
- parent - referent to parent class SketchArea
- c - color code
- Returns:
- none
Circle
public Circle(SketchArea parent)
- constructor
- Parameters:
- parent - reference to parent SketchArea
- Returns:
- none
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
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
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
send
public void send()
- sends this circle object to the multicast network
mouseDrag
public boolean mouseDrag(int x,
int y)
- puclic member function called when mouse drag
- Parameters:
- x - x value
- y - y value
- Returns:
- true
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
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
paint
public void paint(Graphics g)
- draw the object
- Parameters:
- g - graphics context
- Returns:
- void
clear
public void clear(Graphics g)
- clear the object on the display
- Parameters:
- g - graphics context
- Returns:
- void
clean
public void clean(Graphics g)
- the real function to clean up the object on the whiteboard
- Parameters:
- g - graphics context
- Returns:
- void
erase
public void erase(Graphics g,
boolean send_del_req)
- function to erase the object while selected
- Parameters:
- g - graphics context
- Returns:
- void
setPenColor
public void setPenColor(Graphics g,
int c)
- specify the color of the object
- Parameters:
- g - graphics context
- c - color code
- Returns:
- void
getType
public int getType()
- get type of the object
- Returns:
- type
getObjID
public int getObjID()
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
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
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