Class Text
Class Text
java.lang.Object
|
+----ObjBaseClass
|
+----Text
- public class Text
- extends ObjBaseClass
- implements DrawObject, Cloneable
-
baseColors
-
-
color
-
-
dist_x
-
-
dist_y
-
-
height
-
-
obj_id
-
-
old_x1
-
-
old_y1
-
-
text
-
-
type
-
-
width
-
-
x1
-
-
y1
-
-
Text(SketchArea)
- constructor
-
Text(SketchArea, String, Dimension)
- constructor
-
Text(SketchArea, String, int, FontMetrics)
- constructor
-
assemble(int)
- assembles the Line object's parameters based on application-specific
format before calling superclass's BaseClassAssemble for assembling
this resulting packet with the RTP header.
-
clean(Graphics)
-
-
clear(Graphics)
- clear up object on the whiteboard
-
clone()
- clones a text object by making an exact copy of this text object
with values equal to the original values, except that the starting
and ending points of the newly cloned text are translated by a value of
TRANSLATE_X and TRANSLATE_Y defined in the ObjBaseClass.java.
-
draw(int, int, int, int, int, int)
- draw object which is passed from network
-
erase(Graphics, boolean)
-
-
getObjID()
-
-
getStringDim(String, FontMetrics)
- Gets dimension of the string entered onto the textfield of the
whiteboard canvas.
-
getType()
- return type of the object
-
mouseDown(int, int)
- event handler for mouse down while drawing
-
mouseDrag(int, int)
- event handler for mouse drag when drawing the objects.
-
mouseUp(int, int)
- event handler for mouse up when drawing objects.
-
moveUP(Graphics, int, int)
- set parameter after locating the last point
-
moving(Graphics, int, int)
- function called when moving the object
-
paint(Graphics)
- draw the object by pen color
-
processInData(byte[])
- retrieves Line object's parameters from the received packet and
display the line on the drawing canvas of the whiteboard.
-
recvd_moved_obj(Graphics, int, int, int, int)
-
-
send()
-
-
setBaseDist(Graphics, int, int)
-
-
setBasePoint(int, int)
-
-
setPenColor(Graphics, int)
- set drawing color
x1
public int x1
y1
public int y1
width
public int width
height
public int height
old_x1
public int old_x1
old_y1
public int old_y1
dist_x
public int dist_x
dist_y
public int dist_y
text
public String text
type
public int type
color
public int color
baseColors
public Color baseColors[]
obj_id
public int obj_id
Text
public Text(SketchArea parent,
String text,
int c,
FontMetrics fm)
- constructor
- Parameters:
- parent - SketchArea object reference
- c - color type
- Returns:
- none
Text
public Text(SketchArea parent,
String text,
Dimension dim)
- constructor
- Parameters:
- parent - SketchArea reference
- Returns:
- none
Text
public Text(SketchArea parent)
- constructor
- Parameters:
- parent - SketchArea reference
- Returns:
- none
getStringDim
public Dimension getStringDim(String text,
FontMetrics fm)
- Gets dimension of the string entered onto the textfield of the
whiteboard canvas.
- Parameters:
- text - text entered
- Returns:
- s dimension of the text entered
clone
public Object clone()
- clones a text object by making an exact copy of this text object
with values equal to the original values, except that the starting
and ending points of the newly cloned text are translated by a value of
TRANSLATE_X and TRANSLATE_Y defined in the ObjBaseClass.java.
- Returns:
- a cloned text object.
- Overrides:
- clone in class Object
mouseDown
public boolean mouseDown(int x,
int y)
- event handler for mouse down while drawing
- Parameters:
- x - x value
- y - y value
- Returns:
- true
mouseUp
public boolean mouseUp(int x,
int y)
- event handler for mouse up when drawing objects. This event is
not relevant to this class of text string objects. The event is
not implemented though it's being declared due to compliance to
the interface DrawObject.
- Parameters:
- x - x value
- y - y value
- Returns:
- true
send
public void send()
mouseDrag
public boolean mouseDrag(int x,
int y)
- event handler for mouse drag when drawing the objects. Not
relevant and hence not implemented though declared due to
compliance to the interface DrawObject.
- Parameters:
- x - x value
- y - y value
- Returns:
- true
moving
public void moving(Graphics g,
int x,
int y)
- function called when moving the object
- Parameters:
- x - x value
- y - y value
- Returns:
- void
setBasePoint
public void setBasePoint(int x,
int y)
setBaseDist
public void setBaseDist(Graphics g,
int x,
int y)
recvd_moved_obj
public void recvd_moved_obj(Graphics g,
int recvd_x1,
int recvd_y1,
int recvd_x2,
int recvd_y2)
moveUP
public void moveUP(Graphics g,
int x,
int y)
- set parameter after locating the last point
- Parameters:
- g - graphics context
- x - x value
- Returns:
- y y value
setPenColor
public void setPenColor(Graphics g,
int c)
- set drawing color
- Parameters:
- g - graphics context
- c - color
- Returns:
- void
draw
public void draw(int xx1,
int yy1,
int xx2,
int yy2,
int col,
int obj_id_recvd)
- draw object which is passed from network
- Parameters:
- xx1 - start point
- yy1 - start point
- xx2 - end point
- yy2 - end point
- Returns:
- void
paint
public void paint(Graphics g)
- draw the object by pen color
- Parameters:
- g - graphics context
- Returns:
- void
clear
public void clear(Graphics g)
- clear up object on the whiteboard
- Parameters:
- g - Graphics context
- Returns:
- void
clean
public void clean(Graphics g)
erase
public void erase(Graphics g,
boolean send_del_req)
assemble
public void assemble(int ObjectType)
- assembles the Line 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 Line object's parameters from the received packet and
display the line on the drawing canvas of the whiteboard.
- Parameters:
- buf - buffer that holds parameters in the form of byte array.
- Returns:
- void
getType
public int getType()
- return type of the object
- Returns:
- type
getObjID
public int getObjID()