Compares two ellipses and returns true if they are equal or both null. : Ellipse « 2D Graphics « Java Tutorial






import java.awt.geom.Ellipse2D;

public class Main {



  /**
   * Compares two ellipses and returns <code>true</code> if they are equal or
   * both <code>null</code>.
   *
   * @param e1  the first ellipse (<code>null</code> permitted).
   * @param e2  the second ellipse (<code>null</code> permitted).
   *
   * @return A boolean.
   */
  public static boolean equal(final Ellipse2D e1, final Ellipse2D e2) {
      if (e1 == null) {
          return (e2 == null);
      }
      if (e2 == null) {
          return false;
      }
      if (!e1.getFrame().equals(e2.getFrame())) {
          return false;
      }
      return true;
  }

}








16.16.Ellipse
16.16.1.Create an ellipse, and then draws it several times at different rotationsCreate an ellipse, and then draws it several times at different rotations
16.16.2.Draw Ellipse2D.Float
16.16.3.Create an complex shape by rotating an ellipse.
16.16.4.Compares two ellipses and returns true if they are equal or both null.