Revision 11756

View differences:

branches/v10/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java
994 994
        Point2D p = null;
995 995
        // FLabel[] lbls = geom.createLabels(0, true);
996 996
        Rectangle2D r=geom.getBounds2D();
997
       	p=new Point2D.Double(r.getCenterX(),r.getCenterY());
997
        if (geom.getInternalShape() instanceof FPolygon2D){
998
        	r=new Rectangle2D.Double(r.getX()-r.getWidth()/2,r.getY()-r.getHeight()/2,r.getWidth(),r.getHeight());
999
        }
1000
        p=new Point2D.Double(r.getCenterX(),r.getCenterY());
998 1001

  
999 1002
        // assuming FShape is a point with the starting position of the text
1000 1003
        // Font font = symbol.getFont();
branches/v10/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java
81 81
import com.iver.cit.gvsig.fmap.operations.strategies.DefaultStrategy;
82 82
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
83 83
import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend;
84
import com.iver.cit.gvsig.project.documents.view.legend.CreateSpatialIndexMonitorableTask;
84 85
import com.iver.utiles.swing.threads.Cancellable;
85 86
import com.vividsolutions.jts.geom.Geometry;
86 87
import com.vividsolutions.jts.geom.IntersectionMatrix;
......
354 355

  
355 356
                // sym.setDescription(vv[idTextField].toString());
356 357
                // sym.setRotation((int) rotation);
357
                FLabel[] aux = geom.createLabels(0, true);
358
                Rectangle2D r=geom.getBounds2D();
359
                FLabel[] aux = new FLabel[]{new FLabel()};//geom.createLabels(0, true);
360
                aux[0].setOrig(new Point2D.Double(r.getX(),r.getY()));
358 361
                aux[0].setHeight(size);
359 362
                aux[0].setRotation((int) rotation);
360 363
                aux[0].setString(vv[idTextField].toString());

Also available in: Unified diff