public abstract class WhiteboardShape extends java.lang.Object implements WhiteboardObject
NAME
Constructor and Description |
---|
WhiteboardShape(java.lang.String id)
WhiteboardShape constructor
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
contains(java.awt.geom.Point2D p)
method to test if the shape contains a point
|
void |
drawSelectedPoint(java.awt.Graphics g,
java.awt.geom.AffineTransform t,
WhiteboardPoint point,
java.awt.Color color)
Draw a point on the shape
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other WhiteboardShape is "equal to" this one.
|
int |
getColor()
Returns an integer representing the color of this object.
|
java.lang.String |
getID()
Returns a String uniquely identifying this WhiteboardShape.
|
WhiteboardPoint |
getModifyPoint()
The last selected for modification point.
|
float |
getOpacity()
Returns WhiteboardShape's opacity
|
abstract WhiteboardPoint |
getSelectionPoint(java.awt.geom.Point2D p)
Returns a selection point contained in this WhiteboardShape,
which corresponds to the given point (i.e.
|
abstract java.util.List<WhiteboardPoint> |
getSelectionPoints()
Returns the list of selected points
|
int |
getThickness()
Returns an integer indicating the thickness (represented as number of
pixels) of this whiteboard shape (or its border).
|
boolean |
isSelected()
Returns true if the Shape is selected
|
void |
paint(java.awt.Graphics g,
java.awt.geom.AffineTransform t)
Code when shape is preselected
|
abstract void |
paintShape(java.awt.Graphics2D g,
java.awt.geom.AffineTransform t)
Code to paint the specific shape
|
void |
preselect(java.awt.Graphics g,
java.awt.geom.AffineTransform t)
Draws selection points when a shape is preselected.
|
void |
select(java.awt.Graphics g,
java.awt.geom.AffineTransform t)
Code when shape is selected
|
void |
setColor(java.awt.Color color)
Sets color of the WhiteboardShape (or rather it's border)
|
void |
setColor(int color)
Sets the color of this whiteboard shape (or rather it's border).
|
void |
setID(java.lang.String id)
Sets a new identification for this WhiteboardShape
|
void |
setModifyPoint(WhiteboardPoint point)
Sets the point from which a modification could start.
|
void |
setOpacity(float opacity)
Sets WhiteboardShape's opacity
|
void |
setSelected(boolean selected)
Sets selected the shape
|
void |
setThickness(int thickness)
Sets the thickness (in pixels) of this whiteboard shape.
|
abstract void |
translate(double deltaX,
double deltaY)
Translates the shape
|
abstract void |
translateSelectedPoint(double deltaX,
double deltaY)
Translates the shape point at p
|
public WhiteboardShape(java.lang.String id)
id
- String that uniquely identifies this WhiteboardObject.public void paint(java.awt.Graphics g, java.awt.geom.AffineTransform t)
g
- graphics contextt
- 2D affine transformpublic abstract void paintShape(java.awt.Graphics2D g, java.awt.geom.AffineTransform t)
g
- graphics contextt
- 2D affine transformpublic abstract boolean contains(java.awt.geom.Point2D p)
p
- coord pointpublic void setColor(java.awt.Color color)
color
- color shapepublic float getOpacity()
public void setOpacity(float opacity)
opacity
- opacity of the shapepublic boolean isSelected()
public void setSelected(boolean selected)
selected
- true for select the shapepublic void setModifyPoint(WhiteboardPoint point)
point
- the point from which a modification could start.public WhiteboardPoint getModifyPoint()
public void select(java.awt.Graphics g, java.awt.geom.AffineTransform t)
g
- graphics contextt
- 2D affine transformpublic void preselect(java.awt.Graphics g, java.awt.geom.AffineTransform t)
g
- graphics contextt
- 2D affine transformpublic void drawSelectedPoint(java.awt.Graphics g, java.awt.geom.AffineTransform t, WhiteboardPoint point, java.awt.Color color)
g
- graphics contextt
- 2D affine transformpoint
- point coord for the 2D affine transformcolor
- color for the pointpublic abstract java.util.List<WhiteboardPoint> getSelectionPoints()
public abstract void translate(double deltaX, double deltaY)
deltaX
- x coorddeltaY
- y coordpublic abstract void translateSelectedPoint(double deltaX, double deltaY)
deltaX
- x coorddeltaY
- y coordpublic java.lang.String getID()
getID
in interface WhiteboardObject
public void setID(java.lang.String id)
id
- a String that uniquely identifies this WhiteboardShape.public int getThickness()
getThickness
in interface WhiteboardObject
public void setThickness(int thickness)
setThickness
in interface WhiteboardObject
thickness
- the number of pixels that this object (or its border)
should be thick.public int getColor()
getColor
in interface WhiteboardObject
public void setColor(int color)
setColor
in interface WhiteboardObject
color
- the color that we'd like to set on this object (using
standard RGB encoding).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public abstract WhiteboardPoint getSelectionPoint(java.awt.geom.Point2D p)
p
- point to check
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.