KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtriver > open > vectorvisuals > persistence > CubicCurvePersistenceDelegate


1 /*
2  * CubicCurvePersistenceDelegate.java
3  *
4  * Created on Oct 27, 2005, 3:41 PM
5  */

6 package com.thoughtriver.open.vectorvisuals.persistence;
7
8 import java.awt.geom.*;
9 import java.beans.*;
10
11 /**
12  * This delegate provides persistence capability for <CODE>CubicCurve2D</CODE>
13  * instances.
14  *
15  * @author Brandon Franklin
16  * @version $Date: 2006/11/25 09:08:28 $
17  */

18 public class CubicCurvePersistenceDelegate extends DefaultPersistenceDelegate {
19
20     /**
21      * {@inheritDoc}
22      */

23     @Override JavaDoc
24     protected void initialize(final Class JavaDoc<?> type, final Object JavaDoc oldInstance, final Object JavaDoc newInstance, final Encoder out) {
25         super.initialize(type, oldInstance, newInstance, out);
26         CubicCurve2D curve = (CubicCurve2D) oldInstance;
27         out.writeStatement(new Statement(oldInstance, "setCurve", new Object JavaDoc[] {
28                 curve.getX1(),
29                 curve.getY1(),
30                 curve.getCtrlX1(),
31                 curve.getCtrlY1(),
32                 curve.getCtrlX2(),
33                 curve.getCtrlY2(),
34                 curve.getX2(),
35                 curve.getY2()
36         }));
37
38     }
39
40 }
41
Popular Tags