Package java.awt.geom

Examples of java.awt.geom.Ellipse2D$Double


        double scaledRadius = (baseRadius / scale);
        double strokeAdjust = 0.5;
        double drawSize = 2 * (baseRadius + strokeAdjust);
        double clipSize = 2 * scaledRadius;
       
        Ellipse2D drawGlass = new Ellipse2D.Double(-strokeAdjust,
                -strokeAdjust, drawSize, drawSize);
       
        Ellipse2D clipGlass = new Ellipse2D.Double(0, 0, clipSize, clipSize);
       
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
                RenderingHints.VALUE_RENDER_QUALITY);
       
        GfrUtilGraphics2D.s_setRenderingAntiAliasOn(g2d);
View Full Code Here


                    transRange = zero2 - rangeAxis.valueToJava2D(z, dataArea,
                            rangeAxisLocation);
            }
            transDomain = Math.abs(transDomain);
            transRange = Math.abs(transRange);
            Ellipse2D circle = null;
            if (orientation == PlotOrientation.VERTICAL) {
                circle = new Ellipse2D.Double(transX - transDomain / 2.0,
                        transY - transRange / 2.0, transDomain, transRange);
            }
            else if (orientation == PlotOrientation.HORIZONTAL) {
                circle = new Ellipse2D.Double(transY - transRange / 2.0,
                        transX - transDomain / 2.0, transRange, transDomain);
            }
            g2.setPaint(getItemPaint(series, item));
            g2.fill(circle);
            g2.setStroke(getItemOutlineStroke(series, item));
            g2.setPaint(getItemOutlinePaint(series, item));
            g2.draw(circle);

            if (isItemLabelVisible(series, item)) {
                if (orientation == PlotOrientation.VERTICAL) {
                    drawItemLabel(g2, orientation, dataset, series, item,
                            transX, transY, false);
                }
                else if (orientation == PlotOrientation.HORIZONTAL) {
                    drawItemLabel(g2, orientation, dataset, series, item,
                            transY, transX, false);
                }
            }

            // add an entity if this info is being collected
            EntityCollection entities = null;
            if (info != null) {
                entities = info.getOwner().getEntityCollection();
                if (entities != null && circle.intersects(dataArea)) {
                    addEntity(entities, circle, dataset, series, item,
                            circle.getCenterX(), circle.getCenterY());
                }
            }

            int domainAxisIndex = plot.getDomainAxisIndex(domainAxis);
            int rangeAxisIndex = plot.getRangeAxisIndex(rangeAxis);
View Full Code Here

    * Returns a Shape representing a thumb.
    */
   private Shape createThumbShape(int width, int height)
   {
      // Use circular shape.
      Ellipse2D shape = new Ellipse2D.Double(0, 0, width, height);
      return shape;
   }
View Full Code Here

                    tick.getNumber().doubleValue(), dataArea);
            int r = p.x - center.x;
            int upperLeftX = center.x - r;
            int upperLeftY = center.y - r;
            int d = 2 * r;
            Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
            g2.setPaint(plot.getRadiusGridlinePaint());
            g2.draw(ring);
        }
    }
View Full Code Here

      for (int i = 0; i < poly.npoints; i++) {
        def.vertices.add(new Vec2(poly.xpoints[i], poly.ypoints[i]));
      }
      return def;
    } else if (shape instanceof Ellipse2D) {
      Ellipse2D ell = (Ellipse2D) shape;
      CircleDef def = new CircleDef();
      def.localPosition = new Vec2((float) ell.getCenterX(), (float) ell.getCenterY());
      def.radius = (float) (ell.getWidth() / 2);
      def.restitution = (float) elasticity;
      return def;
    }
    throw new RuntimeException("Shape type not implemented: " + shape.getClass());
  }
View Full Code Here

       
        DiscItemRendererState state = getDiscRenderer().initialise(g2,
            dataArea, this, dataset, info);
       
        for (int item = 0;  item < dataset.getItemCount();  item++) {
            Ellipse2D discLocation = getDiscDistributor().getDiscLocation(item);
            getDiscRenderer().drawItem(g2, state, dataArea, discLocation, info,
                this, dataset, item);
        }
       
    }
View Full Code Here

            //  are drawn over each other, this makes a nice gradient effect. Since drawing
            //  multiple semi-transparent ellipses over each other creates a
            //  multiplicative alpha blending, we calculate the width of the ellipses in
            //  a exponential manner, so they are farther apart near the center.
            double overspentCircleWidth = (Math.sqrt(plannedTime.doubleValue()) * scale) * 2;
            Ellipse2D shape = null;
            double width = discWidth;
            double x = 0;
            double lastX = Math.pow(discWidth - overspentCircleWidth, 1/EXPONENT);
            double increment = lastX / NUM_CIRCLES_OVERSPENT_SECTION;
           
View Full Code Here

   
    public void drawItem(Graphics2D g2, DiscItemRendererState state,
            Rectangle2D dataArea, Ellipse2D discLocation,
            PlotRenderingInfo info, DiscPlot plot, PieDataset dataset, int item) {

        Ellipse2D shape = plot.getDiscDistributor().getDiscLocation(item);
        if (shape == null)
            return;
       
        Comparable key = dataset.getKey(item);
        Paint discPaint = lookupDiscPaint(key, true);
View Full Code Here

    /**
     * @see Graphics#drawOval(int, int, int, int)
     */
    @Override
    public void drawOval(int x, int y, int width, int height) {
        Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
        draw(oval);
    }
View Full Code Here

    /**
     * @see Graphics#fillOval(int, int, int, int)
     */
    @Override
    public void fillOval(int x, int y, int width, int height) {
        Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
        fill(oval);
    }
View Full Code Here

TOP

Related Classes of java.awt.geom.Ellipse2D$Double

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.