Package java.awt.geom

Examples of java.awt.geom.GeneralPath


//    log.debug("quadTo"+edgeCntrl2.x+","+edgeCntrl2.y+","+edge2.x+","+edge2.y);
//    log.debug("lineTo"+inter2.x+","+inter2.y);
//    log.debug("lineTo"+start2.x+","+start2.y);
//    log.debug("lineTo"+start1.x+","+start1.y);
   
    GeneralPath graphics = new GeneralPath();
    graphics.moveTo(start1.x,start1.y);
    graphics.lineTo(inter1.x,inter1.y);
    graphics.lineTo(edge1.x,edge1.y);
    graphics.quadTo(edgeCntrl1.x,edgeCntrl1.y,end.x,end.y);
    graphics.quadTo(edgeCntrl2.x,edgeCntrl2.y,edge2.x,edge2.y);
    graphics.lineTo(inter2.x,inter2.y);
    graphics.lineTo(start2.x,start2.y);
    graphics.lineTo(start1.x,start1.y);
    graphics.closePath();
   
    int[] rules = new int[8];
   
    //all possible Compositing Rules:
    rules[0] = AlphaComposite.SRC_OVER;
View Full Code Here


        Graphics2D graphics = ((PageDrawer)context).getGraphics();
        graphics.setColor( drawer.getStrokingColor() );
        List subPaths = drawer.getLineSubPaths();
        for( int i=0; i<subPaths.size(); i++ )
        {
            GeneralPath subPath = (GeneralPath)subPaths.get( i );
            graphics.draw( subPath );
        }
        subPaths.clear();
        GeneralPath path = drawer.getLinePath();
        graphics.draw( path );
        path.reset();
    }
View Full Code Here

       
        COSNumber x = (COSNumber)arguments.get( 0 );
        COSNumber y = (COSNumber)arguments.get( 1 );
       
        drawer.getLineSubPaths().add( drawer.getLinePath() );
        GeneralPath newPath = new GeneralPath();
        newPath.moveTo( x.floatValue(), (float)drawer.fixY( x.doubleValue(), y.doubleValue()) );
        drawer.setLinePath( newPath );
    }
View Full Code Here

        float x2f = x2.floatValue();
        float y2f = (float)drawer.fixY( x2f, y2.floatValue() );
        float x3f = x3.floatValue();
        float y3f = (float)drawer.fixY( x3f, y3.floatValue() );
       
        GeneralPath path = drawer.getLinePath();
        Point2D currentPoint = path.getCurrentPoint();
        float currentX = (float)currentPoint.getX();
        float currentY = (float)currentPoint.getY();
        drawer.getLinePath().curveTo(currentX,currentY,x2f,y2f,x3f,y3f);
    }
View Full Code Here

        if (slider.isEnabled() == false) {
            return;
        }

        if (hTriangle == null) {
            hTriangle = new GeneralPath();
            hTriangle.moveTo(0, 0);
            hTriangle.lineTo(TRIANGLE_SIZE, TRIANGLE_SIZE);
            hTriangle.lineTo(-TRIANGLE_SIZE, TRIANGLE_SIZE);
            hTriangle.lineTo(0, 0);
            hTriangle.closePath();
            vTriangle = new GeneralPath();
            vTriangle.moveTo(0, 0);
            vTriangle.lineTo(TRIANGLE_SIZE, TRIANGLE_SIZE);
            vTriangle.lineTo(TRIANGLE_SIZE, -TRIANGLE_SIZE);
            vTriangle.lineTo(0, 0);
            vTriangle.closePath();
View Full Code Here

    private void drawEquation(Graphics2D g2, AbstractEquation equation) {
        float x = 0.0f;
        float y = (float) yPositionToPixel(equation.compute(xPixelToPosition(0.0)));

        GeneralPath path = new GeneralPath();
        path.moveTo(x, y);

        for (x = 0.0f; x < getWidth(); x += 1.0f) {
            double position = xPixelToPosition(x);
            y = (float) yPositionToPixel(equation.compute(position));
            path.lineTo(x, y);
        }

        g2.draw(path);
    }
View Full Code Here

  }

  //read the winding rule
  int rule = in.readInt();

  GeneralPath path = new GeneralPath(rule);
  float[] coordinates = new float[6];

  //read the path
  while (!in.readBoolean()) {
      int segmentType = in.readInt();
      for (int i = 0; i < 6; i++)
    coordinates[i] = in.readFloat();

      switch (segmentType) {
    case PathIterator.SEG_MOVETO:
        path.moveTo(coordinates[0], coordinates[1]);
                  break;

        case PathIterator.SEG_LINETO:
        path.lineTo(coordinates[0], coordinates[1]);
              break;

    case PathIterator.SEG_QUADTO:
        path.quadTo(coordinates[0], coordinates[1],
        coordinates[2], coordinates[3]);
        break;

    case PathIterator.SEG_CUBICTO:
        path.curveTo(coordinates[0], coordinates[1],
         coordinates[2], coordinates[3],
         coordinates[4], coordinates[5]);
              break;

    case PathIterator.SEG_CLOSE:
        path.closePath();
              break;
    default:
        break;
      }
  }
View Full Code Here

            Point2D ul = crop.getUpperLeft();
            Point2D ur = crop.getUpperRight();
            Point2D ll = crop.getLowerLeft();
            Point2D lr = crop.getLowerRight();

            GeneralPath path = new GeneralPath();
            path.moveTo((float) ul.getX(), (float) ul.getY());
            path.lineTo((float) ur.getX(), (float) ur.getY());
            path.lineTo((float) lr.getX(), (float) lr.getY());
            path.lineTo((float) ll.getX(), (float) ll.getY());
            path.closePath();

            g.draw(path);
        }
    }
View Full Code Here

        Point2D ul = crop.getUpperLeft();
        Point2D ur = crop.getUpperRight();
        Point2D ll = crop.getLowerLeft();
        Point2D lr = crop.getLowerRight();

        GeneralPath path = new GeneralPath();
        path.moveTo((float) ul.getX(), (float) ul.getY());
        path.lineTo((float) ur.getX(), (float) ur.getY());
        path.lineTo((float) lr.getX(), (float) lr.getY());
        path.lineTo((float) ll.getX(), (float) ll.getY());
        path.closePath();

        return path;
    }
View Full Code Here

        width = curve.getWidth();
        clonePt = curve.getClonePoint();

        // Clone, to be isolated from changes to the Curve:
        if (curve.isValidShape()) {
            outer = new GeneralPath(curve);
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.geom.GeneralPath

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.