Examples of WhiteboardPoint


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

    {
        String s = "<text id=\"#i\" x=\"#x\" y=\"#y\" " +
          "fill=\"#fi\" font-family=\"#ff\" font-size=\"#fs\">#t</text>";
        s = s.replaceAll ("#i", getID ());
        s = s.replaceAll ("#fi",  colorToHex (getColor ()));
        WhiteboardPoint p = getWhiteboardPoint ();
        s = s.replaceAll ("#x", "" + p.getX ());
        s = s.replaceAll ("#y", "" + p.getY ());
        s = s.replaceAll ("#ff", getFontName ());
        s = s.replaceAll ("#fs", "" + getFontSize ());
        s = s.replaceAll ("#t", getText ());
        return s;
    }
View Full Code Here

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

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

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

        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

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

     * @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

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

     * @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

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

     * @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

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

    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

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

                                    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

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

        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

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

        GeneralPath polygon = new GeneralPath (
          GeneralPath.WIND_EVEN_ODD, points.size ());
        if(points.size ()<=0)
            return polygon;
       
        WhiteboardPoint start = points.get (0);
        polygon.moveTo ((float) start.getX (), (float) start.getY ());
       
        WhiteboardPoint p;
        for (int i =0; i<points.size ();i++)
        {
            p = points.get (i);
            polygon.lineTo ((float) p.getX (), (float) p.getY ());
        }
       
        polygon.closePath ();
        return polygon;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.