Package java.awt.geom

Examples of java.awt.geom.Ellipse2D$Double


    public void drawRect(int x, int y, int width, int height) {
        draw(new Rectangle(x, y, width, height));
    }
   
    public void drawOval(int x, int y, int width, int height) {
        Ellipse2D oval = new Ellipse2D.Float((float)x, (float)y, (float)width, (float)height);
        draw(oval);
    }   
View Full Code Here


    public void fillRect(int x, int y, int width, int height) {
        fill(new Rectangle(x,y,width,height));
    }
   
    public void fillOval(int x, int y, int width, int height) {
        Ellipse2D oval = new Ellipse2D.Float((float)x, (float)y, (float)width, (float)height);
        fill(oval);
    }
View Full Code Here

   *
   * @return The object.
   */
  public Object createObject()
  {
    final Ellipse2D rect = new Ellipse2D.Float();

    final float w = getFloatParameter("width");
    final float h = getFloatParameter("height");
    final float x = getFloatParameter("x");
    final float y = getFloatParameter("y");
    rect.setFrame(x, y, w, h);

    return rect;
  }
View Full Code Here

    if (!(o instanceof Ellipse2D))
    {
      throw new ObjectFactoryException("The given object is no java.awt.geom.Rectangle2D.");
    }

    final Ellipse2D rect = (Ellipse2D) o;
    final float x = (float) rect.getX();
    final float y = (float) rect.getY();
    final float w = (float) rect.getWidth();
    final float h = (float) rect.getHeight();

    setParameter("x", new Float(x));
    setParameter("y", new Float(y));
    setParameter("width", new Float(w));
    setParameter("height", new Float(h));
View Full Code Here

  {
    if (buggyDrawArea)
    {
      if (area instanceof Ellipse2D)
      {
        final Ellipse2D ellipse2D = (Ellipse2D) area;
        if (ellipse2D.getWidth() == ellipse2D.getHeight())
        {
          return new CircleImageMapEntry((float) (ellipse2D.getCenterX() + dataArea.getX()),
              (float) (ellipse2D.getCenterY() + dataArea.getY()), (float) (ellipse2D.getWidth() / 2));
        }
      }
      else if (area instanceof Rectangle2D)
      {
        final Rectangle2D rect = (Rectangle2D) area;
        return (new RectangleImageMapEntry((float) (rect.getX() + dataArea.getX()),
            (float) (rect.getY() + dataArea.getY()),
            (float) (rect.getX() + rect.getWidth()),
            (float) (rect.getY() + rect.getHeight())));
      }
    }
    else
    {
      if (area instanceof Ellipse2D)
      {
        final Ellipse2D ellipse2D = (Ellipse2D) area;
        if (ellipse2D.getWidth() == ellipse2D.getHeight())
        {
          return new CircleImageMapEntry((float) (ellipse2D.getCenterX()),
              (float) (ellipse2D.getCenterY()), (float) (ellipse2D.getWidth() / 2));
        }
      }
      else if (area instanceof Rectangle2D)
      {
        final Rectangle2D rect = (Rectangle2D) area;
View Full Code Here

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

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

      circleSize = maxSize * (z / maxZ);

      circleSize = Math.abs(circleSize);

      Ellipse2D circle = null;
      if (orientation == PlotOrientation.VERTICAL)
      {
        circle = new Ellipse2D.Double(transX - circleSize / 2.0, transY - circleSize / 2.0, circleSize, circleSize);
      }
      else if (orientation == PlotOrientation.HORIZONTAL)
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);
      }

      Paint paint = getItemPaint(series, item);
      if (paint instanceof GradientPaint)
      {
        paint = new StandardGradientPaintTransformer().transform((GradientPaint)paint, circle);
      }
      g2.setPaint(paint);
      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

    /* (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)
    {
      Ellipse2D ellipse = (Ellipse2D)value;
        if (ellipse == null)
        {
        for (int i = 0; i < exprIndex.length; i++)
        {
          getDataStoreMapping(i).setObject(preparedStatement, exprIndex[i], null);         
      }
        }
        else
        {
            getDataStoreMapping(0).setDouble(preparedStatement,exprIndex[0],ellipse.getX());
            getDataStoreMapping(1).setDouble(preparedStatement,exprIndex[1],ellipse.getY());
            getDataStoreMapping(2).setDouble(preparedStatement,exprIndex[2],ellipse.getWidth());
            getDataStoreMapping(3).setDouble(preparedStatement,exprIndex[3],ellipse.getHeight());
        }
    }
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.