public class WhiteboardShapeText extends WhiteboardShape implements WhiteboardObjectText
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FONT_SIZE
A type string constant indicating the default font size
of the text in this object.
|
NAME
Constructor and Description |
---|
WhiteboardShapeText(java.lang.String id,
java.awt.Color color,
WhiteboardPoint point,
int size,
java.lang.String text)
WhiteboardShapeText constructor.
|
WhiteboardShapeText(java.lang.String id,
java.awt.Color color,
WhiteboardPoint point,
int size,
java.lang.String text,
java.awt.geom.AffineTransform v2w)
WhiteboardShapeText constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.awt.geom.Point2D p)
Tests if the shape contains a point.
|
java.lang.String |
getFontName()
Returns the WhiteboardObjectText's font name.
|
int |
getFontSize()
Returns the WhiteboardObjectText's font size.
|
WhiteboardPoint |
getSelectionPoint(java.awt.geom.Point2D p)
Tests if a point p is over a selection point.
|
java.util.List<WhiteboardPoint> |
getSelectionPoints()
Gets the list of selected points.
|
java.lang.String |
getText()
Returns the WhiteboardObjectText's text.
|
WhiteboardPoint |
getWhiteboardPoint()
Returns the coordinates of this whiteboard object.
|
void |
paintShape(java.awt.Graphics2D g,
java.awt.geom.AffineTransform t)
Code to paint the WhiteboardShapeText.
|
void |
setFontName(java.lang.String fontName)
Sets the WhiteboardObjectText's font name.
|
void |
setFontSize(int fontSize)
Sets the WhiteboardObjectText's font size.
|
void |
setText(java.lang.String text)
Sets the WhiteboardObjectText's text.
|
void |
setWhiteboardPoint(WhiteboardPoint whiteboardPoint)
Sets the coordinates of this whiteboard object.
|
void |
translate(double deltaX,
double deltaY)
Translates the shape.
|
void |
translateSelectedPoint(double deltaX,
double deltaY)
Translates a point from the shape.
|
drawSelectedPoint, equals, getColor, getID, getModifyPoint, getOpacity, getThickness, isSelected, paint, preselect, select, setColor, setColor, setID, setModifyPoint, setOpacity, setSelected, setThickness
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColor, getID, getThickness, setColor, setThickness
public static int DEFAULT_FONT_SIZE
public WhiteboardShapeText(java.lang.String id, java.awt.Color color, WhiteboardPoint point, int size, java.lang.String text)
id
- String that uniquely identifies this WhiteboardObjectcolor
- font's colorpoint
- coordinates of this objectsize
- font sizetext
- WhiteboardObjectText's textpublic WhiteboardShapeText(java.lang.String id, java.awt.Color color, WhiteboardPoint point, int size, java.lang.String text, java.awt.geom.AffineTransform v2w)
id
- String that uniquely identifies this WhiteboardObjectcolor
- font's colorpoint
- coordinates of this object.size
- font sizetext
- WhiteboardObjectText's textv2w
- 2D affine transformationpublic void paintShape(java.awt.Graphics2D g, java.awt.geom.AffineTransform t)
paintShape
in class WhiteboardShape
g
- graphics contextt
- 2D affine transformpublic java.util.List<WhiteboardPoint> getSelectionPoints()
getSelectionPoints
in class WhiteboardShape
public java.lang.String getText()
getText
in interface WhiteboardObjectText
public void setText(java.lang.String text)
setText
in interface WhiteboardObjectText
text
- the new WhiteboardObjectText's text.public boolean contains(java.awt.geom.Point2D p)
contains
in class WhiteboardShape
p
- coord pointpublic void translate(double deltaX, double deltaY)
translate
in class WhiteboardShape
deltaX
- x coordinatedeltaY
- y coordinatepublic void translateSelectedPoint(double deltaX, double deltaY)
translateSelectedPoint
in class WhiteboardShape
deltaX
- x coordinatedeltaY
- y coordinatepublic WhiteboardPoint getSelectionPoint(java.awt.geom.Point2D p)
getSelectionPoint
in class WhiteboardShape
p
- pointpublic WhiteboardPoint getWhiteboardPoint()
getWhiteboardPoint
in interface WhiteboardObjectText
public void setWhiteboardPoint(WhiteboardPoint whiteboardPoint)
setWhiteboardPoint
in interface WhiteboardObjectText
whiteboardPoint
- the coordinates of this object.public int getFontSize()
getFontSize
in interface WhiteboardObjectText
public void setFontSize(int fontSize)
setFontSize
in interface WhiteboardObjectText
fontSize
- the new WhiteboardObjectText's font size.public java.lang.String getFontName()
getFontName
in interface WhiteboardObjectText
public void setFontName(java.lang.String fontName)
setFontName
in interface WhiteboardObjectText
fontName
- the new WhiteboardObjectText's font name.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.