public class WhiteboardShapePolygon extends WhiteboardShape implements WhiteboardObjectPolygon
NAME
Constructor and Description |
---|
WhiteboardShapePolygon(java.lang.String id,
int thickness,
java.awt.Color color,
java.util.List<WhiteboardPoint> points,
boolean fill)
WhiteboardShapePolygon constructor.
|
WhiteboardShapePolygon(java.lang.String id,
int t,
java.awt.Color c,
java.util.List<WhiteboardPoint> m_points,
boolean fill,
java.awt.geom.AffineTransform at)
WhiteboardShapePolygon 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.
|
java.util.List<WhiteboardPoint> |
getPoints()
Returns a list of all the WhiteboardPoint instances that this
WhiteboardObject is composed of.
|
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 WhiteboardPoints.
|
boolean |
isFill()
Returns the fill state of the WhiteboardObject.
|
void |
paintShape(java.awt.Graphics2D g,
java.awt.geom.AffineTransform t)
Code to paint the WhiteboardShapePolygon.
|
void |
setBackgroundColor(int backColor)
Specifies the background color for this object.
|
void |
setFill(boolean fill)
Sets the fill state of the WhiteboardObject.
|
void |
setPoints(java.util.List<WhiteboardPoint> points)
Sets the list of WhiteboardPoint instances that this
WhiteboardObject is composed of.
|
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 WhiteboardShapePolygon(java.lang.String id, int thickness, java.awt.Color color, java.util.List<WhiteboardPoint> points, boolean fill)
id
- String that uniquely identifies this WhiteboardObjectthickness
- number of pixels that this object (or its border)
should be thickcolor
- WhiteboardShapePolygon's color (or rather it's border)points
- list of WhiteboardPointfill
- True is filled, false is unfilledpublic WhiteboardShapePolygon(java.lang.String id, int t, java.awt.Color c, java.util.List<WhiteboardPoint> m_points, boolean fill, java.awt.geom.AffineTransform at)
id
- String that uniquely identifies this WhiteboardObjectt
- number of pixels that this object (or its border)
should be thickc
- WhiteboardShapePolygon's color (or rather it's border)m_points
- list of WhiteboardPointfill
- True is filled, false is unfilledat
- 2D affine transformationpublic boolean isFill()
isFill
in interface WhiteboardObjectPolygon
public void setFill(boolean fill)
setFill
in interface WhiteboardObjectPolygon
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 transformpublic java.util.List<WhiteboardPoint> getSelectionPoints()
getSelectionPoints
in class WhiteboardShape
public boolean contains(java.awt.geom.Point2D p)
contains
in class WhiteboardShape
p
- coord pointpublic java.util.List<WhiteboardPoint> getPoints()
getPoints
in interface WhiteboardObjectPolygon
public void setPoints(java.util.List<WhiteboardPoint> points)
setPoints
in interface WhiteboardObjectPolygon
points
- the list of WhiteboardPoint instances that this
WhiteboardObject is composed of.public void translate(double deltaX, double deltaY)
translate
in class WhiteboardShape
deltaX
- x coorddeltaY
- y coordpublic void translateSelectedPoint(double deltaX, double deltaY)
translateSelectedPoint
in class WhiteboardShape
deltaX
- x coorddeltaY
- y coordpublic WhiteboardPoint getSelectionPoint(java.awt.geom.Point2D p)
getSelectionPoint
in class WhiteboardShape
p
- pointpublic void setBackgroundColor(int backColor)
setBackgroundColor
in interface WhiteboardObjectPolygon
backColor
- the color that we'd like to set for the background of this
WhiteboardObject (using standard RGB encoding).public int getBackgroundColor()
getBackgroundColor
in interface WhiteboardObjectPolygon
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.