Package java.awt.geom

Examples of java.awt.geom.Ellipse2D


                     PlotState parentState, PlotRenderingInfo info) {

        RoundRectangle2D outerStem = new RoundRectangle2D.Double();
        RoundRectangle2D innerStem = new RoundRectangle2D.Double();
        RoundRectangle2D mercuryStem = new RoundRectangle2D.Double();
        Ellipse2D outerBulb = new Ellipse2D.Double();
        Ellipse2D innerBulb = new Ellipse2D.Double();
        String temp = null;
        FontMetrics metrics = null;
        if (info != null) {
            info.setPlotArea(area);
        }

        // adjust for insets...
        RectangleInsets insets = getInsets();
        insets.trim(area);
        drawBackground(g2, area);

        // adjust for padding...
        Rectangle2D interior = (Rectangle2D) area.clone();
        this.padding.trim(interior);
        int midX = (int) (interior.getX() + (interior.getWidth() / 2));
        int midY = (int) (interior.getY() + (interior.getHeight() / 2));
        int stemTop = (int) (interior.getMinY() + getBulbRadius());
        int stemBottom = (int) (interior.getMaxY() - getBulbDiameter());
        Rectangle2D dataArea = new Rectangle2D.Double(midX - getColumnRadius(),
                stemTop, getColumnRadius(), stemBottom - stemTop);

        outerBulb.setFrame(midX - getBulbRadius(), stemBottom, getBulbDiameter(), getBulbDiameter());

        outerStem.setRoundRect(midX - getColumnRadius(), interior.getMinY(),
                getColumnDiameter(), stemBottom + getBulbDiameter() - stemTop,
                getColumnDiameter(), getColumnDiameter());

        Area outerThermometer = new Area(outerBulb);
        Area tempArea = new Area(outerStem);
        outerThermometer.add(tempArea);

        innerBulb.setFrame(midX - getBulbRadius() + getGap(), stemBottom
                + getGap(), getBulbDiameter() - getGap() * 2, getBulbDiameter() - getGap() * 2);

        innerStem.setRoundRect(midX - getColumnRadius() + getGap(),
                interior.getMinY() + getGap(), getColumnDiameter()
                - getGap() * 2, stemBottom + getBulbDiameter() - getGap() * 2
 
View Full Code Here


        double y = v0.getY() + ((v1.getY() - v0.getY()) * fraction);
        double w = v0.getWidth() +
            ((v1.getWidth() - v0.getWidth()) * fraction);
        double h = v0.getHeight() +
            ((v1.getHeight() - v0.getHeight()) * fraction);
        Ellipse2D value = (Ellipse2D)v0.clone();
        value.setFrame(x, y, w, h);
        return value;
    }
View Full Code Here

     * @param       width the width of the oval to be drawn.
     * @param       height the height of the oval to be drawn.
     * @see         java.awt.Graphics#fillOval
     */
    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

     * @param       width the width of the oval to be filled.
     * @param       height the height of the oval to be filled.
     * @see         java.awt.Graphics#drawOval
     */
    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

            double x = w/sx/2;
            double y = h/sy/2;

            // Creates the first leaf by filling the intersection of two Area
            // objects created from an ellipse.
            Ellipse2D leaf = new Ellipse2D.Double(x-16, y-29, 15.0, 15.0);
            Area leaf1 = new Area(leaf);
            leaf.setFrame(x-14, y-47, 30.0, 30.0);
            Area leaf2 = new Area(leaf);
            leaf1.intersect(leaf2);  
            g2.setColor(GREEN);
            g2.fill(leaf1);  

            // Creates the second leaf.
            leaf.setFrame(x+1, y-29, 15.0, 15.0);
            leaf1 = new Area(leaf);
            leaf2.intersect(leaf1);
            g2.fill(leaf2);

            // Creates the stem by filling the Area resulting from the
            // subtraction of two Area objects created from an ellipse.
            Ellipse2D stem = new Ellipse2D.Double(x, y-42, 40.0, 40.0);
            Area st1 = new Area(stem);
            stem.setFrame(x+3, y-47, 50.0, 50.0);
            st1.subtract(new Area(stem));
            g2.setColor(BLACK);
            g2.fill(st1);

            // Creates the pear itself by filling the Area resulting from the
            // union of two Area objects created by two different ellipses.
            Ellipse2D circle = new Ellipse2D.Double(x-25, y, 50.0, 50.0);
            Ellipse2D oval = new Ellipse2D.Double(x-19, y-20, 40.0, 70.0);
            Area circ = new Area(circle);
            circ.add(new Area(oval));

            g2.setColor(YELLOW);
            g2.fill(circ);
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

      path.lineTo((float) (dst.getX() + ax - ay / 2), (float) (dst.getY()
          + ay + ax / 2));
      return path;

    } else if (style == GraphConstants.ARROW_CIRCLE) {
      Ellipse2D ellipse = new Ellipse2D.Float((float) (dst.getX() + ax
          / 2 - size / 2), (float) (dst.getY() + ay / 2 - size / 2),
          size, size);
      dst.setLocation(dst.getX() + ax, dst.getY() + ay);
      return ellipse;
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

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.