Revision 41977 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/tools/Behavior/CircleBehavior.java
CircleBehavior.java | ||
---|---|---|
38 | 38 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.CircleListener; |
39 | 39 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.PolylineListener; |
40 | 40 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener; |
41 |
import org.slf4j.Logger; |
|
42 |
import org.slf4j.LoggerFactory; |
|
41 | 43 |
|
42 | 44 |
|
43 | 45 |
|
... | ... | |
49 | 51 |
* @author Pablo Piqueras Bartolom? |
50 | 52 |
*/ |
51 | 53 |
public class CircleBehavior extends Behavior { |
54 |
private static final Logger logger = LoggerFactory.getLogger(CircleBehavior.class); |
|
55 |
|
|
52 | 56 |
/** |
53 | 57 |
* First point set, that represents the center of the circle. |
54 | 58 |
*/ |
... | ... | |
86 | 90 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
87 | 91 |
*/ |
88 | 92 |
public void paintComponent(MapControlDrawer mapControlDrawer) { |
89 |
|
|
90 | 93 |
double radio; |
91 | 94 |
BufferedImage img = getMapControl().getImage(); |
92 | 95 |
mapControlDrawer.drawImage(img, 0, 0); |
... | ... | |
116 | 119 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mousePressed(java.awt.event.MouseEvent) |
117 | 120 |
*/ |
118 | 121 |
public void mousePressed(MouseEvent e) { |
119 |
if (e.getButton() == MouseEvent.BUTTON1) { |
|
120 |
m_FirstPoint = e.getPoint(); |
|
121 |
isClicked = true; |
|
122 |
getMapControl().repaint(); |
|
123 |
} |
|
122 |
if (this.isMyButton(e)) { |
|
123 |
m_FirstPoint = e.getPoint(); |
|
124 |
isClicked = true; |
|
125 |
getMapControl().repaint(); |
|
126 |
if (listener.cancelDrawing()) { |
|
127 |
getMapControl().cancelDrawing(); |
|
128 |
isClicked = false; |
|
129 |
getMapControl().repaint(); |
|
130 |
} |
|
131 |
} |
|
124 | 132 |
|
125 |
if (listener.cancelDrawing()) { |
|
126 |
getMapControl().cancelDrawing(); |
|
127 |
isClicked = false; |
|
128 |
getMapControl().repaint(); |
|
129 |
} |
|
133 |
|
|
130 | 134 |
} |
131 | 135 |
|
132 | 136 |
/* |
... | ... | |
134 | 138 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseReleased(java.awt.event.MouseEvent) |
135 | 139 |
*/ |
136 | 140 |
public void mouseReleased(MouseEvent e) throws BehaviorException { |
141 |
if( this.isMyButton(e) ) { |
|
137 | 142 |
m_FirstPoint = null; |
138 | 143 |
m_LastPoint = null; |
139 | 144 |
isClicked = false; |
145 |
} |
|
140 | 146 |
} |
141 | 147 |
|
142 | 148 |
/* |
Also available in: Unified diff