01: /*
02: * Copyright (C) 2005 Jeff Tassin
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package com.jeta.swingbuilder.store;
20:
21: import java.awt.Rectangle;
22: import java.io.Externalizable;
23: import java.io.IOException;
24:
25: public class FrameState implements Externalizable {
26: static final long serialVersionUID = -2421986789797208149L;
27:
28: /**
29: * verion of this class
30: */
31: public static final int VERSION = 1;
32:
33: private boolean m_docked;
34: private Rectangle m_bounds;
35:
36: public FrameState() {
37: m_docked = true;
38: m_bounds = new Rectangle();
39: }
40:
41: public FrameState(Rectangle bounds) {
42: m_docked = false;
43: m_bounds = new Rectangle();
44: if (bounds != null)
45: m_bounds.setBounds(bounds.x, bounds.y, bounds.width,
46: bounds.height);
47: }
48:
49: public boolean isDocked() {
50: return m_docked;
51: }
52:
53: public Rectangle getBounds() {
54: return m_bounds;
55: }
56:
57: /**
58: * Externalizable Implementation
59: */
60: public void readExternal(java.io.ObjectInput in)
61: throws ClassNotFoundException, IOException {
62: int version = in.readInt();
63: m_docked = in.readBoolean();
64: m_bounds = (Rectangle) in.readObject();
65: }
66:
67: /**
68: * Externalizable Implementation
69: */
70: public void writeExternal(java.io.ObjectOutput out)
71: throws IOException {
72: out.writeInt(VERSION);
73: out.writeBoolean(m_docked);
74: out.writeObject(m_bounds);
75: }
76: }
|