Revision 28954 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java

View differences:

FLyrVect.java
1142 1142
				} else {
1143 1143
					isLabeled = false;
1144 1144
				}
1145
			} else if (legendXML.contains("labelFieldName")) {
1145
			} else if (legendXML.contains("labelFieldName")|| legendXML.contains("labelfield")) {
1146 1146
    			/* (jaume) begin patch;
1147 1147
        		 * for backward compatibility purposes. Since gvSIG v1.1 labeling is
1148 1148
        		 * no longer managed by the Legend but by the ILabelingStrategy. The
1149 1149
        		 * following allows restoring older projects' labelings.
1150 1150
        		 */
1151
        			String labelTextField = legendXML.getStringProperty("labelFieldName");
1152
        			if (labelTextField != null) {
1153
        				AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1154
        				labeling.setLayer(this);
1155
        				labeling.setUsesFixedSize(true);
1156
        				labeling.setFixedSize(10);
1157
        				labeling.setTextField(legendXML.getStringProperty("labelFieldName"));
1158
        				labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName"));
1159
        				labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName"));
1160
        				this.setLabelingStrategy(labeling);
1161
        				this.setIsLabeled(true);
1162
        			}
1151
				String labelTextField =	null;
1152
    			if (legendXML.contains("labelFieldName")){
1153
    				labelTextField = legendXML.getStringProperty("labelFieldName");
1154
    				if (labelTextField != null) {
1155
    					AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1156
    					labeling.setLayer(this);
1157
    					labeling.setUsesFixedSize(true);
1158
    					labeling.setFixedSize(10);
1159
    					labeling.setTextField(labelTextField);
1160
    					labeling.setHeightField(legendXML.getStringProperty("labelHeightFieldName"));
1161
    					labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName"));
1162
    					this.setLabelingStrategy(labeling);
1163
    					this.setIsLabeled(true);
1164
    				}
1165
    			}else{
1166
    				labelTextField = legendXML.getStringProperty("labelfield");
1167
    				if (labelTextField != null) {
1168
    					AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy();
1169
    					labeling.setLayer(this);
1170
    					labeling.setUsesFixedSize(true);
1171
    					labeling.setFixedSize(10);
1172
    					labeling.setTextField(labelTextField);
1173
    					labeling.setHeightField(legendXML.getStringProperty("labelFieldHeight"));
1174
    					labeling.setRotationField(legendXML.getStringProperty("labelFieldRotation"));
1175
    					this.setLabelingStrategy(labeling);
1176
    					this.setIsLabeled(true);
1177
    				}
1178
    			}
1163 1179
        	}else{
1164 1180
				isLabeled = false;
1165 1181
			}

Also available in: Unified diff