public static void writePoint2D(Point2D p, ObjectOutputStream stream) { if (stream == null) { string str = "Null 'stream' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else if (p != null) { stream.writeBoolean(false); stream.writeDouble(p.getX()); stream.writeDouble(p.getY()); } else stream.writeBoolean(true); }
public static void writeShape(Shape shape, ObjectOutputStream stream) { if (stream == null) { string str = "Null 'stream' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else if (shape != null) { stream.writeBoolean(false); if (shape is Line2D) { Line2D line2D = (Line2D) shape; stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D = SerialUtilities.class\u0024("java.awt.geom.Line2D"))); stream.writeDouble(line2D.getX1()); stream.writeDouble(line2D.getY1()); stream.writeDouble(line2D.getX2()); stream.writeDouble(line2D.getY2()); } else if (shape is Rectangle2D) { Rectangle2D rectangle2D = (Rectangle2D) shape; stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D = SerialUtilities.class\u0024("java.awt.geom.Rectangle2D"))); stream.writeDouble(((RectangularShape) rectangle2D).getX()); stream.writeDouble(((RectangularShape) rectangle2D).getY()); stream.writeDouble(((RectangularShape) rectangle2D).getWidth()); stream.writeDouble(((RectangularShape) rectangle2D).getHeight()); } else if (shape is Ellipse2D) { Ellipse2D ellipse2D = (Ellipse2D) shape; stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D = SerialUtilities.class\u0024("java.awt.geom.Ellipse2D"))); stream.writeDouble(((RectangularShape) ellipse2D).getX()); stream.writeDouble(((RectangularShape) ellipse2D).getY()); stream.writeDouble(((RectangularShape) ellipse2D).getWidth()); stream.writeDouble(((RectangularShape) ellipse2D).getHeight()); } else if (shape is Arc2D) { Arc2D arc2D = (Arc2D) shape; stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D = SerialUtilities.class\u0024("java.awt.geom.Arc2D"))); stream.writeDouble(((RectangularShape) arc2D).getX()); stream.writeDouble(((RectangularShape) arc2D).getY()); stream.writeDouble(((RectangularShape) arc2D).getWidth()); stream.writeDouble(((RectangularShape) arc2D).getHeight()); stream.writeDouble(arc2D.getAngleStart()); stream.writeDouble(arc2D.getAngleExtent()); stream.writeInt(arc2D.getArcType()); } else if (shape is GeneralPath) { stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath = SerialUtilities.class\u0024("java.awt.geom.GeneralPath"))); PathIterator pathIterator = shape.getPathIterator((AffineTransform) null); float[] numArray = new float[6]; stream.writeBoolean(pathIterator.isDone()); while (!pathIterator.isDone()) { int num = pathIterator.currentSegment(numArray); stream.writeInt(num); for (int index = 0; index < 6; ++index) stream.writeFloat(numArray[index]); stream.writeInt(pathIterator.getWindingRule()); pathIterator.next(); stream.writeBoolean(pathIterator.isDone()); } } else { stream.writeObject((object) Object.instancehelper_getClass((object) shape)); stream.writeObject((object) shape); } } else stream.writeBoolean(true); }