Revision 26601 tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/fmap/layers/FLyrWPS.java
FLyrWPS.java | ||
---|---|---|
3 | 3 |
import java.awt.Graphics2D; |
4 | 4 |
import java.awt.geom.Rectangle2D; |
5 | 5 |
import java.awt.image.BufferedImage; |
6 |
import java.io.File; |
|
7 | 6 |
import java.io.IOException; |
8 |
import java.net.ConnectException; |
|
9 | 7 |
import java.net.MalformedURLException; |
10 | 8 |
import java.net.URL; |
11 | 9 |
import java.util.HashMap; |
12 |
import java.util.Vector; |
|
13 | 10 |
|
11 |
|
|
14 | 12 |
import javax.swing.ImageIcon; |
15 | 13 |
|
16 | 14 |
import org.apache.commons.logging.Log; |
... | ... | |
30 | 28 |
import com.iver.cit.gvsig.fmap.rendering.Legend; |
31 | 29 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
32 | 30 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
33 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
|
34 | 31 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
35 | 32 |
import com.iver.utiles.StringUtilities; |
36 | 33 |
import com.iver.utiles.XMLEntity; |
37 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
|
38 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
|
34 |
|
|
39 | 35 |
import com.iver.utiles.swing.threads.Cancellable; |
40 | 36 |
|
41 |
import es.logex.gvsig.fmap.drivers.WPSException; |
|
42 | 37 |
import es.logex.gvsig.fmap.drivers.wps.FMapWPSDriver; |
43 | 38 |
import es.logex.gvsig.fmap.drivers.wps.FMapWPSDriverFactory; |
44 |
import es.logex.gvsig.fmap.layers.SMLayerInfo; |
|
39 |
|
|
45 | 40 |
|
46 | 41 |
public class FLyrWPS extends FLyrVect implements WithDefaultLegend { |
47 | 42 |
|
... | ... | |
55 | 50 |
private FMapWPSDriver wpsDriver = null; |
56 | 51 |
private String srs = null; |
57 | 52 |
private Log logger = LogFactory.getLog(this.getClass()); |
58 |
private SMLayerInfo smlInfo = null; |
|
53 |
|
|
59 | 54 |
private Rectangle2D fullExtent; |
60 | 55 |
private boolean firstLoad = false; |
61 | 56 |
private String defaultLegendPath = null; |
... | ... | |
66 | 61 |
*/ |
67 | 62 |
public FLyrWPS(){ |
68 | 63 |
super(); |
69 |
ExtensionPoint extensionPoint = (ExtensionPoint)ExtensionPointsSingleton.getInstance().get("WPSExtension"); |
|
70 |
if (extensionPoint != null){ |
|
71 |
try { |
|
72 |
//TODO:Crear un listener para la capa WPS. Ver lo del extension Point |
|
73 |
WPSLayerListener listener = (WPSLayerListener)extensionPoint.create("WFSLayerListener"); |
|
74 |
listener.setWPSLayer(this); |
|
75 |
addLayerListener(listener); |
|
76 |
} catch (Exception e) { |
|
77 |
//Impossible to Use the WFST lockoperation |
|
78 |
} |
|
79 |
} |
|
80 | 64 |
} |
81 | 65 |
|
82 |
public FLyrWPS(SMLayerInfo smlInfo) {
|
|
83 |
super();
|
|
66 |
public FLyrWPS(String layerId, String name, String srs, URL host, double minScale, double maxScale) {
|
|
67 |
this();
|
|
84 | 68 |
|
85 |
this.layerId = smlInfo.getId(); |
|
86 |
this.name = smlInfo.getName(); |
|
87 |
this.srs = smlInfo.getDefaultSRS(); |
|
88 |
this.host = smlInfo.getHost(); |
|
89 |
this.smlInfo = smlInfo; |
|
90 |
this.setMinScale(smlInfo.getMinScale()); |
|
91 |
this.setMaxScale(smlInfo.getMaxScale()); |
|
69 |
this.layerId = layerId; |
|
70 |
this.name = name; |
|
71 |
this.srs = srs; |
|
72 |
this.host = host; |
|
73 |
this.setMinScale(minScale); |
|
74 |
this.setMaxScale(maxScale); |
|
92 | 75 |
} |
93 |
|
|
76 |
// public FLyrWPS() { |
|
77 |
// super(); |
|
78 |
// |
|
79 |
// this.layerId = layerId; |
|
80 |
// this.name = smlInfo.getName(); |
|
81 |
// this.srs = smlInfo.getDefaultSRS(); |
|
82 |
// this.host = smlInfo.getHost(); |
|
83 |
// this.smlInfo = smlInfo; |
|
84 |
// this.setMinScale(smlInfo.getMinScale()); |
|
85 |
// this.setMaxScale(smlInfo.getMaxScale()); |
|
86 |
// } |
|
94 | 87 |
public void setDefaultLegendPath(String defaultLegendPath) { |
95 | 88 |
this.defaultLegendPath = defaultLegendPath; |
96 | 89 |
} |
... | ... | |
169 | 162 |
return wpsDriver; |
170 | 163 |
} |
171 | 164 |
|
165 |
@SuppressWarnings("unchecked") |
|
172 | 166 |
public HashMap getProperties() { |
173 | 167 |
HashMap info = new HashMap(); |
174 | 168 |
info.put("name", getName()); |
... | ... | |
289 | 283 |
xml.putProperty("layerId", layerId); |
290 | 284 |
|
291 | 285 |
// Full extent |
292 |
xml.putProperty("fullExtent", StringUtilities.rect2String(fullExtent)); |
|
286 |
try { |
|
287 |
xml.putProperty("fullExtent", StringUtilities.rect2String(this.wpsDriver.getFullExtent())); |
|
288 |
} catch (IOException e) { |
|
289 |
// TODO Auto-generated catch block |
|
290 |
e.printStackTrace(); |
|
291 |
} |
|
293 | 292 |
|
294 | 293 |
// Host |
295 | 294 |
xml.putProperty("host", host.toExternalForm()); |
Also available in: Unified diff