Revision 10628

View differences:

trunk/extensions/extDwg/src/com/iver/cit/gvsig/drivers/dwg/DwgMemoryDriver.java
46 46
*
47 47
* $Id$
48 48
* $Log$
49
* Revision 1.7  2007-02-27 17:18:03  azabala
49
* Revision 1.8  2007-03-06 17:27:31  caballero
50
* Exceptions
51
*
52
* Revision 1.7  2007/02/27 17:18:03  azabala
50 53
* solved bug with text orientation
51 54
*
52 55
* Revision 1.6  2007/02/14 16:17:22  azabala
......
80 83
import java.util.ArrayList;
81 84
import java.util.List;
82 85

  
86
import com.hardcode.gdbms.driver.exceptions.InitializeDriverException;
87
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
88
import com.hardcode.gdbms.driver.exceptions.UnsupportedVersionDriverException;
83 89
import com.hardcode.gdbms.engine.data.DataSourceFactory;
84
import com.hardcode.gdbms.engine.data.driver.DriverException;
85 90
import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
86 91
import com.hardcode.gdbms.engine.data.edition.DataWare;
87 92
import com.hardcode.gdbms.engine.values.IntValue;
......
112 117
 * Driver that allows gvSIG to read files in DWG format Using this driver, a
113 118
 * gvSIG user can manipulate part of the information contained in a DWG file
114 119
 * This driver load the Dwg file in memory This driver uses jdwglib
115
 * 
120
 *
116 121
 * @author jmorell
117 122
 */
118 123
public class DwgMemoryDriver extends AbstractCadMemoryDriver implements
......
132 137

  
133 138
	/*
134 139
	 * (non-Javadoc)
135
	 * 
140
	 *
136 141
	 * @see com.iver.cit.gvsig.fmap.drivers.MemoryDriver#open(java.io.File)
137 142
	 */
138
	public void open(File f) throws IOException {
143
	public void open(File f) {
139 144
		m_Fich = f;
140 145
	}
141
	
146

  
142 147
	/**
143 148
	 * Allows recovering of the DWG Drawing entity
144
	 * associated to the FMap feature whose position 
149
	 * associated to the FMap feature whose position
145 150
	 * is index
146 151
	 * @param index position of the fmap feature whose
147 152
	 * dwg entity is required
148
	 * 
153
	 *
149 154
	 * */
150 155
	public Object getCadSource(int index){
151 156
		return dwg.getDwgObject(index);
......
161 166
	 * objects contained inside the blocks through the blockManagement method.
162 167
	 * And finally, we can read the objects Vector, and convert this objects to
163 168
	 * the FMap object model.
169
	 * @throws InitializeDriverException
164 170
	 */
165
	public void initialize() throws IOException {
171
	public void initialize() throws InitializeDriverException {
166 172
		if (isInitialized)
167 173
			return;
168 174
		else
......
175 181
		try {
176 182
			dwg.read();
177 183
		} catch (DwgVersionNotSupportedException e1) {
184

  
178 185
			String autodeskUrl = "<a href=\"http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=7024151\">"
179 186
					+ "http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=7024151</a>";
180
			throw new IOException(
181
					formatString(
182
							"La version (%s) del fichero DWG '%s' no esta soportada por gvSIG.\n%s\n%s\n%s",
183
							new String[] { e1.getDwgVersion().toString(),
184
									m_Fich.getName(),
185
									Messages.getText("Probe_to_convert"),
186
									Messages.getText("Autodesk_converter"),
187
									autodeskUrl }));
188
		}// catch
187
//			throw new InitializeDriverException(
188
//					formatString(
189
//							"La version (%s) del fichero DWG '%s' no esta soportada por gvSIG.\n%s\n%s\n%s",
190
//							new String[] { e1.getDwgVersion().toString(),
191
//									m_Fich.getName(),
192
//									Messages.getText("Probe_to_convert"),
193
//									Messages.getText("Autodesk_converter"),
194
//									autodeskUrl }));
195
			String description=formatString(
196
					"La version (%s) del fichero DWG '%s' no esta soportada por gvSIG.\n%s\n%s\n%s",
197
					new String[] { e1.getDwgVersion().toString(),
198
							m_Fich.getName(),
199
							Messages.getText("Probe_to_convert"),
200
							Messages.getText("Autodesk_converter"),
201
							autodeskUrl });
202
			throw new UnsupportedVersionDriverException(getName(),e1,description);
203
		} catch (IOException e) {
204
			throw new InitializeDriverException(getName(),e);
205
		}
189 206

  
190 207
		// dwg.initializeLayerTable();
191 208
		dwg.calculateGisModelDwgPolylines();
......
211 228
		
212 229
		for (int i = 0; i < dwgObjects.size(); i++) {
213 230
			DwgObject entity = (DwgObject) dwgObjects.get(i);
214
			
231

  
215 232
			if(entity instanceof IDwg2FMap){
216
				
233

  
217 234
				IDwg2FMap dwgEnt = (IDwg2FMap)entity;
218 235
				//TODO Ojo, revisar las fshape a null
219 236
				FShape fshape = dwgEnt.toFMapGeometry(is3dFile);
......
229 246
				auxRow[ID_FIELD_LAYER] = ValueFactory.createValue(layerName);
230 247
				int color = entity.getColor();
231 248
				int colorByLayer = dwg.getColorByLayer(entity);
232
				
249

  
233 250
				// TODO: if (color==0) color ByBlock
234 251
				if (color == 256)
235 252
					color = colorByLayer;
236 253
				auxRow[ID_FIELD_COLOR] = ValueFactory.createValue(color);
237
				
254

  
238 255
				auxRow[ID_FIELD_HEIGHTTEXT] = ValueFactory.createValue(0.0);
239 256
				auxRow[ID_FIELD_ROTATIONTEXT] = ValueFactory.createValue(0.0);
240 257
				auxRow[ID_FIELD_TEXT] = ValueFactory.createNullValue();
241 258
				auxRow[ID_FIELD_THICKNESS] = ValueFactory.createValue(0.0);
242
				
259

  
243 260
				if(entity instanceof IDwg3DTestable){
244
					auxRow[ID_FIELD_ELEVATION] = 
245
						ValueFactory.createValue(((IDwg3DTestable)entity).getZ());	
261
					auxRow[ID_FIELD_ELEVATION] =
262
						ValueFactory.createValue(((IDwg3DTestable)entity).getZ());
246 263
				}
247
				
264

  
248 265
				if(entity instanceof DwgMText){
249 266
					DwgMText mtext = (DwgMText) entity;
250 267
					auxRow[ID_FIELD_TEXT] = ValueFactory.
......
263 280
							createValue(Math.toDegrees(text.getRotationAngle()));
264 281
				}//if-else
265 282
				addShape(fshape, auxRow);
266
				
283

  
267 284
			}//if instanceof
268 285
			else{
269 286
				
270 287
			}
271 288
		}//for
272
		
289

  
273 290
		FSymbol myDefaultSymbol = new FSymbol(getShapeType());
274 291
		myDefaultSymbol.setShapeVisible(false);
275 292
		myDefaultSymbol.setFontSizeInPixels(false);
......
279 296
		myDefaultSymbol.setStyle(FConstant.SYMBOL_STYLE_DGNSPECIAL);
280 297
		myDefaultSymbol.setSize(3);
281 298
		myDefaultSymbol.setSizeInPixels(true);
282
		
299

  
283 300
		defaultLegend = LegendFactory
284 301
				.createVectorialUniqueValueLegend(getShapeType());
285 302
		defaultLegend.setFieldName("Color");
......
311 328
					defaultLegend.addSymbol(clave, theSymbol);
312 329
				}//if
313 330
			} // for
314
		} catch (DriverException e) {
315
			e.printStackTrace();
316
			throw new IOException(
317
					"Error al poner la leyenda por defecto en el Dwg");
331
		} catch (ReadDriverException e) {
332
			throw new InitializeDriverException(getName(),e);
318 333
		}
319 334
	}
320 335

  
......
330 345
		return ret;
331 346
	}
332 347

  
333
	
334
	
335 348

  
336
	
337 349

  
350

  
351

  
352

  
338 353
	/**
339 354
	 * Method that changes a Point2D array to a FPolygon2D. Is useful to convert
340 355
	 * a polygon given by it points to a FPolygon2D, a polygon in the FMap model
341 356
	 * object
342
	 * 
357
	 *
343 358
	 * @param pts
344 359
	 *            Array of Point2D that defines the polygon that will be
345 360
	 *            converted in a FPolygon2D
......
358 373

  
359 374
	/*
360 375
	 * (non-Javadoc)
361
	 * 
376
	 *
362 377
	 * @see com.iver.cit.gvsig.fmap.drivers.MemoryDriver#accept(java.io.File)
363 378
	 */
364 379
	public boolean accept(File f) {
......
367 382

  
368 383
	/*
369 384
	 * (non-Javadoc)
370
	 * 
385
	 *
371 386
	 * @see com.iver.cit.gvsig.fmap.drivers.MemoryDriver#getShapeType()
372 387
	 */
373 388
	public int getShapeType() {
......
376 391

  
377 392
	/*
378 393
	 * (non-Javadoc)
379
	 * 
394
	 *
380 395
	 * @see com.iver.cit.gvsig.fmap.drivers.MemoryDriver#getName()
381 396
	 */
382 397
	public String getName() {
......
385 400

  
386 401
	/*
387 402
	 * (non-Javadoc)
388
	 * 
403
	 *
389 404
	 * @see com.iver.cit.gvsig.fmap.drivers.WithDefaultLegend#getDefaultLegend()
390 405
	 */
391 406
	public Legend getDefaultLegend() {
......
394 409

  
395 410
	/*
396 411
	 * (non-Javadoc)
397
	 * 
412
	 *
398 413
	 * @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getDriverAttributes()
399 414
	 */
400 415
	public DriverAttributes getDriverAttributes() {
......
403 418

  
404 419
	/*
405 420
	 * (non-Javadoc)
406
	 * 
421
	 *
407 422
	 * @see com.hardcode.gdbms.engine.data.driver.ObjectDriver#getPrimaryKeys()
408 423
	 */
409
	public int[] getPrimaryKeys() throws DriverException {
424
	public int[] getPrimaryKeys() {
410 425
		// TODO Auto-generated method stub
411 426
		return null;
412 427
	}
413 428

  
414 429
	/*
415 430
	 * (non-Javadoc)
416
	 * 
431
	 *
417 432
	 * @see com.hardcode.gdbms.engine.data.driver.ObjectDriver#write(com.hardcode.gdbms.engine.data.edition.DataWare)
418 433
	 */
419
	public void write(DataWare arg0) throws DriverException {
434
	public void write(DataWare arg0) {
420 435
		// TODO Auto-generated method stub
421 436

  
422 437
	}
......
426 441

  
427 442
	}
428 443

  
429
	public void close() throws IOException {
444
	public void close() {
430 445
		// TODO Auto-generated method stub
431 446

  
432 447
	}
trunk/extensions/extDwg/src/com/iver/cit/gvsig/drivers/dwg/debug/DwgEntityListener.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.5  2007-02-15 16:28:36  fdiaz
48
* Revision 1.6  2007-03-06 17:27:42  caballero
49
* Exceptions
50
*
51
* Revision 1.5  2007/02/15 16:28:36  fdiaz
49 52
* Compatibilizado con branch v10
50 53
*
51 54
* Revision 1.4  2007/02/01 20:03:21  azabala
......
70 73

  
71 74
import javax.swing.JOptionPane;
72 75

  
76
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
73 77
import com.iver.cit.gvsig.drivers.dwg.DwgMemoryDriver;
74
import com.iver.cit.gvsig.fmap.DriverException;
78
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException;
79
import com.iver.cit.gvsig.exceptions.visitors.ProcessVisitorException;
80
import com.iver.cit.gvsig.exceptions.visitors.StartVisitorException;
81
import com.iver.cit.gvsig.exceptions.visitors.VisitorException;
75 82
import com.iver.cit.gvsig.fmap.MapControl;
76 83
import com.iver.cit.gvsig.fmap.core.IGeometry;
77 84
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
......
79 86
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
80 87
import com.iver.cit.gvsig.fmap.layers.SingleLayerIterator;
81 88
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor;
82
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
83 89
import com.iver.cit.gvsig.fmap.tools.BehaviorException;
84 90
import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
85 91
import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
......
87 93
import com.iver.cit.jdwglib.dwg.DwgObject;
88 94

  
89 95
public class DwgEntityListener implements PointListener{
90
	
91 96

  
92
	
93
		
97

  
98

  
99

  
94 100
		public static int pixelTolerance = 3;
95 101
	    private MapControl mapCtrl;
96 102
	    private Cursor cur = java.awt.Cursor.
97 103
	    		getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
98
	
104

  
99 105
	    public DwgEntityListener(MapControl mc) {
100 106
	        this.mapCtrl = mc;
101 107
	    }
102 108

  
103 109
	    public void point(PointEvent event) throws BehaviorException {
104
	        
110

  
105 111
	        Point2D pReal = mapCtrl.
106 112
	        		getMapContext().
107 113
	        		getViewPort().
108 114
	        		toMapPoint(event.getPoint());
109
	        
115

  
110 116
			SingleLayerIterator it = new SingleLayerIterator(mapCtrl.getMapContext().getLayers());
111 117
			while (it.hasNext())
112 118
			{
......
115 121
					continue;
116 122
				if(! (aux instanceof FLyrVect))
117 123
					return;
118
				
124

  
119 125
				FLyrVect vectLyr = (FLyrVect) aux;
120 126
				VectorialDriver driver = vectLyr.getSource().getDriver();
121
				
127

  
122 128
//				Class dwgMemoryDriverClass = LayerFactory.getDM().getDriverClassByName("gvSIG DWG Memory Driver");
123 129
//				if(dwgMemoryDriverClass == null){
124 130
//					System.out.println("Driver dwg no disponible???");
......
133 139
//				} catch (ClassNotFoundException e1) {
134 140
//					return;
135 141
//				}
136
				
142

  
137 143
				if(!(driver instanceof com.iver.cit.gvsig.fmap.drivers.AbstractCadMemoryDriver))
138 144
						return;
139 145
				/*
......
141 147
				 */
142 148
				if(!(driver instanceof DwgMemoryDriver)){
143 149
					JOptionPane.showConfirmDialog(null,
144
							"Esta herramienta s?lo funciona con libFMap del HEAD.\nVer comentarios en el codigo de esta clase."  
150
							"Esta herramienta s?lo funciona con libFMap del HEAD.\nVer comentarios en el codigo de esta clase."
145 151
					);
146 152
					return;
147 153
				}
148 154

  
149 155
				final com.iver.cit.gvsig.fmap.drivers.AbstractCadMemoryDriver dwgDriver = (com.iver.cit.gvsig.fmap.drivers.AbstractCadMemoryDriver)driver;
150 156
				double realTol = mapCtrl.getViewPort().toMapDistance(pixelTolerance);
151
				
157

  
152 158
					Rectangle2D recPoint = new Rectangle2D.Double(pReal.getX() - (realTol / 2),
153 159
			                pReal.getY() - (realTol / 2), realTol, realTol);
154
				
160

  
155 161
					try {
156 162
						vectLyr.process(new FeatureVisitor(){
157
							public void visit(IGeometry g, int index) throws VisitException {
158
								/* 
163
							public void visit(IGeometry g, int index) throws VisitorException {
164
								/*
159 165
								 * Cambiar la comentarizacion de las dos lineas de abajo
160 166
								 * para funcione la herramienta en libFMap del HEAD.
161 167
								 * No funciona en la v10 porque AbstractCadMemoryDriver
......
166 172
//								DwgObject dwgObj = (DwgObject) dwgDriver.getCadSource(index);
167 173
								DwgObject dwgObj = (DwgObject) ((DwgMemoryDriver)dwgDriver).getCadSource(index);
168 174

  
175

  
169 176
								DwgHandleReference handle = dwgObj.getLayerHandle();
170 177
								int lyrHdlCode = handle.getCode();
171 178
								int lyrHdl = handle.getOffset();
......
177 184
								return "";
178 185
							}
179 186

  
180
							public void stop(FLayer layer) {
187
							public void stop(FLayer layer) throws VisitorException {
181 188
							}
182 189

  
183
							public boolean start(FLayer layer) {
190
							public boolean start(FLayer layer) throws StartVisitorException {
184 191
								return true;
185 192
							}}, recPoint);
186
					} catch (VisitException e) {
193
					} catch (VisitorException e) {
187 194
						// TODO Auto-generated catch block
188 195
						e.printStackTrace();
189
					} catch (DriverException e) {
196
					} catch (ReadDriverException e) {
190 197
						// TODO Auto-generated catch block
191 198
						e.printStackTrace();
192
					}//try
193
			}//while	
199
					} catch (ExpansionFileReadException e) {
200
						// TODO Auto-generated catch block
201
						e.printStackTrace();
202
					}
203
			}//while
194 204
	    }
195 205

  
196 206
	    public Cursor getCursor() {
trunk/extensions/extCatalogYNomenclator/.classpath
17 17
	<classpathentry combineaccessrules="false" kind="src" path="/appgvSIG"/>
18 18
	<classpathentry sourcepath="/libCq CMS for java" kind="lib" path="/libFMap/lib/cms.jar"/>
19 19
	<classpathentry kind="src" path="src-test"/>
20
	<classpathentry sourcepath="/libExceptions" kind="lib" path="/libFMap/lib/gvsig-exceptions.jar"/>
20 21
	<classpathentry kind="output" path="bin"/>
21 22
</classpath>
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/loaders/WCSLayerLoader.java
46 46

  
47 47
import org.gvsig.i18n.Messages;
48 48

  
49
import com.iver.cit.gvsig.fmap.DriverException;
49
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException;
50 50
import com.iver.cit.gvsig.fmap.layers.FLayer;
51 51
import com.iver.utiles.extensionPoints.ExtensionPoint;
52 52
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
......
55 55

  
56 56
/**
57 57
 * This class is used to load a WCS  layer in gvSIG
58
 * 
58
 *
59 59
 * @author Jorge Piera Llodra (piera_jor@gva.es)
60 60
 */
61 61
public class WCSLayerLoader extends LayerLoader{
62
	
63
	
62

  
63

  
64 64
	public WCSLayerLoader(Resource resource) {
65 65
		super(resource);
66 66
	}
67
	
67

  
68 68
	/**
69 69
	 * This method loads a WSC layer from a full URL
70 70
	 * @param link
71
	 * @throws LayerLoaderException 
71
	 * @throws LayerLoaderException
72 72
	 */
73
	public void loadLayer() throws LayerLoaderException {
73
	public void loadLayer() throws LoadLayerException {
74 74
		String link = getResource().getLinkage();
75 75
		String name = getResource().getName();
76
		try {
77
			FLayer flayer = createWCSLayer(link,name);
78
			addLayerToView(flayer);
79
		} catch (IOException e) {
80
			throw new LayerLoaderException(e.getMessage(),getWindowMessage());
81
		} catch (DriverException e) {
82
			throw new LayerLoaderException(e.getMessage(),getWindowMessage());
83
		}		
84
	}   	
85
	
86
	private FLayer createWCSLayer(String link,String name) throws IOException, DriverException, LayerLoaderException {
76
		FLayer flayer = createWCSLayer(link,name);
77
		addLayerToView(flayer);
78
	}
79

  
80

  
81
	private FLayer createWCSLayer(String link,String name) throws LoadLayerException {
87 82
		Map args = initFromQueryString(link,name);
88 83
		ExtensionPoint extensionPoint = (ExtensionPoint)ExtensionPointsSingleton.getInstance().get("CatalogLayers");
89 84
		try {
90 85
			return (FLayer)extensionPoint.create("OGC:WCS", args  );
91 86
		} catch(Exception e) {
92
			throw new LayerLoaderException(getErrorMessage(),getWindowMessage());
93
		}		
87
			throw new LoadLayerException(getResource().getName(),e);
88
		}
94 89
	}
95
	
90

  
96 91
	/**
97 92
	 * Builds a coverage starting from a full GetCoverage URL.
98 93
	 * (Using this is not a regular function)
......
108 103
			queryString = "";
109 104
		}
110 105
		queryString = link.substring(link.indexOf('?')+1);
111
		
112
		TreeMap map = new TreeMap(); 
106

  
107
		TreeMap map = new TreeMap();
113 108
		String[] params = queryString.split("&");
114 109
		for (int i = 0; i < params.length; i++) {
115 110
			if (params[i]!= null){
......
126 121
			map.put("COVERAGE",name);
127 122
		}
128 123
		return map;
129
	}	
130
	
124
	}
125

  
131 126
	/*
132 127
	 *  (non-Javadoc)
133 128
	 * @see es.gva.cit.gvsig.catalogClient.loaders.LayerLoader#getErrorMessage()
134 129
	 */
135 130
	protected String getErrorMessage() {
136 131
		return Messages.getText("wcsError") + ".\n" +
137
		Messages.getText("link") + ": " + 
138
		getResource().getLinkage();		
132
		Messages.getText("link") + ": " +
133
		getResource().getLinkage();
139 134
	}
140
	
135

  
141 136
	/*
142 137
	 *  (non-Javadoc)
143 138
	 * @see es.gva.cit.gvsig.catalogClient.loaders.LayerLoader#getWindowMessage()
......
145 140
	protected String getWindowMessage() {
146 141
		return Messages.getText("wcsLoad");
147 142
	}
148
	
149
	
150
	
143

  
144

  
145

  
151 146
}
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/loaders/WMSLayerLoader.java
50 50
import org.gvsig.i18n.Messages;
51 51

  
52 52
import com.iver.andami.PluginServices;
53
import com.iver.cit.gvsig.fmap.drivers.UnsupportedVersionException;
53
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException;
54
import com.iver.cit.gvsig.exceptions.layers.UnsupportedVersionLayerException;
54 55
import com.iver.cit.gvsig.fmap.layers.FLayer;
55 56
import com.iver.cit.gvsig.project.documents.view.gui.View;
56 57
import com.iver.utiles.extensionPoints.ExtensionPoint;
......
60 61

  
61 62
/**
62 63
 * This class is used to load a WMS layer in gvSIG
63
 * 
64
 *
64 65
 * @author Jorge Piera Llodra (piera_jor@gva.es)
65 66
 */
66 67
public class WMSLayerLoader extends LayerLoader{
67
	
68
	
68

  
69

  
69 70
	public WMSLayerLoader(Resource resource) {
70 71
		super(resource);
71 72
		//load(getResource().getLinkage(),getResource().getName());
72 73
	}
73
	
74

  
74 75
	/**
75
	 * This function loads a WMS resource 
76
	 * This function loads a WMS resource
76 77
	 * @param host
77 78
	 * URL where the server is located
78 79
	 * @param sLayer
79 80
	 * Layer name
80 81
	 * @param crs
81 82
	 * Coordenates System
82
	 * @throws LayerLoaderException 
83
	 * @throws LayerLoaderException
83 84
	 */
84
	
85
	public void loadLayer() throws LayerLoaderException {
85

  
86
	public void loadLayer() throws LoadLayerException {
86 87
		String host = getResource().getLinkage();
87 88
		String sLayer = getResource().getName();
88
		
89

  
89 90
		FLayer flayer;
90
		
91

  
91 92
		try {
92 93
			flayer = createWMSLayer(host, sLayer);
93 94
			addLayerToView(flayer);
94 95
		} catch (Exception e) {
95
			throw new LayerLoaderException(e.getMessage(),getWindowMessage());
96
		}   		    
97
		
96
			throw new LoadLayerException(sLayer,e);
97
		}
98

  
98 99
	}
99
	
100

  
100 101
	/**
101 102
	 * It retrieves a getCapabilities file and loads the layer in gvSIG
102 103
	 * @param host
......
110 111
	 * @throws MalformedURLException
111 112
	 * @throws WMSException
112 113
	 * @throws IOException
113
	 * @throws UnsupportedVersionException 
114
	 * @throws ValidationException 
115
	 * @throws IllegalStateException 
116
	 * @throws LayerLoaderException 
114
	 * @throws UnsupportedVersionLayerException
115
	 * @throws ValidationException
116
	 * @throws IllegalStateException
117
	 * @throws LayerLoaderException
117 118
	 */
118
	private FLayer createWMSLayer(String host, String sLayer) throws  LayerLoaderException{
119
	private FLayer createWMSLayer(String host, String sLayer) throws  LoadLayerException{
119 120
		ExtensionPoint extensionPoint = (ExtensionPoint)ExtensionPointsSingleton.getInstance().get("CatalogLayers");
120 121
		Map args = new HashMap();
121 122
		args.put("host",host);
122 123
		args.put("layer",sLayer);
123
		View activeView = 
124
		View activeView =
124 125
			(View) PluginServices.getMDIManager().getActiveWindow();
125 126
		args.put("SRS",activeView.getProjection().getAbrev());
126 127
		try {
127 128
			return (FLayer)extensionPoint.create("OGC:WMS", args  );
128 129
		} catch(Exception e) {
129
			throw new LayerLoaderException(getErrorMessage(),getWindowMessage());
130
			throw new LoadLayerException(sLayer,e);
130 131
		}
131 132
	}
132
	
133

  
133 134
	/*
134 135
	 *  (non-Javadoc)
135 136
	 * @see es.gva.cit.gvsig.catalogClient.loaders.LayerLoader#getErrorMessage()
136 137
	 */
137 138
	protected String getErrorMessage() {
138 139
		return Messages.getText("wmsError") + ".\n" +
139
		Messages.getText("server") + ": " + 
140
		Messages.getText("server") + ": " +
140 141
		getResource().getLinkage() + "\n" +
141 142
		Messages.getText("layer") + ": " +
142
		getResource().getName();		
143
		getResource().getName();
143 144
	}
144
	
145

  
145 146
	/*
146 147
	 *  (non-Javadoc)
147 148
	 * @see es.gva.cit.gvsig.catalogClient.loaders.LayerLoader#getWindowMessage()
148 149
	 */
149 150
	protected String getWindowMessage() {
150 151
		return Messages.getText("loadWMS");
151
	}	
152
	}
152 153
}

Also available in: Unified diff