Package com.google.gwt.canvas.dom.client

Examples of com.google.gwt.canvas.dom.client.Context2d.lineTo()


                    PolygonShape poly = (PolygonShape)shape;
                    Vec2[] vertices = poly.getVertices();
                    context.beginPath();
                    context.moveTo(vertices[0].x, vertices[0].y);
                    for (int i = 1; i < poly.getVertexCount(); ++i) {
                        context.lineTo(vertices[i].x, vertices[i].y);
                    }
                    context.closePath();
                    context.stroke();
                }
            }
View Full Code Here


        final double offsetY2 = Math.sin( theta ) * getElementRadius( element2 );

        final Context2d context = canvas.getContext2d();
        context.moveTo( element1.getCoordinate().getX() + offsetX1,
                        element1.getCoordinate().getY() + offsetY1 );
        context.lineTo( element2.getCoordinate().getX() - offsetX2,
                        element2.getCoordinate().getY() - offsetY2 );
        context.setStrokeStyle( CssColor.make( 100, 100, 100 ) );
        context.stroke();
    }

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.