Examples of ShapeBuilder


Examples of flash.swf.builder.types.ShapeBuilder

            return ge;
        }

        private Shape createGlyphShape(java.awt.Shape outline)
        {
            ShapeBuilder shape = new ShapeBuilder(useTwips);
            shape.setCurrentLineStyle(0);
            shape.setCurrentFillStyle1(1);
            shape.setUseFillStyle1(true);
            shape.processShape(new PathIteratorWrapper(outline.getPathIterator(null)));

            return shape.build();
        }
View Full Code Here

Examples of flash.swf.builder.types.ShapeBuilder

    {
        // Note that we will apply node.x and node.y as a translation operation
        // in the PlaceObject3 Matrix and instead start the shape from the
        // origin (0.0, 0.0).
        Ellipse2D.Double ellipse = new Ellipse2D.Double(0.0, 0.0, node.width, node.height);
        ShapeBuilder builder = new ShapeBuilder();
        ShapeIterator iterator = new PathIteratorWrapper(ellipse.getPathIterator(null));
        builder.processShape(iterator);
        Shape shape = builder.build();
        return placeDefineShape(node, shape.shapeRecords, node.fill, node.stroke, node.createGraphicContext());
       
    }
View Full Code Here

Examples of flash.swf.builder.types.ShapeBuilder

            return glyph;
        }

        private Shape getShapeFromGlyph(Glyph glyph)
        {
            ShapeBuilder shape = new ShapeBuilder(useTwips);
            shape.setCurrentLineStyle(0);
            shape.setCurrentFillStyle1(1);
            shape.setUseFillStyle1(true);
            shape.processShape(new GlyphIterator(glyph, emScale, keep201Behavior));

            return shape.build();
        }
View Full Code Here

Examples of flash.swf.builder.types.ShapeBuilder

        sws.fillstyles = new ArrayList<FillStyle>();
        int fsIndex = sws.fillstyles.add(fs) ? sws.fillstyles.lastIndexOf(fs) + 1 : 0;
        sws.linestyles = new ArrayList<LineStyle>();

        // Build Raw SWF Shape
        ShapeBuilder builder = new ShapeBuilder(new Point());
        builder.setUseFillStyle0(true);
        builder.setCurrentFillStyle0(fsIndex);
        builder.move(0, 0);
        builder.straight(width, 0);
        builder.straight(width, height);
        builder.straight(0, height);
        builder.straight(0, 0);
        builder.correctRoundingErrors();
        sws.shapeRecords = builder.build().shapeRecords;

        // Wrap up into a SWF DefineShape Tag
        DefineShape defineShape = new DefineShape(Tag.stagDefineShape3);
        defineShape.bounds = new Rect(width * SwfConstants.TWIPS_PER_PIXEL, height * SwfConstants.TWIPS_PER_PIXEL);
        defineShape.shapeWithStyle = sws;
View Full Code Here

Examples of flash.swf.builder.types.ShapeBuilder

            return glyph;
        }

        private Shape getShapeFromGlyph(Glyph glyph)
        {
            ShapeBuilder shape = new ShapeBuilder(useTwips);
            shape.setCurrentLineStyle(0);
            shape.setCurrentFillStyle1(1);
            shape.setUseFillStyle1(true);
            shape.processShape(new GlyphIterator(glyph, emScale, keep201Behavior));

            return shape.build();
        }
View Full Code Here

Examples of flash.swf.builder.types.ShapeBuilder

            return ge;
        }

        private Shape createGlyphShape(java.awt.Shape outline)
        {
            ShapeBuilder shape = new ShapeBuilder(useTwips);
            shape.setCurrentLineStyle(0);
            shape.setCurrentFillStyle1(1);
            shape.setUseFillStyle1(true);
            shape.processShape(new PathIteratorWrapper(outline.getPathIterator(null)));

            return shape.build();
        }
View Full Code Here

Examples of gwt.g2d.client.graphics.shapes.ShapeBuilder

 
  /**
   * Draws onto the surface using {@link ShapeBuilder}.
   */
  private void drawWithShapeBuilder(Surface surface) {
    surface.strokeShape(new ShapeBuilder()
        .drawLineSegment(40, 20, 180, 20)
        .drawQuadraticCurveTo(200, 20, 200, 40)
        .drawLineTo(200, 180)
        .drawQuadraticCurveTo(200, 200, 180, 200)
        .drawLineTo(40, 200)
        .drawQuadraticCurveTo(20, 200, 20, 180)
        .drawLineTo(20, 40)
        .drawQuadraticCurveTo(20, 20, 40, 20)
        .moveTo(50, 50)
        .drawArc(50, 50, 15, (float) Math.toRadians(30), (float) Math.toRadians(-30), false)
        .build());
    surface.strokeShape(new ShapeBuilder()
        .drawEllipse(20, 100, 180, 100)
        .build());
    ShapeBuilder dotShapeBuilder = new ShapeBuilder();
    for (int i = 0; i < 8; i++) {
      dotShapeBuilder.drawCircle(80 + i * 12, 50, 1);
    }
    surface.fillShape(dotShapeBuilder.build());
  }
View Full Code Here

Examples of gwt.g2d.client.graphics.shapes.ShapeBuilder

  public void initialize() {
    add(new Label("This demo does not work under IE."));
    Surface originalCanvas = new Surface(300, 300);
    Circle smallCircle = new Circle(150, 150, 140);
    Circle bigCircle = new Circle(150, 150, 150);
    Shape smallCircleShape = new ShapeBuilder().drawCircle(smallCircle).build();
    Shape bigCircleShape = new ShapeBuilder().drawCircle(bigCircle).build();
    Gradient radialGradient = new RadialGradient(new Circle(150, 150, 0), smallCircle)
        .addColorStop(0, KnownColor.RED)
        .addColorStop(1, KnownColor.GREEN);
    originalCanvas.setFillStyle(KnownColor.BLACK)
        .fillShape(bigCircleShape)
View Full Code Here

Examples of gwt.g2d.client.graphics.shapes.ShapeBuilder

      if (isLeftButtonDown) {
        surface.setStrokeStyle(KnownColor.BLACK).setLineWidth(5);
      } else if (isRightButtonDown) {
        surface.setStrokeStyle(KnownColor.WHITE).setLineWidth(20);
      }
      surface.strokeShape(new ShapeBuilder()
          .drawLineSegment(lastPosition, new Vector2(event.getX(), event.getY()))
          .build());
      surface.restore();
      lastPosition.set(event.getX(), event.getY());
    }   
View Full Code Here

Examples of gwt.g2d.client.graphics.shapes.ShapeBuilder

  }

  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);
      } else {
        shapeBuilder.drawLineTo(r, 0);
      }
    }
    surface.fillShape(shapeBuilder.build())
        .restore();
  }
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.