Package java.awt.geom

Examples of java.awt.geom.Arc2D


            // arc and ask for it's end angle and get the tangent there.
            Point2D prevEndPoint =
                getSegmentTerminatingPoint(prev, prevSegType);
            boolean large   = (curr[3]!=0.);
            boolean goLeft = (curr[4]!=0.);
            Arc2D arc = ExtendedGeneralPath.computeArc
                (prevEndPoint.getX(), prevEndPoint.getY(),
                 curr[0], curr[1], curr[2],
                 large, goLeft, curr[5], curr[6]);
            double theta = arc.getAngleStart()+arc.getAngleExtent();
            theta = Math.toRadians(theta);
            dx = -arc.getWidth()/2.0*Math.sin(theta);
            dy = arc.getHeight()/2.0*Math.cos(theta);

            // System.out.println("In  Theta:  " + Math.toDegrees(theta) + 
            //                    " Dx/Dy: " + dx + "/" + dy);
            if (curr[2] != 0) {
                double ang = Math.toRadians(-curr[2]);
View Full Code Here


        case ExtendedPathIterator.SEG_ARCTO: {
            // If the current segment is an ARCTO then we build the
            // arc and ask for it's end angle and get the tangent there.
            boolean large   = (next[3]!=0.);
            boolean goLeft = (next[4]!=0.);
            Arc2D arc = ExtendedGeneralPath.computeArc
                (currEndPoint.getX(), currEndPoint.getY(),
                 next[0], next[1], next[2],
                 large, goLeft, next[5], next[6]);
            double theta = arc.getAngleStart();
            theta = Math.toRadians(theta);
            dx = -arc.getWidth()/2.0*Math.sin(theta);
            dy = arc.getHeight()/2.0*Math.cos(theta);
            // System.out.println("Out Theta:  " + Math.toDegrees(theta) + 
            //                    " Dx/Dy: " + dx + "/" + dy);
            if (next[2] != 0) {
                double ang = Math.toRadians(-next[2]);
                double sinA = Math.sin(ang);
View Full Code Here

     *                    relative to the start angle.
     * @see         java.awt.Graphics#fillArc
     */
    public void drawArc(int x, int y, int width, int height,
                        int startAngle, int arcAngle){
        Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN);
        draw(arc);
    }
View Full Code Here

     *                    relative to the start angle.
     * @see         java.awt.Graphics#drawArc
     */
    public void fillArc(int x, int y, int width, int height,
                        int startAngle, int arcAngle){
        Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE);
        fill(arc);
    }
View Full Code Here

            // If the endpoints (x, y) and (x0, y0) are identical, then this
            // is equivalent to omitting the elliptical arc segment entirely.
            return;
        }

        Arc2D arc = computeArc(x0, y0, rx, ry, angle,
                               largeArcFlag, sweepFlag, x, y);
        if (arc == null) return;

        AffineTransform t = AffineTransform.getRotateInstance
            (Math.toRadians(angle), arc.getCenterX(), arc.getCenterY());
        Shape s = t.createTransformedShape(arc);
        path.append(s, true);

        makeRoom(7);
        types [numSeg++= ExtendedPathIterator.SEG_ARCTO;
View Full Code Here

          g.setColor(gridHighlightColorUnavailable);
        } else {
          g.setColor(gridHighlightColor);
        }
        if (this.getTower() == null) {
          Arc2D rangeArc = new Arc2D.Float();

          rangeArc.setArcByCenter(Grid.SIZE / 2, Grid.SIZE / 2,
              this.context.getNextTower().getRange(), 0.0, 360.0,
              Arc2D.CHORD);
       
          if (ALPHA) {
            g.setComposite(myAlpha);
View Full Code Here

      Rectangle2D rec;
      if (p.getStatus() == 0) {
        rec = new Rectangle2D.Float(p.getX(), p.getY(), 3, 3);
        g.fill(rec);
      } else if (p.getStatus() == 2) {
        Arc2D arc = new Arc2D.Float();
        arc.setArcByCenter(p.getX(), p.getY(), this.getSplashRadius(),
            0, 360, Arc2D.CHORD);
        g.draw(arc);
        for (int i = 0; i < p.getSplashTargets().size(); i++) {
          Line2D splash = new Line2D.Float(p.getX(), p.getY(), p
              .getSplashTargets().get(i).getX()
View Full Code Here

    g2.setStroke(new BasicStroke(1f));
   
   

   
    Arc2D a = new Arc2D.Float();
    a.setArcByCenter(8, 10, 5.0, 270, 180, Arc2D.OPEN);
    g2.draw(a);
    g2.drawLine(14, 10, 18, 10);

   
   
View Full Code Here

    /**
     * @see Graphics#drawArc(int, int, int, int, int, int)
     */
    @Override
    public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
        Arc2D arc = new Arc2D.Double(x,y,width,height,startAngle, arcAngle, Arc2D.OPEN);
        draw(arc);

    }
View Full Code Here

    /**
     * @see Graphics#fillArc(int, int, int, int, int, int)
     */
    @Override
    public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
        Arc2D arc = new Arc2D.Double(x,y,width,height,startAngle, arcAngle, Arc2D.PIE);
        fill(arc);
    }
View Full Code Here

TOP

Related Classes of java.awt.geom.Arc2D

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.