svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / layers / MappingAnnotation.java @ 40559
History | View | Annotate | Download (3.97 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.mapcontext.layers; |
25 |
|
26 |
import org.gvsig.tools.ToolsLocator; |
27 |
import org.gvsig.tools.dynobject.DynStruct; |
28 |
import org.gvsig.tools.persistence.PersistenceManager; |
29 |
import org.gvsig.tools.persistence.Persistent; |
30 |
import org.gvsig.tools.persistence.PersistentState; |
31 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
32 |
|
33 |
/**
|
34 |
*
|
35 |
* @deprecated
|
36 |
*
|
37 |
*/
|
38 |
public class MappingAnnotation implements Persistent { |
39 |
|
40 |
private int columnText = -1; |
41 |
private int columnRotate = -1; |
42 |
private int columnColor = -1; |
43 |
private int columnHeight = -1; |
44 |
private int columnTypeFont = -1; |
45 |
private int columnStyleFont = -1; |
46 |
|
47 |
public MappingAnnotation() {
|
48 |
|
49 |
} |
50 |
|
51 |
public int getColumnColor() { |
52 |
return columnColor;
|
53 |
} |
54 |
|
55 |
public void setColumnColor(int columnColor) { |
56 |
this.columnColor = columnColor;
|
57 |
} |
58 |
|
59 |
public int getColumnHeight() { |
60 |
return columnHeight;
|
61 |
} |
62 |
|
63 |
public void setColumnHeight(int columnHeight) { |
64 |
this.columnHeight = columnHeight;
|
65 |
} |
66 |
|
67 |
public int getColumnRotate() { |
68 |
return columnRotate;
|
69 |
} |
70 |
|
71 |
public void setColumnRotate(int columnRotate) { |
72 |
this.columnRotate = columnRotate;
|
73 |
} |
74 |
|
75 |
public int getColumnStyleFont() { |
76 |
return columnStyleFont;
|
77 |
} |
78 |
|
79 |
public void setColumnStyleFont(int columnStyleFont) { |
80 |
this.columnStyleFont = columnStyleFont;
|
81 |
} |
82 |
|
83 |
public int getColumnText() { |
84 |
return columnText;
|
85 |
} |
86 |
|
87 |
public void setColumnText(int columnText) { |
88 |
this.columnText = columnText;
|
89 |
} |
90 |
|
91 |
public int getColumnTypeFont() { |
92 |
return columnTypeFont;
|
93 |
} |
94 |
|
95 |
public void setColumnTypeFont(int columnTypeFont) { |
96 |
this.columnTypeFont = columnTypeFont;
|
97 |
} |
98 |
|
99 |
public void loadFromState(PersistentState state) |
100 |
throws PersistenceException {
|
101 |
|
102 |
columnText = state.getInt("columnText");
|
103 |
columnRotate = state.getInt("columnRotate");
|
104 |
columnColor = state.getInt("columnColor");
|
105 |
columnHeight = state.getInt("columnHeight");
|
106 |
columnTypeFont = state.getInt("columnTypeFont");
|
107 |
columnStyleFont = state.getInt("columnStyleFont");
|
108 |
} |
109 |
|
110 |
public void saveToState(PersistentState state) throws PersistenceException { |
111 |
|
112 |
state.set("columnText", columnText);
|
113 |
state.set("columnRotate", columnRotate);
|
114 |
state.set("columnColor", columnColor);
|
115 |
state.set("columnHeight", columnHeight);
|
116 |
state.set("columnTypeFont", columnTypeFont);
|
117 |
state.set("columnStyleFont", columnStyleFont);
|
118 |
|
119 |
} |
120 |
|
121 |
public static void registerPersistent() { |
122 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
123 |
DynStruct definition = manager.addDefinition( |
124 |
MappingAnnotation.class, |
125 |
"MappingAnnotation",
|
126 |
"MappingAnnotation Persistence definition",
|
127 |
null,
|
128 |
null
|
129 |
); |
130 |
definition.addDynFieldInt("columnText").setMandatory(true); |
131 |
definition.addDynFieldInt("columnRotate").setMandatory(true); |
132 |
definition.addDynFieldInt("columnColor").setMandatory(true); |
133 |
definition.addDynFieldInt("columnHeight").setMandatory(true); |
134 |
definition.addDynFieldInt("columnTypeFont").setMandatory(true); |
135 |
definition.addDynFieldInt("columnStyleFont").setMandatory(true); |
136 |
} |
137 |
|
138 |
|
139 |
} |