Package net.java.sip.communicator.service.protocol

Examples of net.java.sip.communicator.service.protocol.WhiteboardPoint


    public void translateSelectedPoint (double deltaX, double deltaY)
    {
        if (getModifyPoint() == null)
            return;

        WhiteboardPoint point;
        for (int i = 0; i < points.size (); i++)
        {
            point = points.get (i);

            if(getModifyPoint().equals(point))
            {
                WhiteboardPoint newPoint
                    = new WhiteboardPoint (
                        point.getX () + deltaX, point.getY () + deltaY);

                points.set (i, newPoint);

                this.setModifyPoint(newPoint);
View Full Code Here


     * @param p point
     * @return nearest selection point
     */
    public WhiteboardPoint getSelectionPoint (Point2D p)
    {
        WhiteboardPoint point;
        for (int i = 0; i < points.size (); i++)
        {
            point = points.get (i);
            if(( new Point2D.Double (
              point.getX (),  point.getY ())).distance (p) < 18)
            {
                return point;
            }
        }
        return null;
View Full Code Here

    {
        double x = point.getX ();
        double y = point.getY ();
        x += deltaX;
        y += deltaY;
        this.point = new WhiteboardPoint (x, y);
    }
View Full Code Here

        if (getModifyPoint() == null)
            return;

        if(getModifyPoint().equals (point))
        {
            this.point = new WhiteboardPoint point.getX() + deltaX,
                                                point.getY() + deltaY);

            this.setModifyPoint(point);
        }
    }
View Full Code Here

     * @param p point
     * @return nearest selection point
     */
    public WhiteboardPoint getSelectionPoint (Point2D p)
    {
        WhiteboardPoint givenPoint = new WhiteboardPoint(p.getX(), p.getY());

        if(point.distance (givenPoint) < 18)
            return point;

        return null;
View Full Code Here

     * @param deltaX x coordinate
     * @param deltaY y coordinate
     */
    public void translateSelectedPoint (double deltaX, double deltaY)
    {
        WhiteboardPoint modifyPoint = getModifyPoint();

        if (modifyPoint == null)
            return;

        double x = whiteboardPoint.getX ();
        double y = whiteboardPoint.getY ();

        if (modifyPoint.getX() == x && modifyPoint.getY() == y)
        {
            this.whiteboardPoint.setX(x + deltaX);
            this.whiteboardPoint.setY(y + deltaY);
            this.width -= deltaX;
            this.height -= deltaY;

            modifyPoint.setX(x + deltaX);
            modifyPoint.setY(y + deltaY);
        }
        else if (modifyPoint.getX() == x + width && modifyPoint.getY() == y)
        {
            this.whiteboardPoint.setY(y + deltaY);
            this.width += deltaX;
            this.height -= deltaY;

            modifyPoint.setX(x + width);
            modifyPoint.setY(y + deltaY);
        }
        else if (modifyPoint.getX() == x && modifyPoint.getY() == y + height)
        {
            this.whiteboardPoint.setX(x + deltaX);
            this.width -= deltaX;
            this.height += deltaY;

            modifyPoint.setX(x + deltaX);
            modifyPoint.setY(y + height);
        }
        else if (modifyPoint.getX() == x + width
                    && modifyPoint.getY() == y + height)
        {
            this.width += deltaX;
            this.height += deltaY;

            modifyPoint.setX(x + width);
            modifyPoint.setY(y + height);
        }

        this.setModifyPoint(modifyPoint);
        this.recalculateSelectionPoints();
    }
View Full Code Here

     * @param p point
     * @return nearest selection point
     */
    public WhiteboardPoint getSelectionPoint (Point2D p)
    {
        WhiteboardPoint givenPoint = new WhiteboardPoint(p.getX(), p.getY());

        for (WhiteboardPoint point : selectionPoints)
            if (point.distance(givenPoint) < 18)
                return point;
        return null;
View Full Code Here

    private void recalculateSelectionPoints()
    {
        selectionPoints.clear();

        selectionPoints.add (
            new WhiteboardPoint (   whiteboardPoint.getX(),
                                    whiteboardPoint.getY()));

        selectionPoints.add (
            new WhiteboardPoint (   whiteboardPoint.getX() + width,
                                    whiteboardPoint.getY()));

        selectionPoints.add (
            new WhiteboardPoint (   whiteboardPoint.getX(),
                                    whiteboardPoint.getY() + height));

        selectionPoints.add (
            new WhiteboardPoint (   whiteboardPoint.getX() + width,
                                    whiteboardPoint.getY() + height));
    }
View Full Code Here

                                    AffineTransform at)
    {
        super (id);

        ArrayList<WhiteboardPoint> pointsList = new ArrayList<WhiteboardPoint>();
        WhiteboardPoint p;
        for (int i = 0; i < m_points.size (); i++)
        {
            p = m_points.get (i);
            Point2D w = at.transform (
              new Point2D.Double (p.getX (), p.getY ()), null);
            pointsList.add (new WhiteboardPoint (w.getX (), w.getY ()));
        }

        this.initShape(t, c, pointsList, fill);
    }
View Full Code Here

        GeneralPath polygon = new GeneralPath (
          GeneralPath.WIND_EVEN_ODD, points.size ());
        if(points.size ()<=0)
            return polygon;
       
        WhiteboardPoint start = points.get (0);
        Point2D w = new Point2D.Double (start.getX (), start.getY ());
        Point2D v = w2v.transform (w, null);
        polygon.moveTo ((int) v.getX (), (int) v.getY ());
       
        WhiteboardPoint p;
        for (int i =0; i<points.size ();i++)
        {
            p = points.get (i);
            w = new Point2D.Double (p.getX (), p.getY ());
            v = w2v.transform (w, null);
            polygon.lineTo ((int) v.getX (), (int) v.getY ());
        }
       
        polygon.closePath ();
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.service.protocol.WhiteboardPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.