public class WhiteboardShapeRect extends WhiteboardShape implements WhiteboardObjectRect
NAME
Constructor and Description |
---|
WhiteboardShapeRect(java.lang.String id,
int thickness,
java.awt.Color color,
WhiteboardPoint point,
double width,
double height,
boolean fill)
WhiteboardShapeRect constructor.
|
WhiteboardShapeRect(java.lang.String id,
int thickness,
java.awt.Color color,
WhiteboardPoint point,
double width,
double height,
boolean fill,
java.awt.geom.AffineTransform transform)
WhiteboardShapeRect constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.awt.geom.Point2D p)
Tests if the shape contains a point.
|
int |
getBackgroundColor()
Returns an integer representing the background color of this object.
|
double |
getHeight()
Gets the height (in pixels) of the WhiteboardShapeRect.
|
WhiteboardPoint |
getSelectionPoint(java.awt.geom.Point2D p)
Tests if a point p is over a selection point.
|
java.util.List<WhiteboardPoint> |
getSelectionPoints()
Returns the list of selected points.
|
WhiteboardPoint |
getWhiteboardPoint()
Returns the coordinates of this whiteboard object.
|
double |
getWidth()
Gets the width (in pixels) of the WhiteboardObject.
|
boolean |
isFill()
Returns the fill state of the WhiteboardShapeRect.
|
void |
paintShape(java.awt.Graphics2D g,
java.awt.geom.AffineTransform t)
Code to paint the WhiteboardShapeRect.
|
void |
setBackgroundColor(int color)
Specifies the background color for this object.
|
void |
setFill(boolean fill)
Sets the fill state of the WhiteboardShapeRect.
|
void |
setHeight(double height)
Sets the width (in pixels) of the WhiteboardShapeRect.
|
void |
setWhiteboardPoint(WhiteboardPoint whiteboardPoint)
Sets the coordinates of this whiteboard object.
|
void |
setWidth(double width)
Sets the width (in pixels) of the WhiteboardObject.
|
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 WhiteboardShapeRect(java.lang.String id, int thickness, java.awt.Color color, WhiteboardPoint point, double width, double height, boolean fill)
id
- String that uniquely identifies this WhiteboardObjectthickness
- number of pixels that this object (or its border)
should be thickcolor
- WhiteboardShapeRect's color (or rather it's border)point
- coordinates of this object.width
- width value of this object (in pixel)height
- height value of this object (in pixel)fill
- True is filled, false is unfilledpublic WhiteboardShapeRect(java.lang.String id, int thickness, java.awt.Color color, WhiteboardPoint point, double width, double height, boolean fill, java.awt.geom.AffineTransform transform)
id
- String that uniquely identifies this WhiteboardShapeRectthickness
- number of pixels that this object (or its border)
should be thickcolor
- WhiteboardShapeRect's color (or rather it's border)point
- coordinates of this object.width
- width value of this object (in pixel)height
- height value of this object (in pixel)fill
- True is filled, false is unfilledtransform
- 2D affine transformationpublic double getHeight()
getHeight
in interface WhiteboardObjectRect
public void setHeight(double height)
setHeight
in interface WhiteboardObjectRect
height
- The new height.public boolean isFill()
isFill
in interface WhiteboardObjectRect
public void setFill(boolean fill)
setFill
in interface WhiteboardObjectRect
fill
- The new fill state.public void paintShape(java.awt.Graphics2D g, java.awt.geom.AffineTransform t)
paintShape
in class WhiteboardShape
g
- graphics contextt
- 2D affine transformationpublic java.util.List<WhiteboardPoint> getSelectionPoints()
getSelectionPoints
in class WhiteboardShape
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 WhiteboardObjectRect
public void setWhiteboardPoint(WhiteboardPoint whiteboardPoint)
setWhiteboardPoint
in interface WhiteboardObjectRect
whiteboardPoint
- the coordinates of this object.public double getWidth()
getWidth
in interface WhiteboardObjectRect
public void setWidth(double width)
setWidth
in interface WhiteboardObjectRect
width
- The new width.public void setBackgroundColor(int color)
setBackgroundColor
in interface WhiteboardObjectRect
color
- the color that we'd like to set for the background of this
WhiteboardObject (using standard RGB encoding).public int getBackgroundColor()
getBackgroundColor
in interface WhiteboardObjectRect
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.