Revision 30327 branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/tools/Behavior/PolylineBehavior.java
PolylineBehavior.java | ||
---|---|---|
48 | 48 |
import java.util.ArrayList; |
49 | 49 |
|
50 | 50 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
51 |
import org.gvsig.fmap.mapcontrol.MapControlDrawer; |
|
51 | 52 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
52 | 53 |
import org.gvsig.fmap.mapcontrol.tools.Events.MeasureEvent; |
53 | 54 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.PolylineListener; |
... | ... | |
99 | 100 |
* (non-Javadoc) |
100 | 101 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
101 | 102 |
*/ |
102 |
public void paintComponent(Graphics g) {
|
|
103 |
g.drawImage(getMapControl().getImage(), 0, 0, null);
|
|
104 |
g.setColor(Color.black);
|
|
103 |
public void paintComponent(MapControlDrawer mapControlDrawer) {
|
|
104 |
mapControlDrawer.drawImage(getMapControl().getImage(), 0, 0);
|
|
105 |
mapControlDrawer.setColor(Color.black);
|
|
105 | 106 |
|
106 | 107 |
if (!arrayX.isEmpty()) { |
107 |
drawPolyLine((Graphics2D) g);
|
|
108 |
drawPolyLine(mapControlDrawer);
|
|
108 | 109 |
} |
109 | 110 |
} |
110 | 111 |
|
... | ... | |
176 | 177 |
* |
177 | 178 |
* @param g2 the 2D context that allows draw the polyline |
178 | 179 |
*/ |
179 |
protected void drawPolyLine(Graphics2D g2) {
|
|
180 |
protected void drawPolyLine(MapControlDrawer mapControlDrawer) {
|
|
180 | 181 |
GeneralPathX polyline = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, arrayX.size()); |
181 | 182 |
|
182 | 183 |
Point2D pScreen0=getMapControl().getViewPort().fromMapPoint(new Point2D.Double(((Double) arrayX.get(0)).doubleValue(), |
... | ... | |
191 | 192 |
polyline.lineTo(pScreen.getX(),pScreen.getY()); |
192 | 193 |
} |
193 | 194 |
|
194 |
g2.draw(polyline);
|
|
195 |
mapControlDrawer.draw(createLineString(polyline));
|
|
195 | 196 |
} |
196 | 197 |
|
197 | 198 |
/** |
Also available in: Unified diff