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

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


    context.lineTo(canvasWidth*2/3, canvasHeight);
    context.lineTo(canvasWidth*2/3, canvasHeight*2/3);
    context.lineTo(0, canvasHeight*2/3);
    context.lineTo(0, canvasHeight/3);
    context.closePath();
    context.stroke();
    context.fill();
   
    return canvas.getCanvasElement();
  }
}
View Full Code Here


            // This next lineTo helps ensure that the shape of the line looks
            // congruous to any specials on the same line
            ctx.lineTo(Math.min(startPos, endPos) * colWidth, height / 2.0);
            ctx.lineTo(endPos * colWidth, height - pad);
            ctx.lineTo(endPos * colWidth, height);
            ctx.stroke();
         }
         else
         {
            // something special

View Full Code Here

               // draw from i to nexusColumn;
               ctx.beginPath();
               ctx.moveTo(startPos * colWidth, 0);
               ctx.lineTo(startPos * colWidth, pad);
               ctx.lineTo(nexusColumn * colWidth, height / 2.0);
               ctx.stroke();
            }

            if (!c.end)
            {
               // draw from nexusColumn to endPosition
View Full Code Here

               // draw from nexusColumn to endPosition
               ctx.beginPath();
               ctx.moveTo(nexusColumn * colWidth, height / 2.0);
               ctx.lineTo(endPos * colWidth, height - pad);
               ctx.lineTo(endPos * colWidth, height);
               ctx.stroke();
            }

         }
      }

View Full Code Here

                if (shape.getType() == ShapeType.CIRCLE) {
                    CircleShape circle = (CircleShape)shape;
                    context.beginPath();
                    context.arc(circle.m_p.x, circle.m_p.y, circle.getRadius(), 0, Math.PI * 2, true);
                    context.closePath();
                    context.stroke();
                } else if (shape.getType() == ShapeType.POLYGON) {
                    PolygonShape poly = (PolygonShape)shape;
                    Vec2[] vertices = poly.getVertices();
                    context.beginPath();
                    context.moveTo(vertices[0].x, vertices[0].y);
View Full Code Here

                    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();
                }
            }
            context.restore();
        }
        context.restore();
View Full Code Here

        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();
    }

    private double getElementRadius( final UIElement element ) {
        if ( element instanceof TypeNodeElement ) {
            return ( (TypeNodeElement) element ).getRadius();
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.