Package gwt.g2d.client.graphics

Examples of gwt.g2d.client.graphics.Surface.save()


        .setTextAlign(TextAlign.CENTER)
        .setTextBaseline(TextBaseline.TOP)
        .setShadowOffsetX(1.0)
        .setShadowOffsetY(1.0)
        .setShadowBlur(1.0);   
    surface.save();
    surface.setGlobalAlpha(1.0)
        .setGlobalCompositeOperation(Composition.SOURCE_IN)
        .setLineCap(LineCap.ROUND)
        .setLineJoin(LineJoin.MITER)
        .setLineWidth(1.0)
View Full Code Here


  @Override
  public void onMouseMove(MouseMoveEvent event) {
    if (isLeftButtonDown || isRightButtonDown) {
      Surface surface = getPrimarySurface();
      surface.save().setLineCap(LineCap.ROUND).setLineJoin(LineJoin.ROUND);
      if (isLeftButtonDown) {
        surface.setStrokeStyle(KnownColor.BLACK).setLineWidth(5);
      } else if (isRightButtonDown) {
        surface.setStrokeStyle(KnownColor.WHITE).setLineWidth(20);
      }
View Full Code Here

        .fillRectangle(-size / 2, -size / 2, size, size);

    // draw stars
    surface.setFillStyle(KnownColor.WHITE);
    for (int j = 0; j < 500; j++) {
      surface.save()
          .translate(size / 2 - Random.nextInt(size),
              size / 2 - Random.nextInt(size));
      drawStar(Random.nextInt(4) + 2);
      surface.restore();
    }
View Full Code Here

  }

  private void drawStar(double r) {
    Surface surface = getPrimarySurface();
    surface.save();
    ShapeBuilder shapeBuilder = new ShapeBuilder().moveTo(r, 0);
    for (int i = 0; i < 9; i++) {
      shapeBuilder.rotate(Math.PI / 5);
      if (i % 2 == 0) {
        shapeBuilder.drawLineTo((r / 0.525731) * 0.200811, 0);
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.