Package java.awt.geom

Examples of java.awt.geom.Path2D$Iterator


    float[] paniponidash = toDashArray(fsi.getDashArray());
    Stroke stroke = new BasicStroke(fsi.getStrokeWidth(), BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 1.0f,
        paniponidash, 0.0f);
    gr.setColor(toColor(fsi.getStrokeColor(), fsi.getStrokeOpacity()));
    gr.setStroke(stroke);
    Path2D s = new Path2D.Double(Path2D.WIND_EVEN_ODD, 3);
    s.moveTo(0, 0);
    s.lineTo(twothirds, onethird);
    s.lineTo(onethird, twothirds);
    s.lineTo(max, max);
    gr.draw(s);
  }
View Full Code Here


  @Override
  public void scan(
    GraphicsState state
    )
  {
    Path2D pathObject = (Path2D)state.getScanner().getRenderObject();
    if(pathObject != null)
    {pathObject.closePath();}
  }
View Full Code Here

  public void scan(
    GraphicsState state
    )
  {
    ContentScanner scanner = state.getScanner();
    Path2D pathObject = (Path2D)scanner.getRenderObject();
    if(pathObject != null)
    {
      Graphics2D context = scanner.getRenderContext();

      if(closed)
      {
        pathObject.closePath();
      }
      if(filled)
      {
        context.setPaint(
          state.getFillColorSpace().getPaint(state.getFillColor())
          );
        pathObject.setWindingRule(fillMode.toAwt());
        context.fill(pathObject);
      }
      if(stroked)
      {
        context.setPaint(
View Full Code Here

  @Override
  public void scan(
    GraphicsState state
    )
  {
    Path2D pathObject = (Path2D)state.getScanner().getRenderObject();
    if(pathObject != null)
    {
      Point2D controlPoint1 = getControl1();
      if(controlPoint1 == null)
      {controlPoint1 = pathObject.getCurrentPoint();}
      Point2D finalPoint = getPoint();
      Point2D controlPoint2 = getControl2();
      if(controlPoint2 == null)
      {controlPoint2 = finalPoint;}
      pathObject.curveTo(
        controlPoint1.getX(),
        controlPoint1.getY(),
        controlPoint2.getX(),
        controlPoint2.getY(),
        finalPoint.getX(),
View Full Code Here

  @Override
  public void scan(
    GraphicsState state
    )
  {
    Path2D pathObject = (Path2D)state.getScanner().getRenderObject();
    if(pathObject != null)
    {
      Point2D point = getPoint();
      pathObject.lineTo(point.getX(),point.getY());
    }
  }
View Full Code Here

  public void scan(
    GraphicsState state
    )
  {
    ContentScanner scanner = state.getScanner();
    Path2D pathObject = (Path2D)scanner.getRenderObject();
    if(pathObject != null)
    {
      pathObject.setWindingRule(clipMode.toAwt());
      scanner.getRenderContext().clip(pathObject);
    }
  }
View Full Code Here

  @Override
  public void scan(
    GraphicsState state
    )
  {
    Path2D pathObject = (Path2D)state.getScanner().getRenderObject();
    if(pathObject != null)
    {
      float x = getX(),
        y = getY(),
        width = getWidth(),
        height = getHeight();
      pathObject.moveTo(x,y);
      pathObject.lineTo(x + width, y);
      pathObject.lineTo(x + width, y + height);
      pathObject.lineTo(x, y + height);
      pathObject.closePath();
    }
  }
View Full Code Here

  @Override
  public void scan(
    GraphicsState state
    )
  {
    Path2D pathObject = (Path2D)state.getScanner().getRenderObject();
    if(pathObject != null)
    {
      Point2D point = getPoint();
      pathObject.moveTo(point.getX(),point.getY());
    }
  }
View Full Code Here

                    border.paintBorder(c, g, borderX, borderY, borderW, borderH);
                } else {
                    Graphics g2 = g.create();
                    if (g2 instanceof Graphics2D) {
                        Graphics2D g2d = (Graphics2D) g2;
                        Path2D path = new Path2D.Float();
                        path.append(new Rectangle(borderX, borderY, borderW, labelY - borderY), false);
                        path.append(new Rectangle(borderX, labelY, labelX - borderX - TEXT_SPACING, labelH), false);
                        path.append(new Rectangle(labelX + labelW + TEXT_SPACING, labelY, borderX - labelX + borderW - labelW - TEXT_SPACING, labelH), false);
                        path.append(new Rectangle(borderX, labelY + labelH, borderW, borderY - labelY + borderH - labelH), false);
                        g2d.clip(path);
                    }
                    border.paintBorder(c, g2, borderX, borderY, borderW, borderH);
                    g2.dispose();
                }
View Full Code Here


  @Override@Test
  public void testUpdateDblePathInside() {
    IRectangularShape model = getShape();
    Path2D path;
    PathIterator pi;
    double[] coords = new double[6];
    final double thickness = 3.;
    final double height = 10.;
    final double dble = 1.;
    List<Double> xs = new ArrayList<>();
    List<Double> ys = new ArrayList<>();

    model.setPosition(-10, 20);
    model.setWidth(100);
    model.setThickness(thickness);
    model.setDbleBordSep(dble);
    model.setHeight(height);
    model.setBordersPosition(BorderPos.INTO);
    model.setHasDbleBord(true);
    view.update();
    path = view.getPath();

    pi = path.getPathIterator(null);
    assertEquals(PathIterator.SEG_MOVETO, pi.currentSegment(coords));
    xs.add(coords[0]);
    ys.add(coords[1]);
    pi.next();
    assertEquals(PathIterator.SEG_LINETO, pi.currentSegment(coords));
View Full Code Here

TOP

Related Classes of java.awt.geom.Path2D$Iterator

Copyright © 2018 www.massapicom. 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.