Revision 30327 branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/tools/Behavior/RectangleBehavior.java
RectangleBehavior.java | ||
---|---|---|
56 | 56 |
import org.gvsig.fmap.geom.primitive.Envelope; |
57 | 57 |
import org.gvsig.fmap.geom.util.UtilFunctions; |
58 | 58 |
import org.gvsig.fmap.mapcontext.ViewPort; |
59 |
import org.gvsig.fmap.mapcontrol.MapControlDrawer; |
|
59 | 60 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
60 | 61 |
import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent; |
61 | 62 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener; |
... | ... | |
108 | 109 |
* (non-Javadoc) |
109 | 110 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
110 | 111 |
*/ |
111 |
public void paintComponent(Graphics g) {
|
|
112 |
public void paintComponent(MapControlDrawer mapControlDrawer) {
|
|
112 | 113 |
BufferedImage img = getMapControl().getImage(); |
113 |
g.drawImage(img, 0, 0, null);
|
|
114 |
g.setColor(Color.black);
|
|
115 |
g.setXORMode(Color.white);
|
|
114 |
mapControlDrawer.drawImage(img, 0, 0);
|
|
115 |
mapControlDrawer.setColor(Color.black);
|
|
116 |
//mapControlDrawer.setXORMode(Color.white);
|
|
116 | 117 |
|
117 | 118 |
// Borramos el anterior |
118 | 119 |
Rectangle r = new Rectangle(); |
... | ... | |
120 | 121 |
// Dibujamos el actual |
121 | 122 |
if ((m_FirstPoint != null) && (m_LastPoint != null)) { |
122 | 123 |
r.setFrameFromDiagonal(m_FirstPoint, m_LastPoint); |
123 |
g.drawRect(r.x, r.y, r.width, r.height);
|
|
124 |
mapControlDrawer.drawRect(r.x, r.y, r.width, r.height);
|
|
124 | 125 |
} |
125 |
g.setPaintMode();
|
|
126 |
mapControlDrawer.setPaintMode();
|
|
126 | 127 |
} |
127 | 128 |
|
128 | 129 |
/* |
Also available in: Unified diff