Package java.awt.geom

Examples of java.awt.geom.Arc2D


                      final int width,
                      final int height,
                      final int startAngle,
                      final int arcAngle)
  {
    final Arc2D arc = new Arc2D.Double(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN);
    draw(arc);

  }
View Full Code Here


                      final int width,
                      final int height,
                      final int startAngle,
                      final int arcAngle)
  {
    final Arc2D arc = new Arc2D.Double(x, y, width, height, startAngle, arcAngle, Arc2D.PIE);
    fill(arc);
  }
View Full Code Here

            break;
        case ELLIPSE:
            _shape = new Ellipse2D.Double(_ox + _x, _oy + _y - _h, _w, _h);
            break;
        case ARC:
            Arc2D a = new Arc2D.Double();
            a.setAngleStart(param1);
            a.setAngleExtent(param2);
            a.setFrame(_ox + _x, _oy + _y - _h, _w, _h);
            _shape = a;
            break;
        case ROUND_RECTANGLE:
            _shape = new RoundRectangle2D.Double(_ox + _x, _oy + _y - _h, _w, _h, param1, param2);
            break;
View Full Code Here

        this.getWidthRadius(), this.getWidthRadius());
    double value = ChartThemesUtilities.getScaledValue(plot.getValue(this.getDatasetIndex()), scale);
    DialScale scale = plot.getScaleForDataset(this.getDatasetIndex());
    double angle = scale.valueToAngle(value);

    Arc2D arc1 = new Arc2D.Double(lengthRect, angle, 0, Arc2D.OPEN);
    Point2D pt1 = arc1.getEndPoint();
    Arc2D arc2 = new Arc2D.Double(widthRect, angle - 90.0, 180.0,
        Arc2D.OPEN);
    Point2D pt2 = arc2.getStartPoint();
    Point2D pt3 = arc2.getEndPoint();
    Arc2D arc3 = new Arc2D.Double(widthRect, angle - 180.0, 0.0,
        Arc2D.OPEN);
    Point2D pt4 = arc3.getStartPoint();

    GeneralPath gp = new GeneralPath();
    gp.moveTo((float) pt1.getX(), (float) pt1.getY());
    gp.lineTo((float) pt2.getX(), (float) pt2.getY());
    gp.lineTo((float) pt4.getX(), (float) pt4.getY());
View Full Code Here

      Rectangle2D view) {

    // work out the anchor point
    Rectangle2D f = DialPlot.rectangleByRadius(frame, getRadius(),
        this.getRadius());
    Arc2D arc = new Arc2D.Double(f, this.getAngle(), 0.0, Arc2D.OPEN);
    Point2D pt = arc.getStartPoint();

    // calculate the bounds of the template value
    FontMetrics fm = g2.getFontMetrics(this.getFont());
    String s = this.getNumberFormat().format(this.getTemplateValue());
    Rectangle2D tb = TextUtilities.getTextBounds(s, g2, fm);
View Full Code Here

        this.getTickRadius() - this.getTickLabelOffset(),
        this.getTickRadius() - this.getTickLabelOffset());
   
    boolean firstLabel = true;
   
    Arc2D arc = new Arc2D.Double();
    Line2D workingLine = new Line2D.Double();
    Stroke arcStroke = new BasicStroke(0.75f);
   
    for (double v = this.getLowerBound(); v <= this.getUpperBound();
        v += this.getMajorTickIncrement()) {
      arc.setArc(arcRect, this.getStartAngle(), valueToAngle(v)
          - this.getStartAngle(), Arc2D.OPEN);
      g2.setPaint(this.getMajorTickPaint());
      g2.setStroke(arcStroke);
      g2.draw(arc);
     
      Point2D pt0 = arc.getEndPoint();
      arc.setArc(arcRectMajor, this.getStartAngle(), valueToAngle(v)
          - this.getStartAngle(), Arc2D.OPEN);
      Point2D pt1 = arc.getEndPoint();
      g2.setPaint(this.getMajorTickPaint());
      g2.setStroke(this.getMajorTickStroke());
      workingLine.setLine(pt0, pt1);
      g2.draw(workingLine);
      arc.setArc(arcRectForLabels, this.getStartAngle(), valueToAngle(v)
          - this.getStartAngle(), Arc2D.OPEN);
      Point2D pt2 = arc.getEndPoint();
     
      if (this.getTickLabelsVisible()) {
        if (!firstLabel || this.getFirstTickLabelVisible()) {
          g2.setFont(this.getTickLabelFont());
          TextUtilities.drawAlignedString(
              this.getTickLabelFormatter().format(v), g2,
              (float) pt2.getX(), (float) pt2.getY(),
              TextAnchor.CENTER);
        }
      }
      firstLabel = false;
     
      // now do the minor tick marks
      if (this.getMinorTickCount() > 0 && this.getMinorTickLength() > 0.0) {
        double minorTickIncrement = this.getMajorTickIncrement()
            / (this.getMinorTickCount() + 1);
        for (int i = 0; i < this.getMinorTickCount(); i++) {
          double vv = v + ((i + 1) * minorTickIncrement);
          if (vv >= this.getUpperBound()) {
            break;
          }
          double angle = valueToAngle(vv);

          arc.setArc(arcRect, this.getStartAngle(), angle
              - this.getStartAngle(), Arc2D.OPEN);
          pt0 = arc.getEndPoint();
          arc.setArc(arcRectMinor, this.getStartAngle(), angle
              - this.getStartAngle(), Arc2D.OPEN);
          Point2D pt3 = arc.getEndPoint();
          g2.setStroke(this.getMinorTickStroke());
          g2.setPaint(this.getMinorTickPaint());
          workingLine.setLine(pt0, pt3);
          g2.draw(workingLine);
        }
View Full Code Here

          + this.getScaleIndex());
    }
    double angleMin = scale.valueToAngle(this.getLowerBound());
    double angleMax = scale.valueToAngle(this.getUpperBound());

    Arc2D arcInner = new Arc2D.Double(arcRectInner, angleMin,
        angleMax - angleMin, Arc2D.OPEN);
    Arc2D arcOuter = new Arc2D.Double(arcRectOuter, angleMax,
        angleMin - angleMax, Arc2D.OPEN);
   
    g2.setPaint(this.getPaint());
    g2.setStroke(new BasicStroke(this.lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
    g2.draw(arcInner);
View Full Code Here

    /* (non-Javadoc)
     * @see org.jpox.store.mapping.JavaTypeMapping#setObject(org.jpox.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
    {
      Arc2D arc = (Arc2D)value;
        if (arc == null)
        {
        for (int i = 0; i < exprIndex.length; i++)
        {
          getDataStoreMapping(i).setObject(preparedStatement, exprIndex[i], null);         
      }
        }
        else
        {
            getDataStoreMapping(0).setInt(preparedStatement,exprIndex[0],arc.getArcType());
            getDataStoreMapping(1).setDouble(preparedStatement,exprIndex[1],arc.getX());
            getDataStoreMapping(2).setDouble(preparedStatement,exprIndex[2],arc.getY());
            getDataStoreMapping(3).setDouble(preparedStatement,exprIndex[3],arc.getWidth());
            getDataStoreMapping(4).setDouble(preparedStatement,exprIndex[4],arc.getHeight());
            getDataStoreMapping(5).setDouble(preparedStatement,exprIndex[5],arc.getAngleStart());
            getDataStoreMapping(6).setDouble(preparedStatement,exprIndex[6],arc.getAngleExtent());
        }
    }
View Full Code Here

    if (doorOrWindow.isModelMirrored()) {
      startAngle = 180 - startAngle;
    }
    float extentAngle = modelMirroredSign * (float)Math.toDegrees(sash.getEndAngle() - sash.getStartAngle());
   
    Arc2D arc = new Arc2D.Float(xAxis - sashWidth, yAxis - sashWidth,
        2 * sashWidth, 2 * sashWidth,
        startAngle, extentAngle, Arc2D.PIE);
    AffineTransform transformation = new AffineTransform();
    transformation.translate(doorOrWindow.getX(), doorOrWindow.getY());
    transformation.rotate(doorOrWindow.getAngle());
    transformation.translate(modelMirroredSign * -doorOrWindow.getWidth() / 2, -doorOrWindow.getDepth() / 2);
    PathIterator it = arc.getPathIterator(transformation);
    GeneralPath sashShape = new GeneralPath();
    sashShape.append(it, false);
    return sashShape;
  }
View Full Code Here

                double y1 = line.getY1();
                double x2 = line.getX2();
                double y2 = line.getY2();
                double r =
                    Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
                Arc2D arc = createArc(x1, y1, r, angle, axisAngle);
                drawDashedShape(g, arc);
            }
        }
        // Maybe draw the grid:
        if (showGrid) {
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.