Revision 41350 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 | ||
---|---|---|
146 | 146 |
*/ |
147 | 147 |
protected ArrayList layerListeners = new ArrayList(); |
148 | 148 |
|
149 |
|
|
150 |
/** |
|
151 |
* Hash table with the extended properties of this layer. |
|
152 |
* |
|
153 |
* @see #getProperty(Object) |
|
154 |
* @see #setProperty(Object, Object) |
|
155 |
* @see #getExtendedProperties() |
|
156 |
*/ |
|
157 |
private Map properties = new Hashtable(); |
|
158 |
|
|
159 | 149 |
//by default, all is active, visible and avalaible |
160 | 150 |
/** |
161 | 151 |
* Status of this layer. |
... | ... | |
203 | 193 |
*/ |
204 | 194 |
private long drawVersion= 0L; |
205 | 195 |
|
196 |
|
|
197 |
private ExtendedPropertiesHelper properties = new ExtendedPropertiesHelper(); |
|
198 |
|
|
206 | 199 |
public FLyrDefault(MetadataContainer metadataContainer) { |
207 | 200 |
this.metadataContainer = metadataContainer; |
208 | 201 |
} |
... | ... | |
220 | 213 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getProperty(java.lang.Object) |
221 | 214 |
*/ |
222 | 215 |
public Object getProperty(Object key) { |
223 |
return properties.get(key); |
|
216 |
return properties.getProperty(key);
|
|
224 | 217 |
} |
225 | 218 |
/* |
226 | 219 |
* (non-Javadoc) |
227 | 220 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#setProperty(java.lang.Object, java.lang.Object) |
228 | 221 |
*/ |
229 | 222 |
public void setProperty(Object key, Object val) { |
230 |
properties.put(key, val);
|
|
223 |
properties.setProperty(key, val);
|
|
231 | 224 |
} |
232 | 225 |
/* |
233 | 226 |
* (non-Javadoc) |
234 | 227 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getExtendedProperties() |
235 | 228 |
*/ |
236 | 229 |
public Map getExtendedProperties() { |
237 |
return properties; |
|
230 |
return properties.getExtendedProperties();
|
|
238 | 231 |
} |
239 | 232 |
/* |
240 | 233 |
* (non-Javadoc) |
... | ... | |
942 | 935 |
state.set("coordTrans",ct); |
943 | 936 |
state.set("name", getName()); |
944 | 937 |
state.set("crs", getProjection()); |
945 |
state.set("properties",properties); |
|
938 |
state.set("properties",properties.getExtendedProperties());
|
|
946 | 939 |
} |
947 | 940 |
|
948 | 941 |
public void loadFromState(PersistentState state) throws PersistenceException { |
... | ... | |
956 | 949 |
this.setDynValue(METADATA_NAME, state.getString("name")); |
957 | 950 |
this.setDynValue(METADATA_CRS, state.get("crs")); |
958 | 951 |
|
959 |
this.properties = new Hashtable((Map)state.get("properties")); |
|
952 |
this.properties.setExtendedProperties(new Hashtable((Map)state.get("properties"))); |
|
953 |
|
|
960 | 954 |
} |
961 | 955 |
|
962 | 956 |
public static void registerPersistent() { |
... | ... | |
976 | 970 |
definition.addDynFieldObject("parentLayer").setClassOfValue(FLayers.class).setMandatory(false); |
977 | 971 |
definition.addDynFieldObject("coordTrans").setClassOfValue(ICoordTrans.class).setMandatory(false); |
978 | 972 |
definition.addDynFieldObject("status").setClassOfValue(FLayerStatus.class).setMandatory(true); |
979 |
definition.addDynFieldMap("properties").setClassOfItems(Object.class)
|
|
973 |
definition.addDynFieldMap("properties").setClassOfItems(Object.class)
|
|
980 | 974 |
.setMandatory(true); |
975 |
|
|
981 | 976 |
} |
982 | 977 |
|
983 | 978 |
|
Also available in: Unified diff