Revision 4376

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrRaster.java
101 101
	}
102 102

  
103 103
	/**
104
	 *Redefine wakeUp de FLyrDefault
105
	 */
106
	public void wakeUp(){
107
		setName(getName());
108
		setProjection(getProjection());
109
		try {
110
			load();
111
		} catch (DriverIOException e) {
112
			e.printStackTrace();
113
		}
114
	}
115
	
116
	/**
104 117
	 * Inserta el RasterAdapter.
105 118
	 *
106 119
	 * @param ra RasterAdapter.
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayers.java
153 153
	 * @throws CancelationException
154 154
	 */
155 155
	public void addLayer(FLayer layer) throws CancelationException {
156
		//Notificamos a la capa que va a ser a?adida
157
		if (layer instanceof FLyrDefault)
158
			((FLyrDefault)layer).wakeUp();
159
		
156 160
		if (layer instanceof FLayers){
157 161
			FLayers layers=(FLayers)layer;
158 162
			fmap.addAsCollectionListener(layers);
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/RasterFileAdapter.java
109 109
	 */
110 110
	public void stop() throws DriverIOException {
111 111
		try {
112
			driverInitialized = false;
112 113
			getFileDriver().close();
113 114
		} catch (IOException e) {
114 115
			throw new DriverIOException(e);
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java
157 157
	 * @param proj Proyecci?n.
158 158
	 */
159 159
	public void setProjection(IProjection proj) {
160
		projection = proj;
160
		projection = proj;   
161 161
        // Comprobar que la proyecci?n es la misma que la de FMap
162
        // Si no lo es, es una capa que est? reproyectada al vuelo
162
        // Si no lo es, es una capa que est? reproyectada al vuelo 
163 163
        if ((proj != null) && (getFMap() != null))
164 164
            if (proj != getFMap().getProjection())
165 165
            {
166 166
                ICoordTrans ct = new CoordTrans((CoordSys) proj,
167 167
                        (CoordSys) getFMap().getProjection());
168 168
                setCoordTrans(ct);
169
                logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev()
169
                logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev() 
170 170
                        + " y capa " + getName() + " con " + proj.getAbrev());
171
            }
171
            }        
172 172
	}
173 173

  
174 174
	/**
......
219 219
		xml.putProperty("name", name);
220 220
		xml.putProperty("minScale",minScale);
221 221
		xml.putProperty("maxScale",maxScale);
222

  
222
		
223 223
		//TODO xml.addChild(parentLayer.getXMLEntity());
224 224
		xml.putProperty("visible", visible);
225 225
		if (projection != null) {
......
244 244
		active = xml.getBooleanProperty("active");
245 245
		name = xml.getStringProperty("name");
246 246
		minScale=xml.getDoubleProperty("minScale");
247
		maxScale=xml.getDoubleProperty("maxScale");
247
		maxScale=xml.getDoubleProperty("maxScale");		
248 248
		visible = xml.getBooleanProperty("visible");
249 249
		if (xml.contains("proj")) {
250 250
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
267 267
		active = xml.getBooleanProperty("active");
268 268
		name = xml.getStringProperty("name");
269 269
		minScale=xml.getDoubleProperty("minScale");
270
		maxScale=xml.getDoubleProperty("maxScale");
270
		maxScale=xml.getDoubleProperty("maxScale");		
271 271
		visible = xml.getBooleanProperty("visible");
272 272
		if (xml.contains("proj")) {
273 273
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
290 290
		active = xml.getBooleanProperty("active");
291 291
		name = xml.getStringProperty("name");
292 292
		minScale=xml.getDoubleProperty("minScale");
293
		maxScale=xml.getDoubleProperty("maxScale");
293
		maxScale=xml.getDoubleProperty("maxScale");	
294 294
		visible = xml.getBooleanProperty("visible");
295 295
		if (xml.contains("proj")) {
296 296
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
426 426
	public ICoordTrans getCoordTrans() {
427 427
		return ct;
428 428
	}
429

  
429
	
430
	/**
431
	 * M?todo que es llamado por Flayers para notificar a la capa que
432
	 * va a ser a?adida. Esta previa notificaci?n es util para las capas que
433
	 * necesitan hacer algo antes de ser a?adida. Por ejemplo, el raster necesita
434
	 * volver a abrir el fichero que ha podido ser cerrado con anterioridad. 
435
	 * Si no se redefine este m?todo no se har? nada ya que este es vacio.
436
	 */
437
	public void wakeUp(){}
438
	
430 439
    public double getMinScale() {
431 440
        return minScale;
432 441
    }
......
437 446
    public double getMaxScale() {
438 447
        return maxScale;
439 448
    }
440

  
449
	
441 450
    public void setMinScale(double minScale)
442 451
    {
443 452
        this.minScale = minScale;
......
446 455
    {
447 456
        this.maxScale = maxScale;
448 457
    }
449

  
458
    
450 459
    public boolean isWithinScale(double scale)
451 460
    {
452

  
461
       
453 462
        boolean bVisible = true;
454 463
        if (getMinScale() != -1)
455 464
        {
......
461 470
            if (scale > getMaxScale())
462 471
                bVisible = false;
463 472
        }
464

  
473
        
465 474
        return bVisible;
466 475
    }
467

  
476
    
468 477
    public Strategy getStrategy()
469 478
    {
470 479
        return privateStrategy;
471 480
    }
472
    public void setStrategy(Strategy s)
481
    public void setStrategy(Strategy s)    
473 482
    {
474 483
        privateStrategy = s;
475 484
    }
......
488 497
	public boolean isEditing(){
489 498
		return isediting;
490 499
	}
491

  
492

  
500
    
501
    
493 502
}

Also available in: Unified diff