Revision 28953

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java
1280 1280
    				// no strategy was set, just continue;
1281 1281
    				logger.warn("Reached what should be unreachable code");
1282 1282
    			}
1283
    		} else if (legendXML.contains("labelFieldName")) {
1283
    		} else if (legendXML.contains("labelFieldName")|| legendXML.contains("labelfield")) {
1284 1284
    			/* (jaume) begin patch;
1285 1285
        		 * for backward compatibility purposes. Since gvSIG v1.1 labeling is
1286 1286
        		 * no longer managed by the Legend but by the ILabelingStrategy. The
1287 1287
        		 * following allows restoring older projects' labelings.
1288 1288
        		 */
1289
        			String labelTextField = legendXML.getStringProperty("labelFieldName");
1290
        			if (labelTextField != null) {
1291
        				AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1292
        				labeling.setLayer(this);
1293
        				labeling.setUsesFixedSize(true);
1294
        				labeling.setFixedSize(10);
1295
        				labeling.setTextField(legendXML.getStringProperty("labelFieldName"));
1296
        				labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName"));
1297
        				labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName"));
1298
        				this.setLabelingStrategy(labeling);
1299
        				this.setIsLabeled(true);
1300
        			}
1301
        	}else if(!containsIsLabeled){
1302
    				isLabeled = false;
1289
    			String labelTextField =	null;
1290
    			if (legendXML.contains("labelFieldName")){
1291
    				labelTextField = legendXML.getStringProperty("labelFieldName");
1292
    				if (labelTextField != null) {
1293
    					AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1294
    					labeling.setLayer(this);
1295
    					labeling.setUsesFixedSize(true);
1296
    					labeling.setFixedSize(10);
1297
    					labeling.setTextField(labelTextField);
1298
    					labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName"));
1299
    					labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName"));
1300
    					this.setLabelingStrategy(labeling);
1301
    					this.setIsLabeled(true);
1302
    				}
1303
    			}else{
1304
    				labelTextField = legendXML.getStringProperty("labelfield");
1305
    				if (labelTextField != null) {
1306
    					AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1307
    					labeling.setLayer(this);
1308
    					labeling.setUsesFixedSize(true);
1309
    					labeling.setFixedSize(10);
1310
    					labeling.setTextField(labelTextField);
1311
    					labeling.setHeightField(legendXML.getStringProperty("labelFieldHeight"));
1312
    					labeling.setRotationField(legendXML.getStringProperty("labelFieldRotation"));
1313
    					this.setLabelingStrategy(labeling);
1314
    					this.setIsLabeled(true);
1315
    				}
1316
    			}
1317

  
1318
    		}else if(!containsIsLabeled){
1319
    			isLabeled = false;
1303 1320
    		}
1304 1321

  
1305 1322
    		// compatibility with hyperlink from 1.9 alpha version... do we really need to be compatible with alpha versions??

Also available in: Unified diff