Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes
Class WhiteboardShapePath

java.lang.Object
  extended by net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.WhiteboardShape
      extended by net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.WhiteboardShapePath
All Implemented Interfaces:
WhiteboardObject, WhiteboardObjectPath

public class WhiteboardShapePath
extends WhiteboardShape
implements WhiteboardObjectPath

A WhiteboardShapePath, in XML :

Author:
Julien Waechter

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.whiteboardobjects.WhiteboardObjectPath
NAME
 
Constructor Summary
WhiteboardShapePath(String id, int t, Color c, List<WhiteboardPoint> points)
          WhiteboardShapePath constructor.
WhiteboardShapePath(String id, int t, Color c, List<WhiteboardPoint> points, AffineTransform v2w)
          WhiteboardShapePath constructor.
 
Method Summary
 boolean contains(Point2D p)
          Tests if the shape contains a point.
 List<WhiteboardPoint> getPoints()
          Returns a list of all the WhiteboardPoint instances that this WhiteboardObject is composed of.
 WhiteboardPoint getSelectionPoint(Point2D p)
          Tests if a point p is over a selection point.
 List<WhiteboardPoint> getSelectionPoints()
          Returns the list of selected points.
 void paintShape(Graphics2D g, AffineTransform t)
          Code to paint the specific shape
 void setPoints(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.
 
Methods inherited from class net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.WhiteboardShape
drawSelectedPoint, equals, getColor, getID, getModifyPoint, getOpacity, getThickness, isSelected, paint, preselect, select, setColor, setColor, setID, setModifyPoint, setOpacity, setSelected, setThickness
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.whiteboardobjects.WhiteboardObject
getColor, getID, getThickness, setColor, setThickness
 

Constructor Detail

WhiteboardShapePath

public WhiteboardShapePath(String id,
                           int t,
                           Color c,
                           List<WhiteboardPoint> points)
WhiteboardShapePath constructor.

Parameters:
id - String that uniquely identifies this WhiteboardObject
t - number of pixels that this object (its border) should be thick.
c - WhiteboardShapePath's color (or rather it's border)
points - list of WhiteboardPoint.

WhiteboardShapePath

public WhiteboardShapePath(String id,
                           int t,
                           Color c,
                           List<WhiteboardPoint> points,
                           AffineTransform v2w)
WhiteboardShapePath constructor.

Parameters:
id - String that uniquely identifies this WhiteboardObject
t - number of pixels that this object (its border)
c - WhiteboardShapePath's color (it's border)
points - list of points
v2w - 2D affine transform
Method Detail

getPoints

public List<WhiteboardPoint> getPoints()
Returns a list of all the WhiteboardPoint instances that this WhiteboardObject is composed of.

Specified by:
getPoints in interface WhiteboardObjectPath
Returns:
the list of WhiteboardPoints composing this object.

getSelectionPoints

public List<WhiteboardPoint> getSelectionPoints()
Returns the list of selected points.

Specified by:
getSelectionPoints in class WhiteboardShape
Returns:
list of selected points

paintShape

public void paintShape(Graphics2D g,
                       AffineTransform t)
Code to paint the specific shape

Specified by:
paintShape in class WhiteboardShape
Parameters:
g - graphics context
t - 2D affine transform

contains

public boolean contains(Point2D p)
Tests if the shape contains a point.

Specified by:
contains in class WhiteboardShape
Parameters:
p - coord point
Returns:
true if shape contains p

setPoints

public void setPoints(List<WhiteboardPoint> points)
Sets the list of WhiteboardPoint instances that this WhiteboardObject is composed of.

Specified by:
setPoints in interface WhiteboardObjectPath
Parameters:
points - the list of WhiteboardPoint instances that this WhiteboardObject is composed of.

translate

public void translate(double deltaX,
                      double deltaY)
Translates the shape.

Specified by:
translate in class WhiteboardShape
Parameters:
deltaX - x coordinate
deltaY - y coordinate

translateSelectedPoint

public void translateSelectedPoint(double deltaX,
                                   double deltaY)
Translates a point from the shape.

Specified by:
translateSelectedPoint in class WhiteboardShape
Parameters:
deltaX - x coordinate
deltaY - y coordinate

getSelectionPoint

public WhiteboardPoint getSelectionPoint(Point2D p)
Tests if a point p is over a selection point.

Specified by:
getSelectionPoint in class WhiteboardShape
Parameters:
p - point
Returns:
nearest selection point

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.