1 6 package com.thoughtriver.open.vectorvisuals.persistence; 7 8 import java.awt.geom.*; 9 import java.beans.*; 10 11 18 public class RectangularShapePersistenceDelegate extends DefaultPersistenceDelegate { 19 20 23 @Override 24 protected void initialize(final Class <?> type, final Object oldInstance, final Object newInstance, final Encoder out) { 25 super.initialize(type, oldInstance, newInstance, out); 26 RectangularShape shape = (RectangularShape) oldInstance; 27 Rectangle2D frame = shape.getFrame(); 28 out.writeStatement(new Statement(oldInstance, "setFrame", new Object [] { 29 frame.getX(), frame.getY(), frame.getWidth(), frame.getHeight() 30 })); 31 } 32 33 } 34 | Popular Tags |