Revision 5262 branches/MULTITHREADING_DEVELOPMENT/extensions/extWMS/src/com/iver/cit/gvsig/fmap/drivers/wms/FMapWMSDriver.java
FMapWMSDriver.java | ||
---|---|---|
52 | 52 |
import java.util.Vector; |
53 | 53 |
|
54 | 54 |
import org.gvsig.remoteClient.exceptions.ServerErrorException; |
55 |
import org.gvsig.remoteClient.taskplanning.retrieving.RetrieveEvent; |
|
55 | 56 |
import org.gvsig.remoteClient.wms.WMSClient; |
56 | 57 |
import org.gvsig.remoteClient.wms.WMSDimension; |
57 | 58 |
import org.gvsig.remoteClient.wms.WMSEventListener; |
... | ... | |
71 | 72 |
* @author Jaume Dominguez Faus |
72 | 73 |
*/ |
73 | 74 |
public class FMapWMSDriver implements WMSDriver { |
75 |
public static final int GET_CAPABILITIES = WMSClient.GET_CAPABILITIES; |
|
76 |
public static final int GET_MAP = WMSClient.GET_MAP; |
|
77 |
public static final int GET_FEATURE_INFO = WMSClient.GET_FEATURE_INFO; |
|
78 |
|
|
74 | 79 |
private WMSClient client; |
75 | 80 |
private WMSLayerNode fmapRootLayer; |
76 | 81 |
private TreeMap layers = new TreeMap(); |
... | ... | |
78 | 83 |
|
79 | 84 |
private WMSEventListener monitor = new WMSEventListener() { |
80 | 85 |
public void newEvent(int idRequest, int eventType) { |
81 |
if (eventType == WMSEventListener.FINISHED) { |
|
86 |
int message = 0; |
|
87 |
if (eventType == RetrieveEvent.REQUEST_FINISHED) { |
|
88 |
message = WMSListener.FINISHED; |
|
82 | 89 |
if (idRequest == WMSEventListener.CAPABILITIES) { |
83 | 90 |
WMSLayer clientRoot = client.getLayersRoot(); |
84 | 91 |
fmapRootLayer = parseTree(clientRoot, null); |
92 |
eventType = WMSEventListener.CAPABILITIES; |
|
85 | 93 |
} |
94 |
|
|
95 |
} else if (eventType == RetrieveEvent.REQUEST_CANCELLED){ |
|
96 |
message = WMSListener.CANCELLED; |
|
97 |
} else if (eventType == RetrieveEvent.REQUEST_FAILED){ |
|
98 |
message = WMSListener.FAILED; |
|
99 |
} else if (eventType == RetrieveEvent.CONNECTING){ |
|
100 |
message = WMSListener.STARTED; |
|
101 |
} else if (eventType == RetrieveEvent.TRANSFERRING){ |
|
102 |
message = WMSListener.TRANSFERRING; |
|
86 | 103 |
} |
104 |
|
|
87 | 105 |
for (int i = 0; i < listeners.size(); i++) { |
106 |
System.out.println("comunique a wizard data"); |
|
88 | 107 |
WMSListener l = (WMSListener) listeners.get(i); |
89 |
l.newEvent(idRequest, eventType);
|
|
108 |
l.newEvent(idRequest, message);
|
|
90 | 109 |
} |
91 | 110 |
} |
92 | 111 |
}; |
... | ... | |
350 | 369 |
listeners.add(listener); |
351 | 370 |
} |
352 | 371 |
|
372 |
public void cancel(int opCode) { |
|
373 |
client.cancel(GET_CAPABILITIES); |
|
374 |
} |
|
375 |
|
|
353 | 376 |
} |
354 | 377 |
|
Also available in: Unified diff