e.setPersistenceDelegate(Area.class, new AreaDelegate());
e.setPersistenceDelegate(GeneralPath.class, new GeneralPathDelegate());
e.setPersistenceDelegate(AffineTransform.class, new AffineTransformDelegate());
e.setPersistenceDelegate(RadialGradientPaint.class, new RadialGradientPaintDelegate());
e.setPersistenceDelegate(LinearGradientPaint.class, new LinearGradientPaintDelegate());
e.setPersistenceDelegate(Insets.class, new InsetsDelegate());
e.writeObject(compoundPainter);
e.close();
}