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 |
}
|