Package com.emitrom.lienzo.client.core.types

Examples of com.emitrom.lienzo.client.core.types.Point2DArray


    {
        JsArray<JavaScriptObject> points = getArrayOfJSO(Attribute.POINTS.getProperty());

        if (null != points)
        {
            return new Point2DArray(points);
        }
        return new Point2DArray();
    }
View Full Code Here


    {
        JsArray<JavaScriptObject> points = getArrayOfJSO(Attribute.CONTROL_POINTS.getProperty());

        if (null != points)
        {
            return new Point2DArray(points);
        }
        return new Point2DArray();
    }
View Full Code Here

     * @param context
     */
    @Override
    public boolean prepare(Context2D context, Attributes attr, double alpha)
    {
        Point2DArray list = getPoints();

        if ((null != list) && (list.getLength() > 2))
        {
            Point2D point0 = list.getPoint(0);

            Point2D point1 = list.getPoint(1);

            Point2D point2 = list.getPoint(2);

            context.beginPath();

            context.moveTo(point0.getX(), point0.getY());

View Full Code Here

     * @param 3 points {@link Point2D}
     * @return this Triangle
     */
    public Triangle setPoints(Point2D a, Point2D b, Point2D c)
    {
        getAttributes().setPoints(new Point2DArray(a, b, c));

        return this;
    }
View Full Code Here

     */
    public QuadraticCurve(double x, double y, double controlX, double controlY, double endX, double endY)
    {
        super(ShapeType.QUADRATIC_CURVE);

        setControlPoints(new Point2DArray(new Point2D(x, y), new Point2D(controlX, controlY), new Point2D(endX, endY)));
    }
View Full Code Here

     * @param context
     */
    @Override
    public boolean prepare(Context2D context, Attributes attr, double alpha)
    {
        Point2DArray points = getControlPoints();

        if ((points != null) && (points.getLength() == 3))
        {
            context.beginPath();

            Point2D p0 = points.getPoint(0);

            Point2D p1 = points.getPoint(1);

            Point2D p2 = points.getPoint(2);

            context.moveTo(p0.getX(), p0.getY());

            context.quadraticCurveTo(p1.getX(), p1.getY(), p2.getX(), p2.getY());

View Full Code Here

    }

    @Override
    public PathPartArray l(List<Point2D> points)
    {
        Point2DArray list = new Point2DArray();

        if ((null != points) && (points.size() > 0))
        {
            final int leng = points.size();

            for (int i = 0; i < leng; i++)
            {
                Point2D point = points.get(i);

                if (null != point)
                {
                    list.push(point);
                }
            }
            return l(list);
        }
        return this;
View Full Code Here

    @Override
    public PathPartArray l(Point2D point)
    {
        if (null != point)
        {
            return l(new Point2DArray(point));
        }
        return this;
    }
View Full Code Here

    }

    @Override
    public PathPartArray l(Point2D point, Point2D... points)
    {
        Point2DArray list = new Point2DArray();

        if (null != point)
        {
            list.push(point);
        }
        if ((null != points) && (points.length > 0))
        {
            final int leng = points.length;

            for (int i = 0; i < leng; i++)
            {
                point = points[i];

                if (null != point)
                {
                    list.push(point);
                }
            }
        }
        return m(list);
    }
View Full Code Here

    }

    @Override
    public PathPartArray l(Point2D[] points)
    {
        Point2DArray list = new Point2DArray();

        if ((null != points) && (points.length > 0))
        {
            final int leng = points.length;

            for (int i = 0; i < leng; i++)
            {
                Point2D point = points[i];

                if (null != point)
                {
                    list.push(point);
                }
            }
        }
        return l(list);
    }
View Full Code Here

TOP

Related Classes of com.emitrom.lienzo.client.core.types.Point2DArray

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.