Revision 5908 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java

View differences:

FLyrDefault.java
86 86

  
87 87
    private Strategy privateStrategy = null;
88 88
	private boolean isediting;
89
	
89

  
90 90
	private Hashtable properties = new Hashtable();
91
	
91

  
92 92
	public Object getProperty(Object key)
93 93
	{
94 94
		return properties.get(key);
......
96 96
	public void setProperty (Object key, Object val){
97 97
		properties.put(key, val);
98 98
	}
99
	
99

  
100 100
	/**
101 101
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#setActive(boolean)
102 102
	 */
......
172 172
	 * @param proj Proyecci?n.
173 173
	 */
174 174
	public void setProjection(IProjection proj) {
175
		projection = proj;   
175
		projection = proj;
176 176
        // Comprobar que la proyecci?n es la misma que la de FMap
177
        // Si no lo es, es una capa que est? reproyectada al vuelo 
177
        // Si no lo es, es una capa que est? reproyectada al vuelo
178 178
        if ((proj != null) && (getFMap() != null))
179 179
            if (proj != getFMap().getProjection())
180 180
            {
181 181
                ICoordTrans ct = new CoordTrans((CoordSys) proj,
182 182
                        (CoordSys) getFMap().getProjection());
183 183
                setCoordTrans(ct);
184
                logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev() 
184
                logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev()
185 185
                        + " y capa " + getName() + " con " + proj.getAbrev());
186
            }        
186
            }
187 187
	}
188 188

  
189 189
	/**
......
234 234
		xml.putProperty("name", name);
235 235
		xml.putProperty("minScale",minScale);
236 236
		xml.putProperty("maxScale",maxScale);
237
		
237

  
238 238
		//TODO xml.addChild(parentLayer.getXMLEntity());
239 239
		xml.putProperty("visible", visible);
240 240
		if (projection != null) {
......
259 259
		active = xml.getBooleanProperty("active");
260 260
		name = xml.getStringProperty("name");
261 261
		minScale=xml.getDoubleProperty("minScale");
262
		maxScale=xml.getDoubleProperty("maxScale");		
262
		maxScale=xml.getDoubleProperty("maxScale");
263 263
		visible = xml.getBooleanProperty("visible");
264 264
		if (xml.contains("proj")) {
265 265
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
282 282
		active = xml.getBooleanProperty("active");
283 283
		name = xml.getStringProperty("name");
284 284
		minScale=xml.getDoubleProperty("minScale");
285
		maxScale=xml.getDoubleProperty("maxScale");		
285
		maxScale=xml.getDoubleProperty("maxScale");
286 286
		visible = xml.getBooleanProperty("visible");
287 287
		if (xml.contains("proj")) {
288 288
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
307 307
		active = xml.getBooleanProperty("active");
308 308
		name = xml.getStringProperty("name");
309 309
		minScale=xml.getDoubleProperty("minScale");
310
		maxScale=xml.getDoubleProperty("maxScale");	
310
		maxScale=xml.getDoubleProperty("maxScale");
311 311
		visible = xml.getBooleanProperty("visible");
312 312
		if (xml.contains("proj")) {
313 313
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
......
339 339
			return false;
340 340
		return layerListeners.add(o);
341 341
	}
342

  
342
	public LayerListener[] getLayerListeners() {
343
		return (LayerListener[])layerListeners.toArray(new LayerListener[0]);
344
	}
343 345
	/**
344 346
	 * Borra de la lista de listeners el que se pasa como par?metro.
345 347
	 *
......
443 445
	public ICoordTrans getCoordTrans() {
444 446
		return ct;
445 447
	}
446
	
448

  
447 449
	/**
448 450
	 * M?todo que es llamado por Flayers para notificar a la capa que
449 451
	 * va a ser a?adida. Esta previa notificaci?n es util para las capas que
450 452
	 * necesitan hacer algo antes de ser a?adida. Por ejemplo, el raster necesita
451
	 * volver a abrir el fichero que ha podido ser cerrado con anterioridad. 
453
	 * volver a abrir el fichero que ha podido ser cerrado con anterioridad.
452 454
	 * Si no se redefine este m?todo no se har? nada ya que este es vacio.
453 455
	 */
454 456
	public void wakeUp(){}
455
	
457

  
456 458
    public double getMinScale() {
457 459
        return minScale;
458 460
    }
......
463 465
    public double getMaxScale() {
464 466
        return maxScale;
465 467
    }
466
	
468

  
467 469
    public void setMinScale(double minScale)
468 470
    {
469 471
        this.minScale = minScale;
......
472 474
    {
473 475
        this.maxScale = maxScale;
474 476
    }
475
    
477

  
476 478
    public boolean isWithinScale(double scale)
477 479
    {
478
       
480

  
479 481
        boolean bVisible = true;
480 482
        if (getMinScale() != -1)
481 483
        {
......
487 489
            if (scale > getMaxScale())
488 490
                bVisible = false;
489 491
        }
490
        
492

  
491 493
        return bVisible;
492 494
    }
493
    
495

  
494 496
    public Strategy getStrategy()
495 497
    {
496 498
        return privateStrategy;
497 499
    }
498
    public void setStrategy(Strategy s)    
500
    public void setStrategy(Strategy s)
499 501
    {
500 502
        privateStrategy = s;
501 503
    }
......
514 516
	public boolean isEditing(){
515 517
		return isediting;
516 518
	}
517
    
519

  
518 520
    public ImageIcon getTocImageIcon() {
519
    	return null;    	
521
    	return null;
520 522
    }
521
    
523

  
522 524
    public boolean isInTOC() {
523 525
    	return isInTOC;
524 526
    }

Also available in: Unified diff