Revision 41974 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/tools/Behavior/MoveBehavior.java
MoveBehavior.java | ||
---|---|---|
64 | 64 |
* @see #setListener(ToolListener) |
65 | 65 |
*/ |
66 | 66 |
private PanListener listener; |
67 |
private boolean isMyButton; |
|
68 | 67 |
|
69 | 68 |
/** |
70 | 69 |
* <p> |
... | ... | |
87 | 86 |
|
88 | 87 |
@Override |
89 | 88 |
public void paintComponent(MapControlDrawer renderer) { |
89 |
if( ! this.isMyButton() ) { |
|
90 |
return; |
|
91 |
} |
|
90 | 92 |
super.paintComponent(renderer); |
91 | 93 |
BufferedImage image = getMapControl().getImage(); |
92 | 94 |
if (image != null) { |
... | ... | |
102 | 104 |
|
103 | 105 |
@Override |
104 | 106 |
public void mousePressed(MouseEvent e) { |
105 |
if (isMyButton(e)) { |
|
106 |
isMyButton = true; |
|
107 |
if (this.isMyButton(e)) { |
|
107 | 108 |
m_FirstPoint = e.getPoint(); |
108 | 109 |
if (listener.cancelDrawing()) { |
109 | 110 |
getMapControl().cancelDrawing(); |
... | ... | |
115 | 116 |
|
116 | 117 |
@Override |
117 | 118 |
public void mouseReleased(MouseEvent e) throws BehaviorException { |
118 |
if (isMyButton(e) && m_FirstPoint != null) { |
|
119 |
if (this.isMyButton(e) && m_FirstPoint != null) {
|
|
119 | 120 |
doMouseReleased(e); |
120 | 121 |
} |
121 | 122 |
} |
... | ... | |
127 | 128 |
getMapControl().drawMap(true); |
128 | 129 |
|
129 | 130 |
m_FirstPoint = null; |
130 |
isMyButton = false; |
|
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
|
134 | 134 |
|
135 | 135 |
@Override |
136 | 136 |
public void mouseDragged(MouseEvent e) { |
137 |
if (isMyButton) {
|
|
137 |
if (this.isMyButton(e)) {
|
|
138 | 138 |
m_LastPoint = e.getPoint(); |
139 | 139 |
getMapControl().repaint(); |
140 | 140 |
} |
Also available in: Unified diff