Revision 28544 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java
FLyrVect.java | ||
---|---|---|
1215 | 1215 |
super.setXMLEntity(xml); |
1216 | 1216 |
XMLEntity legendXML = xml.getChild(0); |
1217 | 1217 |
IVectorLegend leg = LegendFactory.createFromXML(legendXML); |
1218 |
/* (jaume) begin patch; |
|
1219 |
* for backward compatibility purposes. Since gvSIG v1.1 labeling is |
|
1220 |
* no longer managed by the Legend but by the ILabelingStrategy. The |
|
1221 |
* following allows restoring older projects' labelings. |
|
1222 |
*/ |
|
1223 |
if (legendXML.contains("labelFieldName")) { |
|
1224 |
String labelTextField = legendXML.getStringProperty("labelFieldName"); |
|
1225 |
if (labelTextField != null) { |
|
1226 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy(); |
|
1227 |
labeling.setLayer(this); |
|
1228 |
labeling.setTextField(legendXML.getStringProperty("labelFieldName")); |
|
1229 |
labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName")); |
|
1230 |
labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName")); |
|
1231 |
this.setLabelingStrategy(labeling); |
|
1232 |
this.setIsLabeled(true); |
|
1233 |
} |
|
1234 |
} |
|
1218 |
|
|
1235 | 1219 |
/* end patch */ |
1236 | 1220 |
try { |
1237 | 1221 |
getRecordset().getSelectionSupport().setXMLEntity(xml.getChild(1)); |
... | ... | |
1295 | 1279 |
// no strategy was set, just continue; |
1296 | 1280 |
logger.warn("Reached what should be unreachable code"); |
1297 | 1281 |
} |
1298 |
} else { |
|
1299 |
if(!containsIsLabeled){ |
|
1282 |
} else if (legendXML.contains("labelFieldName")) { |
|
1283 |
/* (jaume) begin patch; |
|
1284 |
* for backward compatibility purposes. Since gvSIG v1.1 labeling is |
|
1285 |
* no longer managed by the Legend but by the ILabelingStrategy. The |
|
1286 |
* following allows restoring older projects' labelings. |
|
1287 |
*/ |
|
1288 |
String labelTextField = legendXML.getStringProperty("labelFieldName"); |
|
1289 |
if (labelTextField != null) { |
|
1290 |
AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy(); |
|
1291 |
labeling.setLayer(this); |
|
1292 |
labeling.setUsesFixedSize(true); |
|
1293 |
labeling.setFixedSize(10); |
|
1294 |
labeling.setTextField(legendXML.getStringProperty("labelFieldName")); |
|
1295 |
labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName")); |
|
1296 |
labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName")); |
|
1297 |
this.setLabelingStrategy(labeling); |
|
1298 |
this.setIsLabeled(true); |
|
1299 |
} |
|
1300 |
}else if(!containsIsLabeled){ |
|
1300 | 1301 |
isLabeled = false; |
1301 |
} |
|
1302 | 1302 |
} |
1303 | 1303 |
|
1304 | 1304 |
// compatibility with hyperlink from 1.9 alpha version... do we really need to be compatible with alpha versions?? |
Also available in: Unified diff