Revision 6123
trunk/extensions/extCenterViewToPoint/src/com/iver/gvsig/centerviewtopoint/gui/InputCoordinatesPanel.java | ||
---|---|---|
49 | 49 |
import java.awt.geom.Point2D; |
50 | 50 |
import java.awt.geom.Rectangle2D; |
51 | 51 |
|
52 |
import javax.swing.JButton; |
|
52 | 53 |
import javax.swing.JDialog; |
54 |
import javax.swing.JLabel; |
|
53 | 55 |
import javax.swing.JOptionPane; |
54 | 56 |
import javax.swing.JPanel; |
55 |
import javax.swing.JLabel; |
|
56 | 57 |
import javax.swing.JTextField; |
57 |
import javax.swing.JButton; |
|
58 | 58 |
|
59 | 59 |
import org.cresques.cts.IProjection; |
60 | 60 |
|
... | ... | |
71 | 71 |
import com.iver.cit.gvsig.fmap.rendering.FGraphic; |
72 | 72 |
import com.iver.cit.gvsig.fmap.tools.BehaviorException; |
73 | 73 |
import com.iver.cit.gvsig.fmap.tools.Events.PointEvent; |
74 |
import com.iver.cit.gvsig.gui.Panels.ColorChooserPanel;
|
|
74 |
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
|
|
75 | 75 |
import com.iver.cit.gvsig.gui.toolListeners.InfoListener; |
76 | 76 |
import com.iver.gvsig.centerviewpoint.CenterViewToPointExtension; |
77 | 77 |
|
... | ... | |
79 | 79 |
* The InputCoordinatesPanel class creates a JPanel where the |
80 | 80 |
* user can input the coordinates of the point of reference |
81 | 81 |
* for center the View. |
82 |
*
|
|
82 |
* |
|
83 | 83 |
* @author jmorell |
84 | 84 |
*/ |
85 | 85 |
public class InputCoordinatesPanel extends JPanel implements View { |
... | ... | |
107 | 107 |
initializeCoordinates(); |
108 | 108 |
initialize(); |
109 | 109 |
} |
110 |
|
|
110 |
|
|
111 | 111 |
private void initializeCoordinates() { |
112 | 112 |
IProjection proj = mapControl.getProjection(); |
113 | 113 |
String projName = proj.getAbrev(); |
... | ... | |
142 | 142 |
}catch (NumberFormatException e) { |
143 | 143 |
throw new Exception(); |
144 | 144 |
} |
145 |
|
|
145 |
|
|
146 | 146 |
} |
147 | 147 |
|
148 | 148 |
/** |
149 | 149 |
* This method initializes this |
150 |
*
|
|
150 |
* |
|
151 | 151 |
* @return void |
152 | 152 |
*/ |
153 | 153 |
private void initialize() { |
... | ... | |
168 | 168 |
} |
169 | 169 |
|
170 | 170 |
/** |
171 |
* This method initializes textX
|
|
172 |
*
|
|
173 |
* @return javax.swing.JTextField
|
|
174 |
*/
|
|
171 |
* This method initializes textX |
|
172 |
* |
|
173 |
* @return javax.swing.JTextField |
|
174 |
*/ |
|
175 | 175 |
private JTextField getTextX() { |
176 | 176 |
if (textX == null) { |
177 | 177 |
textX = new JTextField(); |
178 | 178 |
textX.setBounds(40, 10, 132, 20); |
179 |
textX.addActionListener(new java.awt.event.ActionListener() {
|
|
180 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
|
179 |
textX.addActionListener(new java.awt.event.ActionListener() { |
|
180 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
181 | 181 |
textX.transferFocus(); |
182 | 182 |
} |
183 | 183 |
}); |
... | ... | |
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
/** |
189 |
* This method initializes textY
|
|
190 |
*
|
|
191 |
* @return javax.swing.JTextField
|
|
192 |
*/
|
|
189 |
* This method initializes textY |
|
190 |
* |
|
191 |
* @return javax.swing.JTextField |
|
192 |
*/ |
|
193 | 193 |
private JTextField getTextY() { |
194 | 194 |
if (textY == null) { |
195 | 195 |
textY = new JTextField(); |
196 | 196 |
textY.setBounds(40, 35, 132, 20); |
197 |
textY.addActionListener(new java.awt.event.ActionListener() {
|
|
198 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
|
197 |
textY.addActionListener(new java.awt.event.ActionListener() { |
|
198 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
199 | 199 |
textY.transferFocus(); |
200 | 200 |
} |
201 | 201 |
}); |
... | ... | |
204 | 204 |
} |
205 | 205 |
|
206 | 206 |
/** |
207 |
* This method initializes buttonSearch
|
|
208 |
*
|
|
209 |
* @return javax.swing.JButton
|
|
210 |
*/
|
|
207 |
* This method initializes buttonSearch |
|
208 |
* |
|
209 |
* @return javax.swing.JButton |
|
210 |
*/ |
|
211 | 211 |
private JButton getButtonSearch() { |
212 | 212 |
if (buttonSearch == null) { |
213 | 213 |
buttonSearch = new JButton(); |
214 | 214 |
buttonSearch.setBounds(88, 91, 84, 20); |
215 |
buttonSearch.addActionListener(new java.awt.event.ActionListener() {
|
|
216 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
|
215 |
buttonSearch.addActionListener(new java.awt.event.ActionListener() { |
|
216 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
217 | 217 |
try{ |
218 | 218 |
zoomToCoordinates(); |
219 | 219 |
}catch (Exception e1) { |
... | ... | |
225 | 225 |
((JDialog) (getParent().getParent().getParent().getParent())).dispose(); |
226 | 226 |
else |
227 | 227 |
PluginServices.getMDIManager().closeView(InputCoordinatesPanel.this); |
228 |
|
|
228 |
|
|
229 | 229 |
openInfo(); |
230 | 230 |
drawPoint(((ColorChooserPanel)getColorPanel()).getColor()); |
231 | 231 |
} |
... | ... | |
265 | 265 |
private void drawPoint(Color color){ |
266 | 266 |
CenterViewToPointExtension.COLOR=color; |
267 | 267 |
lyr.clearAllGraphics(); |
268 |
FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,color);
|
|
268 |
FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,color); |
|
269 | 269 |
int idSymbol = lyr.addSymbol(theSymbol); |
270 | 270 |
IGeometry geom = ShapeFactory.createPoint2D(center.getX(),center.getY()); |
271 | 271 |
FGraphic theGraphic = new FGraphic(geom, idSymbol); |
... | ... | |
273 | 273 |
mapControl.drawGraphics(); |
274 | 274 |
|
275 | 275 |
} |
276 |
|
|
277 | 276 |
|
277 |
|
|
278 | 278 |
/** |
279 |
* This method initializes jPanel
|
|
280 |
*
|
|
281 |
* @return javax.swing.JPanel
|
|
279 |
* This method initializes jPanel |
|
280 |
* |
|
281 |
* @return javax.swing.JPanel |
|
282 | 282 |
*/ |
283 | 283 |
private JPanel getColorPanel() { |
284 | 284 |
if (colorPanel==null){ |
Also available in: Unified diff