Revision 4795
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/AnnotationStrategy.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
2 | 2 |
|
3 |
import java.awt.Color; |
|
3 | 4 |
import java.awt.FontMetrics; |
4 | 5 |
import java.awt.Graphics2D; |
5 | 6 |
import java.awt.geom.AffineTransform; |
... | ... | |
16 | 17 |
|
17 | 18 |
import com.iver.cit.gvsig.fmap.DriverException; |
18 | 19 |
import com.iver.cit.gvsig.fmap.ViewPort; |
20 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
|
21 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
19 | 22 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
20 | 23 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
21 | 24 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
... | ... | |
52 | 55 |
*/ |
53 | 56 |
public class AnnotationStrategy extends DefaultStrategy { |
54 | 57 |
private static Logger logger = Logger.getLogger(AnnotationStrategy.class.getName()); |
58 |
private FSymbol symbolPoint=new FSymbol(FShape.POINT,Color.black); |
|
55 | 59 |
//private FLyrAnnotation la; |
56 | 60 |
//private ArrayList m_labels; |
57 | 61 |
|
... | ... | |
64 | 68 |
public AnnotationStrategy(FLayer layer) { |
65 | 69 |
super(layer); |
66 | 70 |
capa = (FLyrAnnotation) layer; |
71 |
symbolPoint.setSize(5); |
|
67 | 72 |
} |
68 | 73 |
/** |
69 | 74 |
* @see com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage, |
... | ... | |
83 | 88 |
ViewPort vp=viewPort;//capa.getFMap().getViewPort(); |
84 | 89 |
AffineTransform at=vp.getAffineTransform(); |
85 | 90 |
try { |
91 |
|
|
86 | 92 |
int numRows=lyrAnnotation.getSource().getShapeCount(); |
87 | 93 |
//long numRows=lyrAnnotation.getRecordset().getRowCount(); |
88 | 94 |
FontMetrics metrics = g.getFontMetrics(); |
... | ... | |
98 | 104 |
Rectangle2D r=getBoundBox(theLabel.getOrig(), g,(float)theLabel.getHeight(), theLabel.getJustification(),vp,theLabel.getString()); |
99 | 105 |
theLabel.setBoundBox(r); |
100 | 106 |
if (elExtent.intersects(r)) { |
107 |
FGraphicUtilities.DrawShape(g,at,new FPoint2D(vp.fromMapPoint(theLabel.getOrig())),symbolPoint); |
|
101 | 108 |
if (bitSet.get(numReg)) { |
102 | 109 |
FGraphicUtilities.DrawAnnotation(g, at, theSymbol, theLabel,metrics,true); |
103 | 110 |
}else{ |
... | ... | |
106 | 113 |
} |
107 | 114 |
} |
108 | 115 |
} catch (DriverIOException e) { |
109 |
// TODO Auto-generated catch block |
|
110 | 116 |
e.printStackTrace(); |
111 | 117 |
} |
112 | 118 |
} |
Also available in: Unified diff