Revision 28544

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/adapter/GeometryAdapter.java
281 281
    	return cloneAdapter;
282 282
    }
283 283
    public Rectangle2D getBounds2D(){
284
    	Rectangle2D r=shape.getBounds2D();
285
    	if (r.getWidth()<0.5) {
286
    		return new Rectangle2D.Double(r.getX()-0.25,r.getY(),0.5,r.getHeight());
287
    	}else if(r.getHeight()<0.5) {
288
    		return new Rectangle2D.Double(r.getX(),r.getY()-0.25,r.getWidth(),0.5);
289
    	}
290
    	return shape.getBounds2D();
291
    }
284
        Rectangle2D r=shape.getBounds2D();
285
        double w=r.getWidth();
286
        double h=r.getHeight();
287
        boolean modified=false;
288
        if (r.getWidth()<0.5) {
289
         modified=true;
290
         w=0.5;
291
        }
292
        if(r.getHeight()<0.5) {
293
         modified=true;
294
         h=0.5;
295
        }
296
        if (modified)
297
         return new Rectangle2D.Double(r.getX(),r.getY()-0.25,w,h);
298
        return shape.getBounds2D();
299
   }
292 300
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/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