@Override public void writeConstructorParams( DataOutput out ) throws IOException { super.writeConstructorParams( out ); ImageComponent2D ic = ((ImageComponent2D)node); // If the BufferedImage is associated with the ImageComponent2D by // reference then we don't know much about it, so it'd be hard to // save. So we copy it into an ImageComponent2D and then copy it // out. It comes out in a known format so it's easier to save. if ( ic.isByReference() ) { ImageComponent2D noByRef = new ImageComponent2D( ic.getFormat(), ic.getRenderedImage(), false, ic.isYUp() ); bufferedImage = noByRef.getImage(); } else bufferedImage = ic.getImage(); writeBufferedImage( out, bufferedImage ); }