Revision 2378
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/wizard/LayerTreeModel.java | ||
---|---|---|
22 | 22 |
|
23 | 23 |
package org.gvsig.raster.wms.app.wmsclient.gui.wizard; |
24 | 24 |
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.Vector; |
|
25 |
import java.util.List; |
|
27 | 26 |
|
28 | 27 |
import javax.swing.event.TreeModelListener; |
29 | 28 |
import javax.swing.tree.TreeModel; |
... | ... | |
84 | 83 |
|
85 | 84 |
/** |
86 | 85 |
* @param node, the tree's desired node. |
87 |
* @return Returns the namedStyles. |
|
88 |
*/ |
|
89 |
public ArrayList getStyles(Object node) { |
|
90 |
return ((WMSLayerNode) node).getStyles(); |
|
91 |
} |
|
92 |
/** |
|
93 |
* @param node, the tree's desired node. |
|
94 | 86 |
* @return Returns the queryable. |
95 | 87 |
*/ |
96 | 88 |
public boolean isQueryable(Object node) { |
... | ... | |
101 | 93 |
* @param node, the tree's desired node. |
102 | 94 |
* @return Returns the srs. |
103 | 95 |
*/ |
104 |
public Vector getSrs(Object node) {
|
|
96 |
public List<String> getSrs(Object node) {
|
|
105 | 97 |
return ((WMSLayerNode) node).getAllSrs(); |
106 | 98 |
} |
107 | 99 |
/** |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSLayerNode.java | ||
---|---|---|
24 | 24 |
import java.awt.Dimension; |
25 | 25 |
import java.util.ArrayList; |
26 | 26 |
import java.util.List; |
27 |
import java.util.Vector; |
|
28 | 27 |
|
29 | 28 |
import org.gvsig.raster.wms.io.time.DefaultDimension; |
30 | 29 |
import org.gvsig.raster.wms.io.time.RemoteTimeDimension; |
... | ... | |
44 | 43 |
public class WMSLayerNode implements Persistent { |
45 | 44 |
private String _name = null; |
46 | 45 |
private String _title = null; |
47 |
private Vector srs = null;
|
|
46 |
private List<String> srs = null;
|
|
48 | 47 |
private boolean queryable; |
49 | 48 |
private boolean transparency; |
50 | 49 |
private String lAbstract = null; |
51 | 50 |
private String latLonBox = null; |
52 | 51 |
private int selectedStyleIndex = 0; |
53 |
private ArrayList<RemoteWMSStyle> styles = new ArrayList<RemoteWMSStyle>();
|
|
54 |
private ArrayList<RemoteTimeDimension> dimensions = null;
|
|
55 |
private ArrayList<String> keywords = null;
|
|
56 |
private ArrayList children = new ArrayList();
|
|
52 |
private List<RemoteWMSStyle> styles = new ArrayList<RemoteWMSStyle>();
|
|
53 |
private List<RemoteTimeDimension> dimensions = null;
|
|
54 |
private List<String> keywords = null;
|
|
55 |
private List<WMSLayerNode> children = new ArrayList<WMSLayerNode>();
|
|
57 | 56 |
private WMSLayerNode _parent = null; |
58 | 57 |
private Dimension fixedSize = null; |
59 | 58 |
|
60 |
/* |
|
61 |
* (non-Javadoc) |
|
62 |
* @see org.gvsig.tools.persistence.Persistent#loadFromState(org.gvsig.tools.persistence.PersistentState) |
|
63 |
*/ |
|
64 | 59 |
public void loadFromState(PersistentState state) throws PersistenceException { |
65 | 60 |
this._name = state.getString("_name"); |
66 | 61 |
this._title = state.getString("_title"); |
67 |
|
|
68 |
List<String> srs = state.getList("srs"); |
|
69 |
if(srs != null) { |
|
70 |
this.srs = new Vector(); |
|
71 |
this.srs.addAll(srs); |
|
72 |
} |
|
73 |
|
|
62 |
this.srs = state.getList("srs"); |
|
74 | 63 |
this.queryable = state.getBoolean("queryable"); |
75 | 64 |
this.transparency = state.getBoolean("transparency"); |
76 | 65 |
this.lAbstract = state.getString("lAbstract"); |
77 | 66 |
this.latLonBox = state.getString("latLonBox"); |
78 | 67 |
this.selectedStyleIndex = state.getInt("selectedStyleIndex"); |
79 |
|
|
80 |
List<RemoteWMSStyle> styles = state.getList("styles"); |
|
81 |
if(styles != null) { |
|
82 |
this.styles = new ArrayList<RemoteWMSStyle>(); |
|
83 |
this.styles.addAll(styles); |
|
84 |
} |
|
85 |
|
|
86 |
List<RemoteTimeDimension> dimensions = state.getList("dimensions"); |
|
87 |
if(dimensions != null) { |
|
88 |
this.dimensions = new ArrayList<RemoteTimeDimension>(); |
|
89 |
this.dimensions.addAll(dimensions); |
|
90 |
} |
|
91 |
|
|
92 |
List<String> keywords = state.getList("keywords"); |
|
93 |
if(keywords != null) { |
|
94 |
this.keywords = new ArrayList<String>(); |
|
95 |
this.keywords.addAll(keywords); |
|
96 |
} |
|
97 |
|
|
98 |
List<WMSLayerNode> children = state.getList("children"); |
|
99 |
if(children != null) { |
|
100 |
this.children = new ArrayList<WMSLayerNode>(); |
|
101 |
this.children.addAll(children); |
|
102 |
} |
|
103 |
|
|
68 |
this.styles = state.getList("styles"); |
|
69 |
this.dimensions = state.getList("dimensions"); |
|
70 |
this.keywords = state.getList("keywords"); |
|
71 |
this.children = state.getList("children"); |
|
104 | 72 |
this._parent = (WMSLayerNode)state.get("_parent"); |
105 | 73 |
this.fixedSize = (Dimension)state.get("fixedSize"); |
106 | 74 |
} |
107 | 75 |
|
108 |
/* |
|
109 |
* (non-Javadoc) |
|
110 |
* @see org.gvsig.tools.persistence.Persistent#saveToState(org.gvsig.tools.persistence.PersistentState) |
|
111 |
*/ |
|
112 | 76 |
public void saveToState(PersistentState state) throws PersistenceException { |
113 | 77 |
state.set("_name", _name); |
114 | 78 |
state.set("_title", _title); |
... | ... | |
162 | 126 |
return _name; |
163 | 127 |
} |
164 | 128 |
|
165 |
public ArrayList getChildren() {
|
|
129 |
public List<WMSLayerNode> getChildren() {
|
|
166 | 130 |
return children; |
167 | 131 |
} |
168 | 132 |
|
... | ... | |
176 | 140 |
/** |
177 | 141 |
* @return Returns the namedStyles. |
178 | 142 |
*/ |
179 |
public ArrayList<RemoteWMSStyle> getStyles() {
|
|
143 |
public List<RemoteWMSStyle> getStyles() { |
|
180 | 144 |
return styles; |
181 | 145 |
} |
182 | 146 |
|
183 |
public ArrayList<String> getKeywords() {
|
|
147 |
public List<String> getKeywords() { |
|
184 | 148 |
return keywords; |
185 | 149 |
} |
186 | 150 |
|
... | ... | |
201 | 165 |
/** |
202 | 166 |
* @return Returns the srs. |
203 | 167 |
*/ |
204 |
public Vector getAllSrs() {
|
|
168 |
public List<String> getAllSrs() {
|
|
205 | 169 |
if ((srs.size() == 0) && _parent!=null) |
206 | 170 |
return _parent.getAllSrs(); |
207 | 171 |
return srs; |
... | ... | |
210 | 174 |
/** |
211 | 175 |
* @param srs The srs to set. |
212 | 176 |
*/ |
213 |
public void setSrs(Vector srs) {
|
|
177 |
public void setSrs(List<String> srs) {
|
|
214 | 178 |
this.srs = srs; |
215 | 179 |
} |
216 | 180 |
|
... | ... | |
221 | 185 |
return _title; |
222 | 186 |
} |
223 | 187 |
|
224 |
/* |
|
225 |
* (non-Javadoc) |
|
226 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#setTitle(java.lang.String) |
|
227 |
*/ |
|
228 | 188 |
public void setTitle(String title) { |
229 | 189 |
this._title = title.trim(); |
230 | 190 |
} |
... | ... | |
247 | 207 |
* Sets the list of sons of this layer. |
248 | 208 |
* @param children |
249 | 209 |
*/ |
250 |
public void setChildren(ArrayList children) {
|
|
210 |
public void setChildren(List<WMSLayerNode> children) {
|
|
251 | 211 |
this.children = children; |
252 | 212 |
} |
253 | 213 |
|
254 |
/* |
|
255 |
* (non-Javadoc) |
|
256 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#getParent() |
|
257 |
*/ |
|
258 | 214 |
public WMSLayerNode getParent() { |
259 | 215 |
return _parent; |
260 | 216 |
} |
261 | 217 |
|
262 |
/* |
|
263 |
* (non-Javadoc) |
|
264 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#setParent(org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode) |
|
265 |
*/ |
|
266 | 218 |
public void setParent(WMSLayerNode parentNode) { |
267 | 219 |
this._parent = parentNode; |
268 | 220 |
} |
269 | 221 |
|
270 |
/* |
|
271 |
* (non-Javadoc) |
|
272 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#getDimensions() |
|
273 |
*/ |
|
274 |
public ArrayList<RemoteTimeDimension> getDimensions() { |
|
222 |
public List<RemoteTimeDimension> getDimensions() { |
|
275 | 223 |
return dimensions; |
276 | 224 |
} |
277 | 225 |
|
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/downloader/TileDownloaderForWMS.java | ||
---|---|---|
24 | 24 |
import java.awt.geom.Rectangle2D; |
25 | 25 |
import java.io.File; |
26 | 26 |
import java.io.IOException; |
27 |
import java.util.List; |
|
28 |
import java.util.Vector; |
|
27 | 29 |
|
28 | 30 |
import org.cresques.cts.IProjection; |
29 | 31 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
... | ... | |
44 | 46 |
import org.gvsig.raster.impl.provider.RasterProvider; |
45 | 47 |
import org.gvsig.raster.impl.provider.tile.BaseTileDownloader; |
46 | 48 |
import org.gvsig.raster.util.DefaultProviderServices; |
49 |
import org.gvsig.raster.wms.io.RemoteWMSStyle; |
|
47 | 50 |
import org.gvsig.raster.wms.io.WMSConnector; |
48 | 51 |
import org.gvsig.raster.wms.io.WMSDataParameters; |
49 | 52 |
import org.gvsig.raster.wms.io.WMSProvider; |
... | ... | |
81 | 84 |
wmsStatus.setLayerNames(Utilities.createVector(p.getLayerQuery(), ",")); |
82 | 85 |
wmsStatus.setSrs(p.getSRSCode()); |
83 | 86 |
wmsStatus.setFormat(p.getFormat()); |
84 |
wmsStatus.setStyles(p.getStyles()); |
|
87 |
List<RemoteWMSStyle> listStyles = p.getStyles(); |
|
88 |
Vector<?> v = listStyles != null ? new Vector<RemoteWMSStyle>(listStyles) : null; |
|
89 |
wmsStatus.setStyles(v); |
|
85 | 90 |
wmsStatus.setDimensions(p.getDimensions()); |
86 | 91 |
wmsStatus.setTransparency(p.isWmsTransparent()); |
87 | 92 |
wmsStatus.setOnlineResource((String) p.getOnlineResource().get("GetMap")); |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/time/DefaultDimension.java | ||
---|---|---|
111 | 111 |
definition.addDynFieldInt("type").setMandatory(false); |
112 | 112 |
definition.addDynFieldBoolean("compiled").setMandatory(false); |
113 | 113 |
} |
114 |
|
|
115 |
public DefaultDimension() {} |
|
116 |
|
|
114 | 117 |
/** |
115 | 118 |
* Creates a new instance of DefaultDimension. |
116 | 119 |
* @param _name |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/time/TimeDimension.java | ||
---|---|---|
76 | 76 |
|
77 | 77 |
private String unit; |
78 | 78 |
private String unitSymbol; |
79 |
private ArrayList<Object> valueList; |
|
79 |
private List<GregorianCalendar> |
|
80 |
valueList; |
|
80 | 81 |
private boolean compiled; |
81 | 82 |
private boolean isGeologic; |
82 | 83 |
private String expression; |
... | ... | |
108 | 109 |
static private final String geologicDatasets = "(K|M|G)"; |
109 | 110 |
static private final String regexDateForGeologicDatasets = geologicDatasets+floatingPointNumber; |
110 | 111 |
|
111 |
/* |
|
112 |
* (non-Javadoc) |
|
113 |
* @see org.gvsig.tools.persistence.Persistent#loadFromState(org.gvsig.tools.persistence.PersistentState) |
|
114 |
*/ |
|
115 | 112 |
@SuppressWarnings("unchecked") |
116 | 113 |
public void loadFromState(PersistentState state) throws PersistenceException { |
117 | 114 |
this.unit = state.getString("unit"); |
118 | 115 |
this.unitSymbol = state.getString("unitSymbol"); |
119 | 116 |
|
120 |
List<Object> list = state.getList("valueList"); |
|
121 |
if(list != null) { |
|
122 |
ArrayList<Object> valueList = new ArrayList<Object>(); |
|
123 |
valueList.addAll(list); |
|
124 |
} |
|
117 |
List<String> list = (List<String>)state.getList("valueList"); |
|
118 |
valueList = convertStringListToGregorianCalendarList(list); |
|
125 | 119 |
|
126 | 120 |
this.compiled = state.getBoolean("compiled"); |
127 | 121 |
this.isGeologic = state.getBoolean("isGeologic"); |
... | ... | |
133 | 127 |
public void saveToState(PersistentState state) throws PersistenceException { |
134 | 128 |
state.set("unit", unit); |
135 | 129 |
state.set("unitSymbol", unitSymbol); |
136 |
state.set("valueList", valueList);
|
|
130 |
state.set("valueList", convertGregorianCalendarListToStringList(valueList));
|
|
137 | 131 |
state.set("compiled", compiled); |
138 | 132 |
state.set("isGeologic", isGeologic); |
139 | 133 |
state.set("expression", expression); |
... | ... | |
141 | 135 |
state.set("format", format); |
142 | 136 |
} |
143 | 137 |
|
138 |
private List<String> convertGregorianCalendarListToStringList(List<GregorianCalendar> gList) { |
|
139 |
List<String> l = new ArrayList<String>(); |
|
140 |
for (int i = 0; i < gList.size(); i++) { |
|
141 |
l.add(toString(gList.get(i))); |
|
142 |
} |
|
143 |
return l; |
|
144 |
} |
|
145 |
|
|
146 |
private List<GregorianCalendar> convertStringListToGregorianCalendarList(List<String> sList) { |
|
147 |
List<GregorianCalendar> l = new ArrayList<GregorianCalendar>(); |
|
148 |
for (int i = 0; i < sList.size(); i++) { |
|
149 |
l.add(valueOf(sList.get(i))); |
|
150 |
} |
|
151 |
return l; |
|
152 |
} |
|
153 |
|
|
144 | 154 |
public static void registerPersistent() { |
145 | 155 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
146 |
DynStruct definition = manager.getDefinition("DefaultDimension_Persistent");
|
|
156 |
DynStruct definition = manager.getDefinition("TimeDimension_Persistent");
|
|
147 | 157 |
if( definition == null ) { |
148 | 158 |
definition = manager.addDefinition( |
149 |
DefaultDimension.class,
|
|
150 |
"DefaultDimension_Persistent",
|
|
151 |
"DefaultDimension Persistence",
|
|
159 |
TimeDimension.class,
|
|
160 |
"TimeDimension_Persistent",
|
|
161 |
"TimeDimension Persistence",
|
|
152 | 162 |
null, |
153 | 163 |
null |
154 | 164 |
); |
... | ... | |
163 | 173 |
definition.addDynFieldInt("type").setMandatory(false); |
164 | 174 |
definition.addDynFieldInt("format").setMandatory(false); |
165 | 175 |
} |
176 |
|
|
177 |
public TimeDimension() {} |
|
178 |
|
|
166 | 179 |
/** |
167 | 180 |
* Creates a new instance of TimeDimension. |
168 | 181 |
* @param units |
... | ... | |
188 | 201 |
} |
189 | 202 |
|
190 | 203 |
public String getLowLimit() { |
191 |
return (String) valueList.get(0);
|
|
204 |
return valueAt(0);
|
|
192 | 205 |
} |
193 | 206 |
|
194 | 207 |
public String getHighLimit() { |
195 |
return (String) valueList.get(valueList.size()-1);
|
|
208 |
return valueAt(valueList.size() - 1);
|
|
196 | 209 |
} |
197 | 210 |
|
198 | 211 |
|
... | ... | |
204 | 217 |
return (value.matches(regexDateForGeologicDatasets) || value.matches(regexDateExtendedForBCE)); |
205 | 218 |
} |
206 | 219 |
|
207 |
public Object valueOf(String value) throws IllegalArgumentException {
|
|
220 |
public GregorianCalendar valueOf(String value) throws IllegalArgumentException {
|
|
208 | 221 |
if (compiled) { |
209 | 222 |
String myValue = value.toUpperCase(); |
210 | 223 |
if (isValidValue(myValue)) { |
211 |
Object val = null;
|
|
224 |
GregorianCalendar val = null;
|
|
212 | 225 |
if (!isGeologic){ |
213 | 226 |
// This is a normal date |
214 | 227 |
int myYear; |
... | ... | |
271 | 284 |
|
272 | 285 |
public void compile() throws IllegalArgumentException { |
273 | 286 |
compiled = true; |
274 |
valueList = new ArrayList<Object>();
|
|
287 |
valueList = new ArrayList<GregorianCalendar>();
|
|
275 | 288 |
String[] items = expression.split(","); |
276 | 289 |
for (int i = 0; i < items.length; i++) { |
277 | 290 |
// Each iteration is a value of a comma-separated list |
... | ... | |
305 | 318 |
} else if (s[0].matches(regexDateExtendedForBCE4)) { |
306 | 319 |
upgradeFormat(FULL_FORMAT); |
307 | 320 |
} |
308 |
Object minValue = valueOf(s[0]);
|
|
321 |
GregorianCalendar minValue = valueOf(s[0]);
|
|
309 | 322 |
|
310 | 323 |
// max value |
311 | 324 |
if (s[0].matches(regexDateExtendedForBCE1)) { |
... | ... | |
317 | 330 |
} else if (s[1].matches(regexDateExtendedForBCE4)) { |
318 | 331 |
upgradeFormat(FULL_FORMAT); |
319 | 332 |
} |
320 |
Object maxValue = valueOf(s[1]);
|
|
333 |
GregorianCalendar maxValue = valueOf(s[1]);
|
|
321 | 334 |
|
322 | 335 |
String period = s[2]; |
323 | 336 |
|
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSProvider.java | ||
---|---|---|
30 | 30 |
import java.io.IOException; |
31 | 31 |
import java.net.URL; |
32 | 32 |
import java.util.Hashtable; |
33 |
import java.util.List; |
|
33 | 34 |
import java.util.Vector; |
34 | 35 |
|
35 | 36 |
import javax.swing.ImageIcon; |
... | ... | |
596 | 597 |
wmsStatus.setSrs(p.getSRSCode()); |
597 | 598 |
wmsStatus.setFormat(p.getFormat()); |
598 | 599 |
wmsStatus.setInfoFormat(p.getInfoFormat()); |
599 |
wmsStatus.setStyles(p.getStyles()); |
|
600 |
List<RemoteWMSStyle> listStyles = p.getStyles(); |
|
601 |
Vector<?> v = listStyles != null ? new Vector<RemoteWMSStyle>(listStyles) : null; |
|
602 |
wmsStatus.setStyles(v); |
|
600 | 603 |
wmsStatus.setDimensions(p.getDimensions()); |
601 | 604 |
wmsStatus.setTransparency(p.isWmsTransparent()); |
602 | 605 |
wmsStatus.setOnlineResource((String) p.getOnlineResource().get("GetMap")); |
... | ... | |
1073 | 1076 |
wmsStatus.setSrs(p.getSRSCode()); |
1074 | 1077 |
wmsStatus.setFormat(p.getFormat()); |
1075 | 1078 |
wmsStatus.setInfoFormat(p.getInfoFormat()); |
1076 |
wmsStatus.setStyles(p.getStyles()); |
|
1079 |
List<RemoteWMSStyle> listStyles = p.getStyles(); |
|
1080 |
Vector<?> v = listStyles != null ? new Vector<RemoteWMSStyle>(listStyles) : null; |
|
1081 |
wmsStatus.setStyles(v); |
|
1077 | 1082 |
wmsStatus.setDimensions(p.getDimensions()); |
1078 | 1083 |
wmsStatus.setTransparency(p.isWmsTransparent()); |
1079 | 1084 |
wmsStatus.setOnlineResource((String) p.getOnlineResource().get("GetMap")); |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/RemoteWMSStyle.java | ||
---|---|---|
30 | 30 |
public int legendHeight; |
31 | 31 |
public int legendWidth; |
32 | 32 |
|
33 |
/* |
|
34 |
* (non-Javadoc) |
|
35 |
* @see org.gvsig.tools.persistence.Persistent#loadFromState(org.gvsig.tools.persistence.PersistentState) |
|
36 |
*/ |
|
37 | 33 |
public void loadFromState(PersistentState state) throws PersistenceException { |
38 | 34 |
this.name = state.getString("name"); |
39 | 35 |
this.title = state.getString("title"); |
... | ... | |
46 | 42 |
this.legendWidth = state.getInt("legendWidth"); |
47 | 43 |
} |
48 | 44 |
|
49 |
/* |
|
50 |
* (non-Javadoc) |
|
51 |
* @see org.gvsig.tools.persistence.Persistent#saveToState(org.gvsig.tools.persistence.PersistentState) |
|
52 |
*/ |
|
53 | 45 |
public void saveToState(PersistentState state) throws PersistenceException { |
54 | 46 |
state.set("parent", parent); |
55 | 47 |
state.set("name", name); |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSDataParameters.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import java.awt.Dimension; |
25 | 25 |
import java.awt.geom.Rectangle2D; |
26 |
import java.util.Hashtable;
|
|
26 |
import java.util.List;
|
|
27 | 27 |
import java.util.Map; |
28 | 28 |
import java.util.Vector; |
29 | 29 |
|
... | ... | |
59 | 59 |
|
60 | 60 |
public void setURI(String string); |
61 | 61 |
|
62 |
public void setStyles(Vector<RemoteWMSStyle> styles);
|
|
62 |
public void setStyles(List<RemoteWMSStyle> styles);
|
|
63 | 63 |
|
64 | 64 |
/** |
65 | 65 |
* Sets the dimension vector that is a list of key-value pairs containing |
... | ... | |
74 | 74 |
* |
75 | 75 |
* @param onlineResources |
76 | 76 |
*/ |
77 |
public void setOnlineResources(Hashtable<String, String> onlineResources);
|
|
77 |
public void setOnlineResources(Map<String, String> onlineResources);
|
|
78 | 78 |
|
79 | 79 |
public void setQueryable(boolean boolean1); |
80 | 80 |
|
... | ... | |
95 | 95 |
*/ |
96 | 96 |
public boolean isWmsTransparent(); |
97 | 97 |
|
98 |
public Vector<RemoteWMSStyle> getStyles();
|
|
98 |
public List<RemoteWMSStyle> getStyles();
|
|
99 | 99 |
|
100 | 100 |
public Vector<String> getDimensions(); |
101 | 101 |
|
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSDataParametersImpl.java | ||
---|---|---|
39 | 39 |
import org.gvsig.tools.dynobject.DynClass; |
40 | 40 |
import org.gvsig.tools.dynobject.DynStruct; |
41 | 41 |
import org.gvsig.tools.persistence.PersistenceManager; |
42 |
import org.gvsig.tools.persistence.PersistentState; |
|
43 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
44 | 42 |
|
45 | 43 |
/** |
46 | 44 |
* Parameters for the WMS provider |
... | ... | |
170 | 168 |
return definition; |
171 | 169 |
} |
172 | 170 |
|
171 |
|
|
172 |
/*@SuppressWarnings("unchecked") |
|
173 |
@Override |
|
174 |
public void loadFromState(PersistentState state) |
|
175 |
throws PersistenceException { |
|
176 |
super.loadFromState(state); |
|
177 |
|
|
178 |
if (state.hasValue(FIELD_STYLES)) { |
|
179 |
List<RemoteWMSStyle> styleList = state.getList(FIELD_STYLES); |
|
180 |
if(styleList != null) { |
|
181 |
Vector<RemoteWMSStyle> v = new Vector<RemoteWMSStyle>(); |
|
182 |
v.addAll(styleList); |
|
183 |
setStyles(v); |
|
184 |
} |
|
185 |
} |
|
186 |
if (state.hasValue(FIELD_DIMENSIONS)) { |
|
187 |
List<String> dimList = state.getList(FIELD_DIMENSIONS); |
|
188 |
if(dimList != null) { |
|
189 |
Vector<String> v = new Vector<String>(); |
|
190 |
v.addAll(dimList); |
|
191 |
setDimensions(v); |
|
192 |
} |
|
193 |
} |
|
194 |
|
|
195 |
if(state.getMap(FIELD_ONLINERESOURC) != null) |
|
196 |
setOnlineResources(new Hashtable<String, String>(state.getMap(FIELD_ONLINERESOURC))); |
|
197 |
|
|
198 |
if (state.hasValue(FIELD_FIXEDSIZE)) { |
|
199 |
setFixedSize((Dimension) state.get(FIELD_FIXEDSIZE)); |
|
200 |
} else { |
|
201 |
setFixedSize(null); |
|
202 |
} |
|
203 |
setExtent((Rectangle2D)state.get(FIELD_EXTENT)); |
|
204 |
}*/ |
|
205 |
|
|
173 | 206 |
/** |
174 | 207 |
* Gets the format |
175 | 208 |
* @return |
... | ... | |
305 | 338 |
this.setDynValue(FIELD_OVERRIDE, new Boolean(over));; |
306 | 339 |
} |
307 | 340 |
|
308 |
public void setStyles(Vector<RemoteWMSStyle> styles) {
|
|
341 |
public void setStyles(List<RemoteWMSStyle> styles) {
|
|
309 | 342 |
this.setDynValue(FIELD_STYLES, styles); |
310 | 343 |
} |
311 | 344 |
|
... | ... | |
313 | 346 |
* @param styles |
314 | 347 |
*/ |
315 | 348 |
@SuppressWarnings("unchecked") |
316 |
public Vector<RemoteWMSStyle> getStyles() {
|
|
317 |
return (Vector<RemoteWMSStyle>) this.getDynValue(FIELD_STYLES);
|
|
349 |
public List<RemoteWMSStyle> getStyles() {
|
|
350 |
return (List<RemoteWMSStyle>) this.getDynValue(FIELD_STYLES);
|
|
318 | 351 |
} |
319 | 352 |
|
320 | 353 |
public void setDimensions(Vector<String> dimensions) { |
... | ... | |
331 | 364 |
return (Vector<String>) this.getDynValue(FIELD_DIMENSIONS); |
332 | 365 |
} |
333 | 366 |
|
334 |
public void setOnlineResources(Hashtable<String, String> onlineResources) {
|
|
367 |
public void setOnlineResources(Map<String, String> onlineResources) {
|
|
335 | 368 |
this.setDynValue(FIELD_ONLINERESOURC, onlineResources); |
336 | 369 |
} |
337 | 370 |
|
... | ... | |
490 | 523 |
setInfoLayerQuery(p.getInfoLayerQuery()); |
491 | 524 |
setLayerQuery(p.getLayerQuery()); |
492 | 525 |
setName(getName()); |
493 |
setOnlineResources((Hashtable<String, String>)p.getDynValue(FIELD_ONLINERESOURC));
|
|
526 |
setOnlineResources((Map<String, String>)p.getDynValue(FIELD_ONLINERESOURC));
|
|
494 | 527 |
setOverrideHost(p.isOverridingHost()); |
495 | 528 |
setQueryable(p.isQueryable()); |
496 | 529 |
setSRS(p.getSRSCode()); |
... | ... | |
499 | 532 |
setDimensions(p.getDimensions()); |
500 | 533 |
setCancellable(p.getCancellable()); |
501 | 534 |
} |
502 |
|
|
503 |
@SuppressWarnings("unchecked") |
|
504 |
@Override |
|
505 |
public void loadFromState(PersistentState state) |
|
506 |
throws PersistenceException { |
|
507 |
super.loadFromState(state); |
|
508 |
|
|
509 |
if (state.hasValue(FIELD_STYLES)) { |
|
510 |
List<RemoteWMSStyle> styleList = state.getList(FIELD_STYLES); |
|
511 |
if(styleList != null) { |
|
512 |
Vector<RemoteWMSStyle> v = new Vector<RemoteWMSStyle>(); |
|
513 |
v.addAll(styleList); |
|
514 |
setStyles(v); |
|
515 |
} |
|
516 |
} |
|
517 |
if (state.hasValue(FIELD_DIMENSIONS)) { |
|
518 |
List<String> dimList = state.getList(FIELD_DIMENSIONS); |
|
519 |
if(dimList != null) { |
|
520 |
Vector<String> v = new Vector<String>(); |
|
521 |
v.addAll(dimList); |
|
522 |
setDimensions(v); |
|
523 |
} |
|
524 |
} |
|
525 |
|
|
526 |
if(state.getMap(FIELD_ONLINERESOURC) != null) |
|
527 |
setOnlineResources(new Hashtable<String, String>(state.getMap(FIELD_ONLINERESOURC))); |
|
528 |
|
|
529 |
if (state.hasValue(FIELD_FIXEDSIZE)) { |
|
530 |
setFixedSize((Dimension) state.get(FIELD_FIXEDSIZE)); |
|
531 |
} else { |
|
532 |
setFixedSize(null); |
|
533 |
} |
|
534 |
setExtent((Rectangle2D)state.get(FIELD_EXTENT)); |
|
535 |
} |
|
536 |
|
|
537 |
|
|
538 | 535 |
} |
Also available in: Unified diff