import java.io.*;
/**
* Created by IntelliJ IDEA.
* User: me
* Date: 15.09.2006
* Time: 17:18:46
* To change this template use File | Settings | File Templates.
*/
private static final long
serialVersionUID = -1300779387465845764L;
private double x1,y1,x2,y2;
transient private double x, y;
transient private double width, height;
public Rectangle(double x,
double y,
double width,
double height
) { this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
{
fields = in.readFields();
x = fields.get("x1", 0.0);
y = fields.get("y1", 0.0);
double x2 = fields.get("x2", 0.0);
double y2 = fields.get("y2", 0.0);
width = (x2 - x);
height = (y2 - y);
System.
out.
println("readObject is called!");
}
{
fields.put("x1", x);
fields.put("y1", y);
fields.put("x2", x + width);
fields.put("y2", y + height);
System.
out.
println("writeObject is called!");
}
SerialPersistentFields = {
};
return "x:" + x + " y:" + y + " width:" + width +
" height:" + height + " x1:" + x1 + " x2:" + x2 + " y1:" + y1 + " y2:" + y2;
}
}