Java Code Examples for java.awt.geom.Arc2D#getArcType()

The following examples show how to use java.awt.geom.Arc2D#getArcType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShapeUtilities.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(final Arc2D a1, final Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 2
Source File: Elixir_001_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 3
Source File: Elixir_001_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 4
Source File: Chart_11_ShapeUtilities_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 5
Source File: Chart_11_ShapeUtilities_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 6
Source File: ShapeUtilities.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 7
Source File: ShapeUtilities.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
Example 8
Source File: GraphicsUtils.java    From jfreesvg with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a shape that is (more or less) equivalent to the supplied shape.
 * For some known shape implementations ({@code Line2D}, 
 * {@code Rectangle2D}, {@code RoundRectangle2D}, {@code Arc2D}, 
 * {@code Ellipse2D}, and {@code Polygon}) the copy will be an instance of 
 * that class.  For other shapes, a {@code Path2D} containing the outline 
 * of the shape is returned.
 * 
 * @param shape  the shape ({@code null} not permitted).
 * 
 * @return A copy of the shape or shape outline (never {@code null}). 
 */
public static Shape copyOf(Shape shape) {
   Args.nullNotPermitted(shape, "shape");
   if (shape instanceof Line2D) {
       Line2D l = (Line2D) shape;
       return new Line2D.Double(l.getX1(), l.getY1(), l.getX2(), l.getY2());
   }
   if (shape instanceof Rectangle2D) {
       Rectangle2D r = (Rectangle2D) shape;
       return new Rectangle2D.Double(r.getX(), r.getY(), r.getWidth(), 
               r.getHeight());
   }
   if (shape instanceof RoundRectangle2D) {
       RoundRectangle2D rr = (RoundRectangle2D) shape;
       return new RoundRectangle2D.Double(rr.getX(), rr.getY(), 
               rr.getWidth(), rr.getHeight(), rr.getArcWidth(), 
               rr.getArcHeight());
   }
   if (shape instanceof Arc2D) {
       Arc2D arc = (Arc2D) shape;
       return new Arc2D.Double(arc.getX(), arc.getY(), arc.getWidth(),
               arc.getHeight(), arc.getAngleStart(), arc.getAngleExtent(),
               arc.getArcType());
   }
   if (shape instanceof Ellipse2D) {
       Ellipse2D ell = (Ellipse2D) shape;
       return new Ellipse2D.Double(ell.getX(), ell.getY(), ell.getWidth(),
               ell.getHeight());
   }
   if (shape instanceof Polygon) {
       Polygon p = (Polygon) shape;
       return new Polygon(p.xpoints, p.ypoints, p.npoints);
   }
   return new Path2D.Double(shape);
}