Revision 2069
trunk/extensions/extWCS/src/com/iver/cit/gvsig/fmap/drivers/wcs/FMapWCSDriver.java | ||
---|---|---|
242 | 242 |
/** |
243 | 243 |
* @param coverageName |
244 | 244 |
* @param srs |
245 |
* @throws DriverException |
|
246 |
* @throws IOException |
|
245 | 247 |
*/ |
246 |
private Rectangle2D getBoundingBoxExtensionMaxima(String coverageName, String srs) { |
|
248 |
private Rectangle2D getBoundingBoxExtensionMaxima(String coverageName, String srs) throws IOException, DriverException {
|
|
247 | 249 |
// TODO Has de considerar el cas per a quan el SRS no vinga als RequestResponse |
248 | 250 |
// ni cap altre... |
249 | 251 |
// IDEA: agafar algun dels de CoverageOfferingBrief i aplicar la transformaci?. |
250 | 252 |
CoverageOffering co = wcs.getCoverageDescription(coverageName); |
253 |
|
|
254 |
if (!isConnected()) |
|
255 |
connect(); |
|
251 | 256 |
if (co.getDomainSet() != null) { |
252 | 257 |
if (co.getDomainSet().getSpatialDomain() != null){ |
253 | 258 |
ArrayList gewtpList = co.getDomainSet().getSpatialDomain().getGMLEnvelopeWithTimePeriodList(); |
... | ... | |
299 | 304 |
/** |
300 | 305 |
* Obtiene la M?XIMA extensi?n de la cobertura en el servidor. |
301 | 306 |
* @return Rectangle2D |
307 |
* @throws DriverException |
|
308 |
* @throws IOException |
|
302 | 309 |
*/ |
303 |
public Rectangle2D getFullExtent(String coverageName, String srs) { |
|
310 |
public Rectangle2D getFullExtent(String coverageName, String srs) throws IOException, DriverException {
|
|
304 | 311 |
return getBoundingBoxExtensionMaxima(coverageName, srs); |
305 | 312 |
} |
306 | 313 |
|
trunk/extensions/extWCS/src/com/iver/cit/gvsig/fmap/layers/FLyrWCS.java | ||
---|---|---|
60 | 60 |
import com.iver.utiles.StringUtilities; |
61 | 61 |
import com.iver.utiles.XMLEntity; |
62 | 62 |
|
63 |
import es.uji.lsi.wcs.client.ServerOutOfOrderException; |
|
64 |
|
|
65 | 63 |
/** |
66 | 64 |
* Capa para el WCS. |
67 | 65 |
* |
... | ... | |
85 | 83 |
XMLEntity xml = super.getXMLEntity(); |
86 | 84 |
|
87 | 85 |
xml.putProperty("wcs.host", getHost()); |
88 |
xml.putProperty("wcs.fullExtent", |
|
89 |
StringUtilities.rect2String(wcs.getFullExtent())); |
|
86 |
try { |
|
87 |
xml.putProperty("wcs.fullExtent", |
|
88 |
StringUtilities.rect2String(wcs.getFullExtent())); |
|
89 |
} catch (IOException e) { |
|
90 |
} catch (DriverException e) { |
|
91 |
} |
|
90 | 92 |
xml.putProperty("wcs.layerQuery", wcs.getCoverageQuery()); |
91 | 93 |
xml.putProperty("wcs.format", getFormat()); |
92 | 94 |
xml.putProperty("wcs.srs", getSRS()); |
... | ... | |
130 | 132 |
* |
131 | 133 |
* @return Rectangle2D |
132 | 134 |
*/ |
133 |
public Rectangle2D getFullExtent() throws DriverException { |
|
134 |
return getWCSAdaptor().getFullExtent(); |
|
135 |
public Rectangle2D getFullExtent(){// throws DriverException { |
|
136 |
try { |
|
137 |
return getWCSAdaptor().getFullExtent(); |
|
138 |
} catch (IOException e) { |
|
139 |
JOptionPane.showMessageDialog(null, "error_comunicacion_servidor", "Error", JOptionPane.ERROR_MESSAGE); |
|
140 |
} catch (DriverException e) { |
|
141 |
JOptionPane.showMessageDialog(null, "servidor_wcs_no_responde", "Error", JOptionPane.ERROR_MESSAGE); |
|
142 |
} |
|
143 |
return null; |
|
135 | 144 |
} |
136 | 145 |
|
137 | 146 |
/** |
trunk/extensions/extWCS/src/com/iver/cit/gvsig/fmap/layers/FMapWCSAdaptor.java | ||
---|---|---|
47 | 47 |
import java.awt.geom.Rectangle2D; |
48 | 48 |
import java.awt.image.BufferedImage; |
49 | 49 |
import java.io.File; |
50 |
import java.io.IOException; |
|
50 | 51 |
|
51 | 52 |
import javax.swing.JOptionPane; |
52 | 53 |
|
... | ... | |
391 | 392 |
/** |
392 | 393 |
* Obtiene la extensi?n m?xima de la cobertura |
393 | 394 |
* @return |
395 |
* @throws DriverException |
|
396 |
* @throws IOException |
|
394 | 397 |
*/ |
395 |
public Rectangle2D getFullExtent() { |
|
398 |
public Rectangle2D getFullExtent() throws IOException, DriverException {
|
|
396 | 399 |
if (fullExtent==null) |
397 | 400 |
fullExtent = driver.getFullExtent(coverageName, SRS); |
398 | 401 |
return fullExtent; |
trunk/extensions/extWCS/src/com/iver/cit/gvsig/fmap/services/OGCWCSService.java | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import java.awt.geom.Rectangle2D; |
7 | 7 |
import java.io.File; |
8 |
import java.io.IOException; |
|
8 | 9 |
import java.util.ArrayList; |
9 | 10 |
|
11 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
12 |
|
|
10 | 13 |
import es.uji.lsi.wcs.client.ServerErrorResponseException; |
11 | 14 |
import es.uji.lsi.wcs.client.ServerOutOfOrderException; |
12 | 15 |
|
... | ... | |
43 | 46 |
* @return ArrayList |
44 | 47 |
*/ |
45 | 48 |
public ArrayList getSRSs(String coverageName); |
46 |
public Rectangle2D getFullExtent(String coverageName, String srs); |
|
49 |
public Rectangle2D getFullExtent(String coverageName, String srs) throws IOException, DriverException;
|
|
47 | 50 |
public ArrayList getFormats(String coverageName); |
48 | 51 |
public ArrayList getParameters(String coverageName); |
49 | 52 |
|
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/WCSDataSourceAdapter.java | ||
---|---|---|
112 | 112 |
* @return Rectangle2D |
113 | 113 |
*/ |
114 | 114 |
public Rectangle2D getBoundingBox(String coverageName, String srs) { |
115 |
return client.getFullExtent(coverageName, srs); |
|
115 |
try { |
|
116 |
return client.getFullExtent(coverageName, srs); |
|
117 |
} catch (IOException e) { |
|
118 |
e.printStackTrace(); |
|
119 |
} catch (DriverException e) { |
|
120 |
e.printStackTrace(); |
|
121 |
} |
|
122 |
return null; |
|
116 | 123 |
} |
117 | 124 |
|
118 | 125 |
public Driver getDriver() { |
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/wcs/WizardListenerSupport1.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.gui.wcs; |
|
42 |
|
|
43 |
import java.util.ArrayList; |
|
44 |
import java.util.Iterator; |
|
45 |
|
|
46 |
|
|
47 |
/** |
|
48 |
* DOCUMENT ME! |
|
49 |
* |
|
50 |
* @author Fernando Gonz?lez Cort?s |
|
51 |
*/ |
|
52 |
public class WizardListenerSupport1 { |
|
53 |
private ArrayList listeners = new ArrayList(); |
|
54 |
|
|
55 |
/** |
|
56 |
* DOCUMENT ME! |
|
57 |
* |
|
58 |
* @param listener DOCUMENT ME! |
|
59 |
*/ |
|
60 |
public void addWizardListener(WizardListener1 listener) { |
|
61 |
listeners.add(listener); |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* DOCUMENT ME! |
|
66 |
* |
|
67 |
* @param listener DOCUMENT ME! |
|
68 |
*/ |
|
69 |
public void removeWizardListener(WizardListener1 listener) { |
|
70 |
listeners.remove(listener); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* DOCUMENT ME! |
|
75 |
* @param finishable TODO |
|
76 |
*/ |
|
77 |
public void callStateChanged(boolean finishable) { |
|
78 |
Iterator i = listeners.iterator(); |
|
79 |
|
|
80 |
while (i.hasNext()) { |
|
81 |
((WizardListener1) i.next()).wizardStateChanged(finishable); |
|
82 |
} |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* DOCUMENT ME! |
|
87 |
*/ |
|
88 |
public void callError(Exception descripcion) { |
|
89 |
Iterator i = listeners.iterator(); |
|
90 |
|
|
91 |
while (i.hasNext()) { |
|
92 |
((WizardListener1) i.next()).error(descripcion); |
|
93 |
} |
|
94 |
} |
|
95 |
} |
|
96 |
|
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/wcs/WizardListener1.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.gui.wcs; |
|
42 |
|
|
43 |
/** |
|
44 |
* DOCUMENT ME! |
|
45 |
* |
|
46 |
* @author $author$ |
|
47 |
*/ |
|
48 |
public interface WizardListener1 { |
|
49 |
|
|
50 |
/** |
|
51 |
* Invocado cuando el wizard puede ser finalizado porque se |
|
52 |
* ha rellenado toda la informaci?n necesaria |
|
53 |
*/ |
|
54 |
public void wizardStateChanged(boolean finishable); |
|
55 |
|
|
56 |
/** |
|
57 |
* Si se produce alg?n error |
|
58 |
* |
|
59 |
* @param e Excepci?n que se ha producido |
|
60 |
*/ |
|
61 |
public void error(Exception e); |
|
62 |
} |
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/wcs/WCSWizard.java | ||
---|---|---|
501 | 501 |
wcsParamsTabbedPane.getCmbParam().addItemListener( |
502 | 502 |
new java.awt.event.ItemListener() { |
503 | 503 |
public void itemStateChanged(java.awt.event.ItemEvent e) { |
504 |
// ArrayList coverages = new ArrayList(); |
|
505 |
|
|
506 |
// for (int i = 0; i < wcsParamsTabbedPane |
|
507 |
// .getLstSelectedCoverages().getModel() |
|
508 |
// .getSize(); i++) { |
|
509 |
// coverages.add(wcsParamsTabbedPane |
|
510 |
// .getLstSelectedCoverages().getModel() |
|
511 |
// .getElementAt(i)); |
|
512 |
// } |
|
513 | 504 |
String s = (String) wcsParamsTabbedPane.getLstCoverages().getSelectedValue(); |
514 | 505 |
wcsParamsTabbedPane.actualizaListaParametros(s); |
515 |
//actualizaListaParametros(coverages.toArray()); |
|
516 | 506 |
} |
517 | 507 |
}); |
518 | 508 |
wcsParamsTabbedPane.getBtnAddTemps().addActionListener( |
... | ... | |
688 | 678 |
* @return DOCUMENT ME! |
689 | 679 |
*/ |
690 | 680 |
public Rectangle2D getLayersRectangle() { |
691 |
//Rectangle2D rect = dataSource.getBoundingBox(getNomCobertura(), getSRS()); |
|
692 |
//if (rect == null) new Rectangle2D(); |
|
693 | 681 |
return wcsParamsTabbedPane.getLayersRectangle(); |
694 | 682 |
} |
695 | 683 |
|
Also available in: Unified diff