Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class WhiteboardShapeImage
extends WhiteboardShape
implements WhiteboardObjectImage

a WhiteboardShapeCircle, in XML : data

Author:
Julien Waechter

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.whiteboardobjects.WhiteboardObjectImage
NAME
 
Constructor Summary
WhiteboardShapeImage(String id, WhiteboardPoint p, double width, double height, byte[] bytes)
          WhiteboardShapImage constructor
 
Method Summary
 boolean contains(Point2D p)
          Tests if the shape contains a point.
 byte[] getBackgroundImage()
          Returns a binary array containing the image that should be displayed as the background of this WhiteboardObject.
 double getHeight()
          Returns the height (in pixels) of the WhiteboardObject.
 WhiteboardPoint getSelectionPoint(Point2D p)
          Tests if a point p is over a selection point.
 List<WhiteboardPoint> getSelectionPoints()
          Returns the list of selected points.
 WhiteboardPoint getWhiteboardPoint()
          Returns the coordinates of this whiteboard object.
 double getWidth()
          Returns the width (in pixels) of the WhiteboardObject.
 void paintShape(Graphics2D g, AffineTransform t)
          Code to paint this specific shape.
 void setBackgroundImage(byte[] background)
          Specifies an image that should be displayed as the background of this object.
 void setHeight(double height)
          Sets the width (in pixels) of the WhiteboardObject.
 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.
 
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

WhiteboardShapeImage

public WhiteboardShapeImage(String id,
                            WhiteboardPoint p,
                            double width,
                            double height,
                            byte[] bytes)
WhiteboardShapImage constructor

Parameters:
id - String that uniquely identifies this WhiteboardObject.
p - coordinates of this object.
width - width value of this object (in pixel)
height - height value of this object (in pixel)
bytes - a binary array containing the image that should be displayed as the object background.
Method Detail

paintShape

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

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

getSelectionPoints

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

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

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

getWidth

public double getWidth()
Returns the width (in pixels) of the WhiteboardObject.

Specified by:
getWidth in interface WhiteboardObjectImage
Returns:
The width.

setWidth

public void setWidth(double width)
Sets the width (in pixels) of the WhiteboardObject.

Specified by:
setWidth in interface WhiteboardObjectImage
Parameters:
width - The new width.

getHeight

public double getHeight()
Returns the height (in pixels) of the WhiteboardObject.

Specified by:
getHeight in interface WhiteboardObjectImage
Returns:
The height.

setHeight

public void setHeight(double height)
Sets the width (in pixels) of the WhiteboardObject.

Specified by:
setHeight in interface WhiteboardObjectImage
Parameters:
height - The new height.

translate

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

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

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

getWhiteboardPoint

public WhiteboardPoint getWhiteboardPoint()
Returns the coordinates of this whiteboard object.

Specified by:
getWhiteboardPoint in interface WhiteboardObjectImage
Returns:
the coordinates of this object.

setWhiteboardPoint

public void setWhiteboardPoint(WhiteboardPoint whiteboardPoint)
Sets the coordinates of this whiteboard object.

Specified by:
setWhiteboardPoint in interface WhiteboardObjectImage
Parameters:
whiteboardPoint - the coordinates of this object.

setBackgroundImage

public void setBackgroundImage(byte[] background)
Specifies an image that should be displayed as the background of this object.

Specified by:
setBackgroundImage in interface WhiteboardObjectImage
Parameters:
background - a binary array containing the image that should be displayed as the object background.

getBackgroundImage

public byte[] getBackgroundImage()
Returns a binary array containing the image that should be displayed as the background of this WhiteboardObject.

Specified by:
getBackgroundImage in interface WhiteboardObjectImage
Returns:
a binary array containing the image that should be displayed as the object background.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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