curr[0], curr[1], curr[2], large, goLeft, curr[5], curr[6]); double theta = arc.getAngleStart()+arc.getAngleExtent(); theta = Math.toRadians(theta); dx = -arc.getWidth()/2.0*Math.sin(theta);
curr[0], curr[1], curr[2], large, goLeft, curr[5], curr[6]); double theta = arc.getAngleStart()+arc.getAngleExtent(); theta = Math.toRadians(theta); dx = -arc.getWidth()/2.0*Math.sin(theta);
double ext = arc.getAngleExtent(); double width = arc.getWidth(); double height = arc.getHeight();
double ext = arc.getAngleExtent(); double width = arc.getWidth(); double height = arc.getHeight();
/** * Compares two arcs and returns {@code true} if they are equal or * both {@code null}. * * @param a1 the first arc ({@code null} permitted). * @param a2 the second arc ({@code null} 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; }
/** * 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; }
/** * 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; }
return false; if (a1.getAngleExtent() != a2.getAngleExtent()) { return false;
stream.writeDouble(arc.getHeight()); stream.writeDouble(arc.getAngleStart()); stream.writeDouble(arc.getAngleExtent()); stream.writeInt(arc.getArcType());
stream.writeDouble(arc.getHeight()); stream.writeDouble(arc.getAngleStart()); stream.writeDouble(arc.getAngleExtent()); stream.writeInt(arc.getArcType());
/** {@inheritDoc} */ public void draw(final Shape s) { if (s instanceof Rectangle2D) { final Rectangle2D r2 = (Rectangle2D) s; drawRect(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight()); } else if (s instanceof Ellipse2D) { final Ellipse2D e2 = (Ellipse2D) s; drawOval(e2.getX(), e2.getY(), e2.getWidth(), e2.getHeight()); } else if (s instanceof RoundRectangle2D) { final RoundRectangle2D r2 = (RoundRectangle2D) s; drawRoundRect(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight(), r2.getArcWidth(), r2.getArcHeight()); } else if (s instanceof Arc2D) { final Arc2D a2 = (Arc2D) s; drawArc(a2.getX(), a2.getY(), a2.getWidth(), a2.getHeight(), a2.getAngleStart(), a2.getAngleExtent()); } else { Path p = (Path) SHAPE_CACHE.get(s); if (p == null) { p = pathIterator2Path(s.getPathIterator(null)); SHAPE_CACHE.put(s, p); } drawPath(p); } }
/** {@inheritDoc} */ public void fill(final Shape s) { if (s instanceof Rectangle2D) { final Rectangle2D r2 = (Rectangle2D) s; fillRect(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight()); } else if (s instanceof Ellipse2D) { final Ellipse2D e2 = (Ellipse2D) s; fillOval(e2.getX(), e2.getY(), e2.getWidth(), e2.getHeight()); } else if (s instanceof RoundRectangle2D) { final RoundRectangle2D r2 = (RoundRectangle2D) s; fillRoundRect(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight(), r2.getArcWidth(), r2.getArcHeight()); } else if (s instanceof Arc2D) { final Arc2D a2 = (Arc2D) s; fillArc(a2.getX(), a2.getY(), a2.getWidth(), a2.getHeight(), a2.getAngleStart(), a2.getAngleExtent()); } else { Path p = (Path) SHAPE_CACHE.get(s); if (p == null) { p = pathIterator2Path(s.getPathIterator(null)); SHAPE_CACHE.put(s, p); } fillPath(p); } }
Arc2D arc = (Arc2D) shape; return new Arc2D.Double(arc.getX(), arc.getY(), arc.getWidth(), arc.getHeight(), arc.getAngleStart(), arc.getAngleExtent(), arc.getArcType());
/** * Writes a serializable object description to the given object output stream. * * @param o the to be serialized object. * @param stream the outputstream that should receive the object. * @throws IOException if an I/O error occured. */ public void writeObject( final Object o, final ObjectOutputStream stream ) throws IOException { final Arc2D arc = (Arc2D) o; stream.writeDouble( arc.getX() ); stream.writeDouble( arc.getY() ); stream.writeDouble( arc.getWidth() ); stream.writeDouble( arc.getHeight() ); stream.writeDouble( arc.getAngleStart() ); stream.writeDouble( arc.getAngleExtent() ); stream.writeInt( arc.getArcType() ); }
Arc2D arc = (Arc2D) shape; return new Arc2D.Double(arc.getX(), arc.getY(), arc.getWidth(), arc.getHeight(), arc.getAngleStart(), arc.getAngleExtent(), arc.getArcType());
Arc2D arc = (Arc2D) shape; return new Arc2D.Double(arc.getX(), arc.getY(), arc.getWidth(), arc.getHeight(), arc.getAngleStart(), arc.getAngleExtent(), arc.getArcType());
shapePts[3] = ((Arc2D) shape).getHeight(); shapePts[4] = ((Arc2D) shape).getAngleStart(); shapePts[5] = ((Arc2D) shape).getAngleExtent();
double height = shp.getHeight() + r; double width = shp.getWidth() + r; Shape origin = new Arc2D.Double(x, y, width, height, shp.getAngleStart(), shp.getAngleExtent(), shp.getArcType()); Shape halo = at.createTransformedShape(origin); fillHalo(halo, atShp, g2, map, selected, mt, substract);
final Arc2D a2 = (Arc2D) aShape; return new Arc2D.Double(a2.getX(), a2.getY(), a2.getWidth(), a2.getHeight(), a2.getAngleStart(), a2 .getAngleExtent(), a2.getArcType());
put(arc.getHeight()); put(arc.getAngleStart()); put(arc.getAngleExtent()); put(arc.getArcType()); } else if (shape instanceof Line2D) {