Revision 20100 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/Behavior/MoveBehavior.java
MoveBehavior.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
|
55 | 55 |
/** |
56 |
* Behaviour que espera un listener de tipo MoveListener. |
|
56 |
* <p>Behavior that permits user to move the image of the associated |
|
57 |
* <code>MapControl</code> using a {@link PanListener PanListener}.</p> |
|
57 | 58 |
* |
58 | 59 |
* @author Vicente Caballero Navarro |
59 | 60 |
*/ |
60 | 61 |
public class MoveBehavior extends Behavior { |
62 |
/** |
|
63 |
* First point of the path in image coordinates. |
|
64 |
*/ |
|
61 | 65 |
private Point2D m_FirstPoint; |
66 |
|
|
67 |
/** |
|
68 |
* Last point of the path in image coordinates. |
|
69 |
*/ |
|
62 | 70 |
private Point2D m_LastPoint; |
71 |
|
|
72 |
/** |
|
73 |
* Auxiliary point that represents a corner selected in image coordinates. |
|
74 |
*/ |
|
63 | 75 |
private Point2D m_PointAnt; |
76 |
|
|
77 |
/** |
|
78 |
* Tool listener used to work with the <code>MapControl</code> object. |
|
79 |
* |
|
80 |
* @see #getListener() |
|
81 |
* @see #setListener(ToolListener) |
|
82 |
*/ |
|
64 | 83 |
private PanListener listener; |
65 | 84 |
|
66 | 85 |
/** |
67 |
* Crea un nuevo MoveBehavior.
|
|
68 |
* |
|
69 |
* @param pli listener.
|
|
86 |
* <p>Creates a new behavior for moving the mouse.</p>
|
|
87 |
*
|
|
88 |
* @param pli listener used to permit this object to work with the associated <code>MapControl</code>
|
|
70 | 89 |
*/ |
71 | 90 |
public MoveBehavior(PanListener pli) { |
72 | 91 |
listener = pli; |
73 | 92 |
} |
74 | 93 |
|
75 |
/** |
|
94 |
/* |
|
95 |
* (non-Javadoc) |
|
76 | 96 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
77 | 97 |
*/ |
78 | 98 |
public void paintComponent(Graphics g) { |
... | ... | |
101 | 121 |
} |
102 | 122 |
} |
103 | 123 |
|
104 |
/** |
|
105 |
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) |
|
124 |
/* |
|
125 |
* (non-Javadoc) |
|
126 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mousePressed(java.awt.event.MouseEvent) |
|
106 | 127 |
*/ |
107 | 128 |
public void mousePressed(MouseEvent e) { |
108 | 129 |
Point pScreen = e.getPoint(); |
... | ... | |
120 | 141 |
} |
121 | 142 |
} |
122 | 143 |
|
123 |
/** |
|
124 |
* Reimplementaci?n del m?todo mouseReleased de Behavior. |
|
125 |
* |
|
126 |
* @param e MouseEvent |
|
127 |
* |
|
128 |
* @throws BehaviorException Excepci?n lanzada cuando el Behavior. |
|
144 |
/* |
|
145 |
* (non-Javadoc) |
|
146 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseReleased(java.awt.event.MouseEvent) |
|
129 | 147 |
*/ |
130 | 148 |
public void mouseReleased(MouseEvent e) throws BehaviorException { |
131 | 149 |
Point2D p1; |
... | ... | |
142 | 160 |
m_FirstPoint = null; |
143 | 161 |
} |
144 | 162 |
|
145 |
/** |
|
146 |
* Reimplementaci?n del m?todo mouseDragged de Behavior. |
|
147 |
* |
|
148 |
* @param e MouseEvent |
|
163 |
/* |
|
164 |
* (non-Javadoc) |
|
165 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseDragged(java.awt.event.MouseEvent) |
|
149 | 166 |
*/ |
150 | 167 |
public void mouseDragged(MouseEvent e) { |
151 | 168 |
m_LastPoint = e.getPoint(); |
... | ... | |
153 | 170 |
} |
154 | 171 |
|
155 | 172 |
/** |
156 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setListener(com.iver.cit.gvsig.fmap.tools.ToolListener) |
|
173 |
* <p>Sets a tool listener to work with the <code>MapControl</code> using this behavior.</p> |
|
174 |
* |
|
175 |
* @param listener a <code>PanListener</code> object for this behavior |
|
157 | 176 |
*/ |
158 | 177 |
public void setListener(ToolListener listener) { |
159 | 178 |
this.listener = (PanListener) listener; |
160 | 179 |
} |
161 | 180 |
|
162 |
/** |
|
181 |
/* |
|
182 |
* (non-Javadoc) |
|
163 | 183 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener() |
164 | 184 |
*/ |
165 | 185 |
public ToolListener getListener() { |
Also available in: Unified diff