Revision 42877 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/FLyrDefault.java
FLyrDefault.java | ||
---|---|---|
100 | 100 |
* Flag to set the layer as a temporary layer. |
101 | 101 |
*/ |
102 | 102 |
private boolean temporary; |
103 |
|
|
103 |
|
|
104 | 104 |
/** |
105 | 105 |
* Path to the upper layer which this layer belongs. |
106 | 106 |
* |
... | ... | |
200 | 200 |
*/ |
201 | 201 |
private long drawVersion= 0L; |
202 | 202 |
|
203 |
|
|
203 |
|
|
204 | 204 |
private ExtendedPropertiesHelper properties = new ExtendedPropertiesHelper(); |
205 |
|
|
205 |
|
|
206 | 206 |
public FLyrDefault(MetadataContainer metadataContainer) { |
207 | 207 |
this.metadataContainer = metadataContainer; |
208 | 208 |
} |
... | ... | |
416 | 416 |
this.updateDrawVersion(); |
417 | 417 |
} |
418 | 418 |
} |
419 |
|
|
420 | 419 |
|
420 |
|
|
421 | 421 |
/* |
422 | 422 |
* (non-Javadoc) |
423 | 423 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getMapContext() |
... | ... | |
464 | 464 |
} catch (Exception ex) { |
465 | 465 |
logger.warn("Error calling listener '"+listener.toString()+"'.", ex); |
466 | 466 |
} |
467 |
}
|
|
467 |
} |
|
468 | 468 |
} |
469 | 469 |
/** |
470 | 470 |
* Called by the method {@linkplain #setName(String)}. Notifies all listeners associated to this layer, |
... | ... | |
481 | 481 |
} catch (Exception ex) { |
482 | 482 |
logger.warn("Error calling listener '"+listener.toString()+"'.", ex); |
483 | 483 |
} |
484 |
}
|
|
484 |
} |
|
485 | 485 |
} |
486 | 486 |
|
487 | 487 |
/** |
... | ... | |
499 | 499 |
} catch (Exception ex) { |
500 | 500 |
logger.warn("Error calling listener '"+listener.toString()+"'.", ex); |
501 | 501 |
} |
502 |
}
|
|
502 |
} |
|
503 | 503 |
} |
504 | 504 |
|
505 | 505 |
/** |
... | ... | |
655 | 655 |
} catch (Exception ex) { |
656 | 656 |
logger.warn("Error calling listener '"+listener.toString()+"'.", ex); |
657 | 657 |
} |
658 |
}
|
|
658 |
} |
|
659 | 659 |
} |
660 |
|
|
660 |
|
|
661 | 661 |
/* |
662 | 662 |
* (non-Javadoc) |
663 | 663 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#isEditing() |
... | ... | |
672 | 672 |
public String getTocImageIcon() { |
673 | 673 |
return "layer-icon"; |
674 | 674 |
} |
675 |
|
|
675 |
|
|
676 | 676 |
/* |
677 | 677 |
* (non-Javadoc) |
678 | 678 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#isInTOC() |
... | ... | |
709 | 709 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#reload() |
710 | 710 |
*/ |
711 | 711 |
public void reload() throws ReloadLayerException { |
712 |
if(this.ct!=null){ |
|
713 |
IProjection srcProj = this.ct.getPOrig(); |
|
714 |
if(!this.getProjection().equals(srcProj)){ |
|
715 |
this.ct = this.getProjection().getCT(this.ct.getPDest()); |
|
716 |
} |
|
717 |
} |
|
712 | 718 |
this.setAvailable(true); |
713 | 719 |
} |
714 | 720 |
|
... | ... | |
770 | 776 |
public void addError(BaseException exception){ |
771 | 777 |
status.addLayerError(exception); |
772 | 778 |
} |
773 |
|
|
779 |
|
|
774 | 780 |
@Override |
775 | 781 |
public void setError(Exception ex) { |
776 | 782 |
this.status.setLayerError(ex); |
777 | 783 |
} |
778 |
|
|
784 |
|
|
779 | 785 |
/* |
780 | 786 |
* (non-Javadoc) |
781 | 787 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#visibleRequired() |
... | ... | |
940 | 946 |
public void visibilityChanged(LayerEvent e) { |
941 | 947 |
|
942 | 948 |
} |
943 |
|
|
949 |
|
|
944 | 950 |
// ======================================================== |
945 |
|
|
951 |
|
|
946 | 952 |
public void saveToState(PersistentState state) throws PersistenceException { |
947 | 953 |
try { |
948 | 954 |
state.set("parentLayer", (Persistent)parentLayer); |
... | ... | |
967 | 973 |
try { |
968 | 974 |
this.setDynValue(METADATA_NAME, state.getString("name")); |
969 | 975 |
this.setDynValue(METADATA_CRS, state.get("crs")); |
970 |
|
|
976 |
|
|
971 | 977 |
this.parentLayer = (FLayers) state.get("parentLayer"); |
972 | 978 |
this.status = (FLayerStatus) state.get("status"); |
973 | 979 |
this.minScale = state.getDouble("minScale"); |
... | ... | |
993 | 999 |
FLyrDefault.class, |
994 | 1000 |
"FLyrDefault", |
995 | 1001 |
"FLyrDefault Persistence definition", |
996 |
null,
|
|
1002 |
null, |
|
997 | 1003 |
null |
998 | 1004 |
); |
999 | 1005 |
definition.addDynFieldString("name").setMandatory(false); |
... | ... | |
1006 | 1012 |
definition.addDynFieldObject("status").setClassOfValue(FLayerStatus.class).setMandatory(true); |
1007 | 1013 |
definition.addDynFieldMap("properties").setClassOfItems(Object.class) |
1008 | 1014 |
.setMandatory(true); |
1009 |
|
|
1015 |
|
|
1010 | 1016 |
return Boolean.TRUE; |
1011 | 1017 |
} |
1012 | 1018 |
} |
1013 | 1019 |
|
1014 |
|
|
1020 |
|
|
1015 | 1021 |
// /** |
1016 | 1022 |
// * Splits string into an array of strings |
1017 | 1023 |
// * @param input input string |
... | ... | |
1021 | 1027 |
// public static String[] splitString(String input, String sep) { |
1022 | 1028 |
// return Pattern.compile(sep).split(input, 0); |
1023 | 1029 |
// } |
1024 |
|
|
1030 |
|
|
1025 | 1031 |
public void clear() { |
1026 | 1032 |
if (metadataContainer != null) { |
1027 | 1033 |
metadataContainer.clear(); |
1028 | 1034 |
} |
1029 | 1035 |
} |
1030 |
|
|
1036 |
|
|
1031 | 1037 |
public String getMetadataName() throws MetadataException { |
1032 | 1038 |
return FLayer.METADATA_DEFINITION_NAME; |
1033 | 1039 |
} |
1034 |
|
|
1040 |
|
|
1035 | 1041 |
public static class RegisterMetadata implements Callable { |
1036 | 1042 |
|
1037 | 1043 |
public Object call() { |
... | ... | |
1063 | 1069 |
public String toString() { |
1064 | 1070 |
return this.getName(); |
1065 | 1071 |
} |
1066 |
|
|
1072 |
|
|
1067 | 1073 |
public boolean hidesThisArea(Envelope area) { |
1068 | 1074 |
return false; |
1069 | 1075 |
} |
1070 |
|
|
1076 |
|
|
1071 | 1077 |
public boolean isTemporary() { |
1072 | 1078 |
return this.temporary; |
1073 | 1079 |
} |
1074 |
|
|
1080 |
|
|
1075 | 1081 |
public void setTemporary(boolean temporary) { |
1076 | 1082 |
this.temporary = temporary; |
1077 | 1083 |
} |
Also available in: Unified diff