Statistics
| Revision:

svn-document-layout / branches / usability_v2 / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / DefaultLayoutDocument.java @ 147

History | View | Annotate | Download (2.56 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.project.documents.layout;
23

    
24
import org.gvsig.app.project.documents.AbstractDocument;
25
import org.gvsig.app.project.documents.DocumentManager;
26
import org.gvsig.app.project.documents.layout.fframes.FFrame;
27
import org.gvsig.app.project.documents.layout.fframes.FFrameView;
28
import org.gvsig.fmap.mapcontext.MapContext;
29
import org.gvsig.tools.ToolsLocator;
30
import org.gvsig.tools.dynobject.DynStruct;
31
import org.gvsig.tools.persistence.PersistenceManager;
32
import org.gvsig.tools.persistence.PersistentState;
33
import org.gvsig.tools.persistence.exception.PersistenceException;
34

    
35
/**
36
 * Modelo del Layout.
37
 * 
38
 * @author Fernando Gonz?lez Cort?s
39
 */
40
public class DefaultLayoutDocument extends AbstractDocument implements
41
    LayoutDocument {
42

    
43
    private static final long serialVersionUID = 7320640550072493414L;
44
    public static final String PERSISTENCE_DEFINITION_NAME = "DefaultLayoutDocument";
45

    
46
    static final String LAYOUT_CONTEXT_OBJECT = "layoutContext";
47

    
48
    private LayoutContext layoutContext = null;
49

    
50
    public DefaultLayoutDocument(DocumentManager factory) {
51
        super(factory);
52
        this.layoutContext = new DefaultLayoutContext();
53

    
54
    }
55

    
56
    public DefaultLayoutDocument() {
57
        this(null);
58
    }
59

    
60
    public void loadFromState(PersistentState state)
61
        throws PersistenceException {
62
        super.loadFromState(state);
63
        this.layoutContext = (LayoutContext) state.get(LAYOUT_CONTEXT_OBJECT);
64
    }
65

    
66
    public void saveToState(PersistentState state) throws PersistenceException {
67
        super.saveToState(state);
68
        state.set(LAYOUT_CONTEXT_OBJECT, layoutContext);
69
    }
70

    
71
    public LayoutContext getLayoutContext() {
72
        return layoutContext;
73
    }
74

    
75
}