Examples of beginPath()


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

        canvasGradient.addColorStop(0, "rgba(255, 200, 0, 1)");
        canvasGradient.addColorStop(1, "rgba(200,20,120, 1)");
    context.setFillStyle(canvasGradient);
    context.setStrokeStyle(canvasGradient);
   
    context.beginPath();
    context.moveTo(0 , canvasHeight/3);
    context.lineTo(canvasWidth*2/3, canvasHeight/3);
    context.lineTo(canvasWidth*2/3, 0);
    context.lineTo(canvasWidth, canvasHeight/2);
    context.lineTo(canvasWidth*2/3, canvasHeight);
View Full Code Here

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

         if (!c.nexus && !c.start && !c.end)
         {
            // Just draw a line from start to end position

            ctx.beginPath();
            ctx.moveTo(startPos * colWidth, 0);
            ctx.lineTo(startPos * colWidth, pad);
            // 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);
View Full Code Here

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

            }

            if (!c.start)
            {
               // 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();
            }
View Full Code Here

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

            }

            if (!c.end)
            {
               // 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

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

         }
      }

      // draw a circle on the nexus
      ctx.beginPath();
      ctx.arc(nexusColumn * colWidth, height / 2.0,
              theme.getCircleRadius() + theme.getStrokeWidth(), 0, Math.PI * 2);
      ctx.closePath();
      ctx.fill();

View Full Code Here

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

      ctx.arc(nexusColumn * colWidth, height / 2.0,
              theme.getCircleRadius() + theme.getStrokeWidth(), 0, Math.PI * 2);
      ctx.closePath();
      ctx.fill();

      ctx.beginPath();
      ctx.arc(nexusColumn * colWidth, height / 2.0,
              theme.getCircleRadius(), 0, Math.PI * 2);
      ctx.closePath();
      ctx.setFillStyle("white");
      ctx.fill();
View Full Code Here

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

  }

  @Override
  public void draw(Surface surface) {
    Context2d context = surface.getContext();
    context.beginPath();
    context.arc(fCenter.x, fCenter.y, fRadius, 0, MathHelper.TWO_PI, true);
    context.closePath();
  }
}
View Full Code Here

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

   */
  public final class CustomShape extends Shape {
    @Override
    public final void draw(Surface surface) {
      Context2d context = surface.getContext();
      context.beginPath();
      for (ShapeVisitor shape : shapes) {
        shape.visit(surface);
      }
      context.closePath();
    }
View Full Code Here

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

    double startAngle = -0.5 * Math.PI;
    for (Slice slice : slices) {
      double weight = slice.weight / totalWeight;
      double endAngle = startAngle + (weight * RADIANS_IN_CIRCLE);
      context.setFillStyle(slice.fill);
      context.beginPath();
      context.moveTo(cx, cy);
      context.arc(cx, cy, radius, startAngle, endAngle);
      context.fill();
      startAngle = endAngle;
    }
View Full Code Here

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

            context.rotate(body.getAngle());
            for (Fixture fixture = body.getFixtureList(); fixture != null; fixture = fixture.getNext()) {
                Shape shape = fixture.getShape();
                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;
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.