Examples of Ellipse2D


Examples of java.awt.geom.Ellipse2D

   
    double ellipseWidth = (double)width * 1.5;
    double ellipseHeight = (double)height * 1.1;
    double x = (double)width / 2.0 - ellipseWidth / 2.0;
    double y = ellipseHeight * -0.55;
    Ellipse2D shape = new Ellipse2D.Double(x, y, ellipseWidth, ellipseHeight);
    Graphics2D graphics = image.createGraphics();
    try {
      graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      graphics.setPaint(new GradientPaint(0f, 0f, bright.brighter(), 0f, (float)shape.getHeight(), dark.brighter()));
      graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
      graphics.fill(shape);
    } finally {
      graphics.dispose();
    }
View Full Code Here

Examples of java.awt.geom.Ellipse2D

     * @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

Examples of java.awt.geom.Ellipse2D

     * @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

Examples of java.awt.geom.Ellipse2D

        assertNotNull(box);
        checkBounds(17, 1, 7, box);
        box = view.modelToView(4, new Rectangle(0, 0, 1, 1), Position.Bias.Forward);
        assertNotNull(box);
        checkBounds(1, 0, 1, box);
        Ellipse2D ellipse = new Ellipse2D.Float(25, 3, 30, 40);
        box = view.modelToView(4, ellipse, Position.Bias.Forward);
        checkBounds(55, 3, 40, box);
        box = view.modelToView(4, ellipse, Position.Bias.Backward);
        assertNotNull(box);
        checkBounds(55, 3, 40, box);
View Full Code Here

Examples of java.awt.geom.Ellipse2D

        checkViewToModel(shape, 12, 5);
        checkViewToModel(shape, 15, 5);
        checkViewToModel(shape, 16, 5);
        checkViewToModel(shape, 30, 5);
        checkViewToModel(shape, 46, 5);
        final Ellipse2D floatEllipse = new Ellipse2D.Float(25, 3, 3, 4);
        checkViewToModelWithEllipse(floatEllipse);
        Ellipse2D intEllipse = new Ellipse2D() {
            @Override
            public double getX() {
                return 25;
            }
View Full Code Here

Examples of java.awt.geom.Ellipse2D

   * @throws IOException if an I/O error occured.
   */
  public void writeObject (final Object o, final ObjectOutputStream out)
          throws IOException
  {
    final Ellipse2D ellipse = (Ellipse2D) o;
    out.writeDouble(ellipse.getX());
    out.writeDouble(ellipse.getY());
    out.writeDouble(ellipse.getWidth());
    out.writeDouble(ellipse.getHeight());
  }
View Full Code Here

Examples of java.awt.geom.Ellipse2D

   *
   * @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

Examples of java.awt.geom.Ellipse2D

    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

Examples of java.awt.geom.Ellipse2D

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

Examples of java.awt.geom.Ellipse2D

   * @param height the height of the oval to be filled.
   * @see java.awt.Graphics#drawOval
   */
  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
TOP
Copyright © 2018 www.massapi.com. 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.