svn-gvsig-desktop / trunk / extensions / extWFS2 / src / com / iver / cit / gvsig / gui / panels / WFSAreaPanel.java @ 10072
History | View | Annotate | Download (44.1 KB)
1 | 8018 | jorpiell | package com.iver.cit.gvsig.gui.panels; |
---|---|---|---|
2 | |||
3 | 9899 | ppiqueras | import java.awt.Color; |
4 | import java.awt.Dimension; |
||
5 | import java.awt.GridBagLayout; |
||
6 | import java.awt.Rectangle; |
||
7 | import java.awt.event.ActionEvent; |
||
8 | import java.awt.event.ActionListener; |
||
9 | 9915 | ppiqueras | import java.awt.event.FocusAdapter; |
10 | import java.awt.event.FocusEvent; |
||
11 | import java.awt.event.FocusListener; |
||
12 | 9607 | jorpiell | import java.awt.geom.Rectangle2D; |
13 | 9899 | ppiqueras | import java.io.Serializable; |
14 | 8018 | jorpiell | |
15 | 9899 | ppiqueras | import javax.swing.ImageIcon; |
16 | import javax.swing.JComboBox; |
||
17 | import javax.swing.JLabel; |
||
18 | 9943 | ppiqueras | import javax.swing.JOptionPane; |
19 | 8018 | jorpiell | import javax.swing.JPanel; |
20 | 9899 | ppiqueras | import javax.swing.JRadioButton; |
21 | import javax.swing.JTextField; |
||
22 | import javax.swing.SwingConstants; |
||
23 | 8018 | jorpiell | |
24 | import com.iver.andami.PluginServices; |
||
25 | 9899 | ppiqueras | import com.iver.cit.gvsig.fmap.MapControl; |
26 | 8018 | jorpiell | import com.iver.cit.gvsig.gui.wizards.WFSWizardData; |
27 | 9607 | jorpiell | import com.iver.cit.gvsig.project.documents.view.gui.View; |
28 | 9943 | ppiqueras | import com.iver.utiles.stringNumberUtilities.StringNumberUtilities; |
29 | |||
30 | 9842 | ppiqueras | import javax.swing.JButton; |
31 | 8018 | jorpiell | |
32 | 10071 | ppiqueras | import org.gvsig.gui.beans.comboBoxItemsSeeker.JComboBoxItemsSeekerConfigurable; |
33 | 9943 | ppiqueras | import org.gvsig.gui.beans.swing.jTextFieldWithSpecificCaretPosition.JTextFieldWithSpecificCaretPosition; |
34 | 9915 | ppiqueras | |
35 | |||
36 | 9943 | ppiqueras | |
37 | 8018 | jorpiell | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
38 | *
|
||
39 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
40 | *
|
||
41 | * This program is free software; you can redistribute it and/or
|
||
42 | * modify it under the terms of the GNU General Public License
|
||
43 | * as published by the Free Software Foundation; either version 2
|
||
44 | * of the License, or (at your option) any later version.
|
||
45 | *
|
||
46 | * This program is distributed in the hope that it will be useful,
|
||
47 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
48 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
49 | * GNU General Public License for more details.
|
||
50 | *
|
||
51 | * You should have received a copy of the GNU General Public License
|
||
52 | * along with this program; if not, write to the Free Software
|
||
53 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
54 | *
|
||
55 | * For more information, contact:
|
||
56 | *
|
||
57 | * Generalitat Valenciana
|
||
58 | * Conselleria d'Infraestructures i Transport
|
||
59 | * Av. Blasco Ib??ez, 50
|
||
60 | * 46010 VALENCIA
|
||
61 | * SPAIN
|
||
62 | *
|
||
63 | * +34 963862235
|
||
64 | * gvsig@gva.es
|
||
65 | * www.gvsig.gva.es
|
||
66 | *
|
||
67 | * or
|
||
68 | *
|
||
69 | * IVER T.I. S.A
|
||
70 | * Salamanca 50
|
||
71 | * 46005 Valencia
|
||
72 | * Spain
|
||
73 | *
|
||
74 | * +34 963163400
|
||
75 | * dac@iver.es
|
||
76 | */
|
||
77 | /* CVS MESSAGES:
|
||
78 | *
|
||
79 | * $Id$
|
||
80 | * $Log$
|
||
81 | 10071 | ppiqueras | * Revision 1.9 2007-02-02 12:22:03 ppiqueras
|
82 | * Mejorada la interfaz.
|
||
83 | *
|
||
84 | * Revision 1.8 2007/01/26 14:23:56 ppiqueras
|
||
85 | 9943 | ppiqueras | * Mejorada la interfaz
|
86 | *
|
||
87 | * Revision 1.7 2007/01/25 14:37:16 ppiqueras
|
||
88 | 9915 | ppiqueras | * Utiliza JTextFieldWithSpecificCaretPosition
|
89 | *
|
||
90 | * Revision 1.6 2007/01/25 09:31:09 ppiqueras
|
||
91 | 9899 | ppiqueras | * Mejorada la interfaz.
|
92 | *
|
||
93 | * Revision 1.5 2007/01/19 14:24:30 ppiqueras
|
||
94 | 9842 | ppiqueras | * + Avanzada.
|
95 | *
|
||
96 | * Revision 1.4 2007/01/12 13:09:41 jorpiell
|
||
97 | 9709 | jorpiell | * added searches by area
|
98 | *
|
||
99 | * Revision 1.3 2007/01/10 09:01:25 jorpiell
|
||
100 | 9607 | jorpiell | * The coordinates panel is opened with the view coordinates
|
101 | *
|
||
102 | * Revision 1.2 2006/12/22 11:45:53 jorpiell
|
||
103 | 9453 | jorpiell | * Actualizado el driver del WFS
|
104 | *
|
||
105 | * Revision 1.1 2006/10/10 12:55:06 jorpiell
|
||
106 | 8018 | jorpiell | * Se ha a?adido el soporte de features complejas
|
107 | *
|
||
108 | *
|
||
109 | */
|
||
110 | /**
|
||
111 | 9842 | ppiqueras | * This panel allows user to select the area he/she wants to get in the view.
|
112 | * There are two options to do this:
|
||
113 | * - Indicating the coordinates of the top-left and down-right corners
|
||
114 | 9899 | ppiqueras | * - Selecting the area with the mouse
|
115 | 9842 | ppiqueras | *
|
116 | 9899 | ppiqueras | * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
117 | 8018 | jorpiell | * @author Jorge Piera Llodr? (piera_jor@gva.es)
|
118 | */
|
||
119 | 9899 | ppiqueras | public class WFSAreaPanel extends JPanel { |
120 | private final Rectangle DEFAULT_BOUNDS = new Rectangle(10, 5, 490, 380); |
||
121 | private final Rectangle DEFAULT_AREA_COORDINATES_PANEL_RECTANGLE = new Rectangle(8, 20, 481, 60); |
||
122 | private final Rectangle DEFAULT_AREA_MAPCONTROL_PANEL_RECTANGLE = new Rectangle(8, 115, 481, 265); |
||
123 | |||
124 | 9943 | ppiqueras | // private final Rectangle DEFAULT_COORDINATES_CHECKBOX_RECTANGLE = new Rectangle(6, 19, 445, 20);
|
125 | private final Rectangle DEFAULT_ERASER_ICON_BUTTON_RECTANGLE = new Rectangle (270, 85, 25 , 25); |
||
126 | 9899 | ppiqueras | private final Rectangle DEFAULT_PAN_ICON_BUTTON_RECTANGLE = new Rectangle(270, 85, 25, 25); |
127 | 9943 | ppiqueras | private final Rectangle DEFAULT_ZOOMINANDOUT_JCOMBOBOX_RECTANGLE = new Rectangle(297, 85, 32 , 25); |
128 | private final Rectangle DEFAULT_TOOL_JCOMBOBOX_RECTANGLE = new Rectangle(10, 87, 250, 21); |
||
129 | 9899 | ppiqueras | // private final Rectangle DEFAULT_ZOOMIN_ICON_BUTTON_RECTANGLE = new Rectangle(297,100,25,25);
|
130 | // private final Rectangle DEFAULT_ZOOMOUT_ICON_BUTTON_RECTANGLE = new Rectangle(324,100,25,25);
|
||
131 | private final Rectangle DEFAULT_ZOOMRECTANGLESELECTION_ICON_BUTTON_RECTANGLE = new Rectangle(331, 85, 25, 25); |
||
132 | private final Rectangle DEFAULT_ZOOMPREVIOUS_ICON_BUTTON_RECTANGLE = new Rectangle(358, 85, 25, 25); |
||
133 | private final Rectangle DEFAULT_ZOOMCOMPLETE_ICON_BUTTON_RECTANGLE = new Rectangle(385, 85, 25, 25); |
||
134 | private final Rectangle DEFAULT_ZOOMINANDOUTVIEWCENTERED_COMBOBOX_RECTANGLE = new Rectangle(412, 85, 32, 25); |
||
135 | // private final Rectangle DEFAULT_ZOOMINVIEWCENTERED_ICON_BUTTON_RECTANGLE = new Rectangle(378,100,25,25);
|
||
136 | // private final Rectangle DEFAULT_ZOOMOUTVIEWCENTERED_ICON_BUTTON_RECTANGLE = new Rectangle(405,100,25,25);
|
||
137 | 9943 | ppiqueras | private final Rectangle DEFAULT_INFO_ICON_BUTTON_RECTANGLE_V1 = new Rectangle(297, 85, 25, 25); |
138 | private final Rectangle DEFAULT_INFO_ICON_BUTTON_RECTANGLE_V2 = new Rectangle(446, 85, 25, 25); |
||
139 | 9899 | ppiqueras | // private final Rectangle DEFAULT_TOOLS_ICON_BUTTON_RECTANGLE = new Rectangle(459,100,25,25);
|
140 | |||
141 | private final int DISABLED_OPERATION = 0; |
||
142 | 9943 | ppiqueras | private final int SELECTION_BY_COORDINATES_OPERATION = 1; |
143 | 9899 | ppiqueras | private final int SELECTION_BY_AREA_OPERATION = 2; |
144 | |||
145 | 8018 | jorpiell | private WFSWizardData data = null; |
146 | private WFSParamsPanel parent = null; |
||
147 | 9899 | ppiqueras | private AreaCoordinatesPanel coordinatesPanel = null; |
148 | 9842 | ppiqueras | private AreaMapControlPanel areaMapControlPanel = null; |
149 | 9899 | ppiqueras | private JComboBox jComboBoxToolSelection = null; |
150 | 9943 | ppiqueras | private JButton jButtonEraser = null; |
151 | 9899 | ppiqueras | private JButton jButtonPan = null; |
152 | // private JButton jButtonZoomIn = null;
|
||
153 | // private JButton jButtonZoomOut = null;
|
||
154 | private JButton jButtonZoomRectangleSelection = null; |
||
155 | private JButton jButtonZoomPrevious = null; |
||
156 | private JButton jButtonZoomComplete = null; |
||
157 | // private JButton jButtonZoomInViewCentered = null;
|
||
158 | // private JButton jButtonZoomOutViewCentered = null;
|
||
159 | private JButton jButtonInfo = null; |
||
160 | // private JButton jButtonTools = null;
|
||
161 | private JComboBox jComboBoxZoomInAndOut = null; |
||
162 | private JComboBox jComboBoxZoomInAndOutViewCentered = null; |
||
163 | 8018 | jorpiell | |
164 | /**
|
||
165 | * This method initializes
|
||
166 | */
|
||
167 | public WFSAreaPanel(WFSParamsPanel parent) {
|
||
168 | super();
|
||
169 | this.parent = parent;
|
||
170 | initialize(); |
||
171 | } |
||
172 | |||
173 | /**
|
||
174 | * This method initializes this
|
||
175 | */
|
||
176 | private void initialize() { |
||
177 | this.setLayout(null); |
||
178 | 9899 | ppiqueras | this.setBounds(DEFAULT_BOUNDS);
|
179 | 8018 | jorpiell | this.setBorder(javax.swing.BorderFactory.createTitledBorder(
|
180 | 9899 | ppiqueras | null, PluginServices.getText(this, "select_by_area"), |
181 | 8018 | jorpiell | javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
182 | javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
||
183 | 9899 | ppiqueras | |
184 | // Adds JPanel with the coordinates
|
||
185 | 9453 | jorpiell | this.add(getCoordinatesPanel(), null); |
186 | 9842 | ppiqueras | |
187 | 9899 | ppiqueras | // Adds JComboBox to select a part of the graphical interface
|
188 | this.add(getJComboBoxToolSelection(), null); |
||
189 | this.getJComboBoxToolSelection().setSelectedIndex(0); // By default select first element |
||
190 | |||
191 | // Adds Icons
|
||
192 | 9943 | ppiqueras | // this.add(getJButtonPan(), null);
|
193 | //// this.add(getJButtonZoomIn(), null);
|
||
194 | //// this.add(getJButtonZoomOut(), null);
|
||
195 | // this.add(getJComboBoxZoomInAndOut(), null);
|
||
196 | // this.add(getJButtonZoomRectangleSelection(), null);
|
||
197 | // this.add(getJButtonZoomPrevious(), null);
|
||
198 | // this.add(getJButtonZoomComplete(), null);
|
||
199 | // this.add(getJComboBoxZoomInAndOutViewCentered(), null);
|
||
200 | // this.add(getJButtonInfo(), null);
|
||
201 | 9842 | ppiqueras | |
202 | 9899 | ppiqueras | // Adds Jpanel with the view
|
203 | 9842 | ppiqueras | this.add(getAreaMapControlPanel(), null); |
204 | 9899 | ppiqueras | // this.add(get, null);
|
205 | |||
206 | 9607 | jorpiell | initCoordinates(); |
207 | 8018 | jorpiell | } |
208 | 9899 | ppiqueras | |
209 | 9607 | jorpiell | /**
|
210 | * Write the view coordinates into the coordinates panel
|
||
211 | */
|
||
212 | private void initCoordinates(){ |
||
213 | View activeView =
|
||
214 | (View) PluginServices.getMDIManager().getActiveWindow();
|
||
215 | Rectangle2D r2d= activeView.getMapControl().getViewPort().getAdjustedExtent();
|
||
216 | if (r2d != null){ |
||
217 | getCoordinatesPanel().setExtent(r2d); |
||
218 | } |
||
219 | } |
||
220 | 8018 | jorpiell | |
221 | /**
|
||
222 | 9899 | ppiqueras | * This method initializes coordinatesPanel
|
223 | 8018 | jorpiell | *
|
224 | 9899 | ppiqueras | * @return javax.swing.JPanel
|
225 | 8018 | jorpiell | */
|
226 | 9899 | ppiqueras | private AreaCoordinatesPanel getCoordinatesPanel() {
|
227 | if (coordinatesPanel == null) { |
||
228 | coordinatesPanel = new AreaCoordinatesPanel();
|
||
229 | 8018 | jorpiell | } |
230 | 9899 | ppiqueras | return coordinatesPanel;
|
231 | 8018 | jorpiell | } |
232 | |||
233 | /**
|
||
234 | 9899 | ppiqueras | * This method initializes jComboBoxToolSelection
|
235 | *
|
||
236 | * @return javax.swing.JComboBox
|
||
237 | 8018 | jorpiell | */
|
238 | 9899 | ppiqueras | private JComboBox getJComboBoxToolSelection() { |
239 | if (jComboBoxToolSelection == null) { |
||
240 | jComboBoxToolSelection = new JComboBox(); |
||
241 | 9943 | ppiqueras | jComboBoxToolSelection.setBounds(DEFAULT_TOOL_JCOMBOBOX_RECTANGLE); |
242 | 9899 | ppiqueras | jComboBoxToolSelection.setEditable(false);
|
243 | jComboBoxToolSelection.addItem(new ItemOperation(PluginServices.getText(this, "disabled"), this.DISABLED_OPERATION)); |
||
244 | 9943 | ppiqueras | jComboBoxToolSelection.addItem(new ItemOperation(PluginServices.getText(this, "define_absolute_coordinates"), this.SELECTION_BY_COORDINATES_OPERATION)); |
245 | jComboBoxToolSelection.addItem(new ItemOperation(PluginServices.getText(this, "define_coordinates_using_view"), this.SELECTION_BY_AREA_OPERATION)); |
||
246 | 9899 | ppiqueras | |
247 | jComboBoxToolSelection.addActionListener(new ActionListener() { |
||
248 | /*
|
||
249 | * (non-Javadoc)
|
||
250 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||
251 | */
|
||
252 | public void actionPerformed(ActionEvent e) { |
||
253 | JComboBox cb = (JComboBox)e.getSource(); |
||
254 | switch(((ItemOperation)cb.getSelectedItem()).getOperation()) {
|
||
255 | case DISABLED_OPERATION:
|
||
256 | disableCoorderatesRegionOperation(); |
||
257 | disableAreaRegionOperation(); |
||
258 | 9943 | ppiqueras | // getJButtonInfo().setEnabled(false);
|
259 | 9899 | ppiqueras | break;
|
260 | 9943 | ppiqueras | case SELECTION_BY_COORDINATES_OPERATION:
|
261 | 9899 | ppiqueras | disableAreaRegionOperation(); |
262 | enableCoorderatesRegionOperation(); |
||
263 | 9943 | ppiqueras | // getJButtonInfo().setEnabled(true);
|
264 | 9899 | ppiqueras | break;
|
265 | case SELECTION_BY_AREA_OPERATION:
|
||
266 | disableCoorderatesRegionOperation(); |
||
267 | enableAreaRegionOperation(); |
||
268 | 9943 | ppiqueras | // getJButtonInfo().setEnabled(true);
|
269 | 9899 | ppiqueras | break;
|
270 | } |
||
271 | } |
||
272 | }); |
||
273 | 8018 | jorpiell | } |
274 | 9899 | ppiqueras | return jComboBoxToolSelection;
|
275 | 8018 | jorpiell | } |
276 | |||
277 | 9842 | ppiqueras | /**
|
278 | 9899 | ppiqueras | * Enables the components associated to the selection of area by coordinates
|
279 | 9842 | ppiqueras | */
|
280 | 9899 | ppiqueras | private void enableCoorderatesRegionOperation() { |
281 | 9943 | ppiqueras | // Adds associated icons
|
282 | this.add(getJButtonEraser(), null); |
||
283 | this.add(getJButtonInfo(), null); |
||
284 | |||
285 | 9899 | ppiqueras | getCoordinatesPanel().setAllTextFieldsEnabled(true);
|
286 | 9842 | ppiqueras | } |
287 | 9899 | ppiqueras | |
288 | 9842 | ppiqueras | /**
|
289 | 9899 | ppiqueras | * Enables the components associated to the selection of area by view
|
290 | */
|
||
291 | private void enableAreaRegionOperation() { |
||
292 | 9943 | ppiqueras | // Adds associated icons
|
293 | this.add(getJButtonPan(), null); |
||
294 | // this.add(getJButtonZoomIn(), null);
|
||
295 | // this.add(getJButtonZoomOut(), null);
|
||
296 | this.add(getJComboBoxZoomInAndOut(), null); |
||
297 | this.add(getJButtonZoomRectangleSelection(), null); |
||
298 | this.add(getJButtonZoomPrevious(), null); |
||
299 | this.add(getJButtonZoomComplete(), null); |
||
300 | this.add(getJComboBoxZoomInAndOutViewCentered(), null); |
||
301 | this.add(getJButtonInfo(), null); |
||
302 | |||
303 | 9899 | ppiqueras | // Enables the icons
|
304 | 9943 | ppiqueras | // getJButtonPan().setEnabled(true);
|
305 | // getJComboBoxZoomInAndOut().setEnabled(true);
|
||
306 | // getJButtonZoomRectangleSelection().setEnabled(true);
|
||
307 | // getJButtonZoomPrevious().setEnabled(true);
|
||
308 | // getJButtonZoomComplete().setEnabled(true);
|
||
309 | // getJComboBoxZoomInAndOutViewCentered().setEnabled(true);
|
||
310 | 9899 | ppiqueras | |
311 | // Enables the MapControl area
|
||
312 | getAreaMapControlPanel().setEnabled(true);
|
||
313 | } |
||
314 | |||
315 | /**
|
||
316 | * Disables the components associated to the selection of area by coordinates
|
||
317 | */
|
||
318 | private void disableCoorderatesRegionOperation() { |
||
319 | 9943 | ppiqueras | // Removes associated icons
|
320 | this.remove(getJButtonEraser());
|
||
321 | |||
322 | if (jButtonInfo != null) |
||
323 | this.remove(jButtonInfo);
|
||
324 | |||
325 | 9899 | ppiqueras | getCoordinatesPanel().setAllTextFieldsEnabled(false);
|
326 | } |
||
327 | |||
328 | /**
|
||
329 | * Disables the components associated to the selection of area by view
|
||
330 | */
|
||
331 | private void disableAreaRegionOperation() { |
||
332 | 9943 | ppiqueras | // Removes associated icons
|
333 | this.remove(getJButtonPan());
|
||
334 | // this.add(getJButtonZoomIn(), null);
|
||
335 | // this.add(getJButtonZoomOut(), null);
|
||
336 | this.remove(getJComboBoxZoomInAndOut());
|
||
337 | this.remove(getJButtonZoomRectangleSelection());
|
||
338 | this.remove(getJButtonZoomPrevious());
|
||
339 | this.remove(getJButtonZoomComplete());
|
||
340 | this.remove(getJComboBoxZoomInAndOutViewCentered());
|
||
341 | |||
342 | if (jButtonInfo != null) |
||
343 | this.remove(jButtonInfo);
|
||
344 | |||
345 | |||
346 | 9899 | ppiqueras | // Disables the icons
|
347 | 9943 | ppiqueras | // getJButtonPan().setEnabled(false);
|
348 | // getJComboBoxZoomInAndOut().setEnabled(false);
|
||
349 | // getJButtonZoomRectangleSelection().setEnabled(false);
|
||
350 | // getJButtonZoomPrevious().setEnabled(false);
|
||
351 | // getJButtonZoomComplete().setEnabled(false);
|
||
352 | // getJComboBoxZoomInAndOutViewCentered().setEnabled(false);
|
||
353 | 9899 | ppiqueras | |
354 | // Disables the MapControl area
|
||
355 | getAreaMapControlPanel().setEnabled(false);
|
||
356 | } |
||
357 | |||
358 | /**
|
||
359 | 9842 | ppiqueras | * This method initializes areaMapControlPanel
|
360 | *
|
||
361 | * @return A reference to an object of AreaMapControlPanel
|
||
362 | */
|
||
363 | private AreaMapControlPanel getAreaMapControlPanel() {
|
||
364 | if (areaMapControlPanel == null) { |
||
365 | 9899 | ppiqueras | areaMapControlPanel = new AreaMapControlPanel();
|
366 | 9842 | ppiqueras | } |
367 | |||
368 | return areaMapControlPanel;
|
||
369 | } |
||
370 | 9899 | ppiqueras | |
371 | /**
|
||
372 | 9943 | ppiqueras | * This method initializes jButtonEraser
|
373 | *
|
||
374 | * @return javax.swing.JButton
|
||
375 | */
|
||
376 | private JButton getJButtonEraser() { |
||
377 | if (jButtonEraser == null) { |
||
378 | jButtonEraser = new JButton(); |
||
379 | jButtonEraser.setBounds(DEFAULT_ERASER_ICON_BUTTON_RECTANGLE); |
||
380 | jButtonEraser.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/eraser.png"))); |
||
381 | jButtonEraser.setToolTipText(PluginServices.getText(this, "erases_coordinates")); |
||
382 | } |
||
383 | return jButtonEraser;
|
||
384 | } |
||
385 | |||
386 | /**
|
||
387 | 9899 | ppiqueras | * This method initializes jButtonPan
|
388 | *
|
||
389 | * @return javax.swing.JButton
|
||
390 | */
|
||
391 | private JButton getJButtonPan() { |
||
392 | if (jButtonPan == null) { |
||
393 | jButtonPan = new JButton(); |
||
394 | jButtonPan.setBounds(DEFAULT_PAN_ICON_BUTTON_RECTANGLE); |
||
395 | jButtonPan.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Pan.png"))); |
||
396 | 9943 | ppiqueras | jButtonPan.setToolTipText(PluginServices.getText(this, "Desplazamiento")); |
397 | 9899 | ppiqueras | } |
398 | return jButtonPan;
|
||
399 | } |
||
400 | |||
401 | /**
|
||
402 | * This method initializes jComboBoxZoomInAndOut
|
||
403 | *
|
||
404 | * @return javax.swing.JComboBox
|
||
405 | */
|
||
406 | private JComboBox getJComboBoxZoomInAndOut() { |
||
407 | if (jComboBoxZoomInAndOut == null) { |
||
408 | jComboBoxZoomInAndOut = new JComboBox(); |
||
409 | 9943 | ppiqueras | jComboBoxZoomInAndOut.setBounds(DEFAULT_ZOOMINANDOUT_JCOMBOBOX_RECTANGLE); |
410 | 9899 | ppiqueras | // jComboBoxZoomInAndOut.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Pan.png")));
|
411 | } |
||
412 | return jComboBoxZoomInAndOut;
|
||
413 | } |
||
414 | 9842 | ppiqueras | |
415 | 9899 | ppiqueras | // /**
|
416 | // * This method initializes jButtonZoomOut
|
||
417 | // *
|
||
418 | // * @return javax.swing.JButton
|
||
419 | // */
|
||
420 | // private JButton getJButtonZoomOut() {
|
||
421 | // if (jButtonZoomOut == null) {
|
||
422 | // jButtonZoomOut = new JButton();
|
||
423 | // jButtonZoomOut.setBounds(DEFAULT_ZOOMOUT_ICON_BUTTON_RECTANGLE);
|
||
424 | // jButtonZoomOut.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomOut.png")));
|
||
425 | // }
|
||
426 | // return jButtonZoomOut;
|
||
427 | // }
|
||
428 | //
|
||
429 | // /**
|
||
430 | // * This method initializes jButtonZoomIn
|
||
431 | // *
|
||
432 | // * @return javax.swing.JButton
|
||
433 | // */
|
||
434 | // private JButton getJButtonZoomIn() {
|
||
435 | // if (jButtonZoomIn == null) {
|
||
436 | // jButtonZoomIn = new JButton();
|
||
437 | // jButtonZoomIn.setBounds(DEFAULT_ZOOMIN_ICON_BUTTON_RECTANGLE);
|
||
438 | // jButtonZoomIn.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomIn.png")));
|
||
439 | // }
|
||
440 | // return jButtonZoomIn;
|
||
441 | // }
|
||
442 | |||
443 | 9842 | ppiqueras | /**
|
444 | 9899 | ppiqueras | * This method initializes jButtonZoomRectangleSelection
|
445 | *
|
||
446 | * @return javax.swing.JButton
|
||
447 | 9842 | ppiqueras | */
|
448 | 9899 | ppiqueras | private JButton getJButtonZoomRectangleSelection() { |
449 | if (jButtonZoomRectangleSelection == null) { |
||
450 | jButtonZoomRectangleSelection = new JButton(); |
||
451 | jButtonZoomRectangleSelection.setBounds(DEFAULT_ZOOMRECTANGLESELECTION_ICON_BUTTON_RECTANGLE); |
||
452 | jButtonZoomRectangleSelection.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomSeleccion.png"))); |
||
453 | 9943 | ppiqueras | jButtonZoomRectangleSelection.setToolTipText(PluginServices.getText(this, "seleccionar_por_rectangulo")); |
454 | 9899 | ppiqueras | } |
455 | return jButtonZoomRectangleSelection;
|
||
456 | } |
||
457 | 9842 | ppiqueras | |
458 | 9899 | ppiqueras | /**
|
459 | * This method initializes jButtonZoomPrevious
|
||
460 | *
|
||
461 | * @return javax.swing.JButton
|
||
462 | */
|
||
463 | private JButton getJButtonZoomPrevious() { |
||
464 | if (jButtonZoomPrevious == null) { |
||
465 | jButtonZoomPrevious = new JButton(); |
||
466 | jButtonZoomPrevious.setBounds(DEFAULT_ZOOMPREVIOUS_ICON_BUTTON_RECTANGLE); |
||
467 | jButtonZoomPrevious.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomPrevio.png"))); |
||
468 | 9943 | ppiqueras | jButtonZoomPrevious.setToolTipText(PluginServices.getText(this, "Zoom_Previo")); |
469 | 9899 | ppiqueras | } |
470 | return jButtonZoomPrevious;
|
||
471 | } |
||
472 | 9842 | ppiqueras | |
473 | 9899 | ppiqueras | /**
|
474 | * This method initializes jButtonZoomComplete
|
||
475 | *
|
||
476 | * @return javax.swing.JButton
|
||
477 | */
|
||
478 | private JButton getJButtonZoomComplete() { |
||
479 | if (jButtonZoomComplete == null) { |
||
480 | jButtonZoomComplete = new JButton(); |
||
481 | jButtonZoomComplete.setBounds(DEFAULT_ZOOMCOMPLETE_ICON_BUTTON_RECTANGLE); |
||
482 | jButtonZoomComplete.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/MapContents.png"))); |
||
483 | 9943 | ppiqueras | jButtonZoomComplete.setToolTipText(PluginServices.getText(this, "Zoom_Completo")); |
484 | 9899 | ppiqueras | } |
485 | return jButtonZoomComplete;
|
||
486 | } |
||
487 | 9842 | ppiqueras | |
488 | 9899 | ppiqueras | // /**
|
489 | // * This method initializes jButtonZoomInViewCentered
|
||
490 | // *
|
||
491 | // * @return javax.swing.JButton
|
||
492 | // */
|
||
493 | // private JButton getJButtonZoomInViewCentered() {
|
||
494 | // if (jButtonZoomInViewCentered == null) {
|
||
495 | // jButtonZoomInViewCentered = new JButton();
|
||
496 | // jButtonZoomInViewCentered.setBounds(DEFAULT_ZOOMINVIEWCENTERED_ICON_BUTTON_RECTANGLE);
|
||
497 | // jButtonZoomInViewCentered.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/zoommas.png")));
|
||
498 | // }
|
||
499 | // return jButtonZoomInViewCentered;
|
||
500 | // }
|
||
501 | //
|
||
502 | // /**
|
||
503 | // * This method initializes jButtonZoomOutViewCentered
|
||
504 | // *
|
||
505 | // * @return javax.swing.JButton
|
||
506 | // */
|
||
507 | // private JButton getJButtonZoomOutViewCentered() {
|
||
508 | // if (jButtonZoomOutViewCentered == null) {
|
||
509 | // jButtonZoomOutViewCentered = new JButton();
|
||
510 | // jButtonZoomOutViewCentered.setBounds(DEFAULT_ZOOMOUTVIEWCENTERED_ICON_BUTTON_RECTANGLE);
|
||
511 | // jButtonZoomOutViewCentered.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/zoommenos.png")));
|
||
512 | // }
|
||
513 | // return jButtonZoomOutViewCentered;
|
||
514 | // }
|
||
515 | 9842 | ppiqueras | |
516 | 9899 | ppiqueras | /**
|
517 | * This method initializes jComboBoxZoomInAndOut
|
||
518 | *
|
||
519 | * @return javax.swing.JComboBox
|
||
520 | */
|
||
521 | private JComboBox getJComboBoxZoomInAndOutViewCentered() { |
||
522 | if (jComboBoxZoomInAndOutViewCentered == null) { |
||
523 | 10071 | ppiqueras | jComboBoxZoomInAndOutViewCentered = new JComboBoxItemsSeekerConfigurable();
|
524 | 9899 | ppiqueras | jComboBoxZoomInAndOutViewCentered.setBounds(DEFAULT_ZOOMINANDOUTVIEWCENTERED_COMBOBOX_RECTANGLE); |
525 | // jComboBoxZoomInAndOut.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Pan.png")));
|
||
526 | } |
||
527 | return jComboBoxZoomInAndOutViewCentered;
|
||
528 | } |
||
529 | 9842 | ppiqueras | |
530 | 9899 | ppiqueras | /**
|
531 | * This method initializes jButtonInfo
|
||
532 | *
|
||
533 | * @return javax.swing.JButton
|
||
534 | */
|
||
535 | private JButton getJButtonInfo() { |
||
536 | 9943 | ppiqueras | switch (((ItemOperation)getJComboBoxToolSelection().getSelectedItem()).getOperation()) {
|
537 | case SELECTION_BY_COORDINATES_OPERATION:
|
||
538 | jButtonInfo = new JButton(); |
||
539 | jButtonInfo.setBounds(DEFAULT_INFO_ICON_BUTTON_RECTANGLE_V1); |
||
540 | jButtonInfo.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Identify.png"))); |
||
541 | jButtonInfo.setToolTipText(PluginServices.getText(this, "informacion")); |
||
542 | break;
|
||
543 | case SELECTION_BY_AREA_OPERATION:
|
||
544 | jButtonInfo = new JButton(); |
||
545 | jButtonInfo.setBounds(DEFAULT_INFO_ICON_BUTTON_RECTANGLE_V2); |
||
546 | jButtonInfo.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Identify.png"))); |
||
547 | jButtonInfo.setToolTipText(PluginServices.getText(this, "informacion")); |
||
548 | break;
|
||
549 | case DISABLED_OPERATION: // Do nothing |
||
550 | break;
|
||
551 | 9899 | ppiqueras | } |
552 | 9943 | ppiqueras | |
553 | 9899 | ppiqueras | return jButtonInfo;
|
554 | } |
||
555 | 9842 | ppiqueras | |
556 | 9899 | ppiqueras | // /**
|
557 | // * This method initializes jButtonTools
|
||
558 | // *
|
||
559 | // * @return javax.swing.JButton
|
||
560 | // */
|
||
561 | // private JButton getJButtonTools() {
|
||
562 | // if (jButtonTools == null) {
|
||
563 | // jButtonTools = new JButton();
|
||
564 | // jButtonTools.setBounds(DEFAULT_TOOLS_ICON_BUTTON_RECTANGLE);
|
||
565 | // jButtonTools.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomOut.png")));
|
||
566 | // }
|
||
567 | // return jButtonTools;
|
||
568 | // }
|
||
569 | |||
570 | /**
|
||
571 | * Represents an object that stores the necessary information for know each operation of the 'jComboBoxToolSelection'
|
||
572 | *
|
||
573 | * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
||
574 | */
|
||
575 | private class ItemOperation { |
||
576 | String _name;
|
||
577 | int _operation;
|
||
578 | |||
579 | /**
|
||
580 | * Default constructor with two parameters
|
||
581 | *
|
||
582 | * @param name Name of the operation
|
||
583 | * @param operation A code that identifies the operation
|
||
584 | */
|
||
585 | public ItemOperation(String name, int operation) { |
||
586 | _name = new String(name); |
||
587 | _operation = operation; |
||
588 | } |
||
589 | |||
590 | /**
|
||
591 | * Returns the name of the operation
|
||
592 | *
|
||
593 | * @return An String
|
||
594 | */
|
||
595 | public String getName() { |
||
596 | return _name;
|
||
597 | } |
||
598 | |||
599 | /**
|
||
600 | * Returns the code that identifies the operation
|
||
601 | *
|
||
602 | * @return An integer value
|
||
603 | */
|
||
604 | public int getOperation() { |
||
605 | return _operation;
|
||
606 | } |
||
607 | |||
608 | /**
|
||
609 | * The name of the operation that will use JComboBox
|
||
610 | */
|
||
611 | public String toString() { |
||
612 | return _name;
|
||
613 | } |
||
614 | } |
||
615 | |||
616 | /**
|
||
617 | 9943 | ppiqueras | * This class is a panel width four fields for indicate the coordinates of two points:
|
618 | 9899 | ppiqueras | * One for the ritgh-up point and another for the left-down point of a rectangle area
|
619 | *
|
||
620 | * @author Pablo Piqueras Bartolom? (p_queras_pab@hotmail.com)
|
||
621 | * @author Jorge Piera Llodr? (piera_jor@gva.es)
|
||
622 | */
|
||
623 | private class AreaCoordinatesPanel extends JPanel implements Serializable { |
||
624 | private final Rectangle DEFAULT_JRADIOBUTTON_GO_TO_AREA_RECTANGLE = new Rectangle(412, 5, 67, 50); // @jve:decl-index=0: |
||
625 | private final int DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT = 20; |
||
626 | private final int DEFAULT_COORDIANTE_LABEL_WIDTH = 20; |
||
627 | private final int DEFAULT_TEXT_FIELDS_WIDTH = 132; |
||
628 | private final int DEFAULT_X_LOCATION = 8; |
||
629 | private final int DEFAULT_Y_LEFT_UP_CORNER_LOCATION = 6; |
||
630 | private final int DEFAULT_COORDINATE_WIDTH = DEFAULT_COORDIANTE_LABEL_WIDTH + DEFAULT_TEXT_FIELDS_WIDTH + 10; |
||
631 | private final int DEFAULT_COORDINATE_HEIGHT = 25; |
||
632 | private final Dimension DEFAULT_JLABEL_VERTEX_DIMENSION = new Dimension(60, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT); // @jve:decl-index=0: |
||
633 | private final int DEFAULT_XY_COORDINATES_WIDTH = 2 * DEFAULT_COORDINATE_WIDTH + DEFAULT_JLABEL_VERTEX_DIMENSION.width + 10 ; |
||
634 | 9842 | ppiqueras | |
635 | 9899 | ppiqueras | private JPanel jPanelVertex1 = null; |
636 | private JPanel jPanelVertex2 = null; |
||
637 | private JPanel jPanelVertex1X = null; |
||
638 | private JPanel jPanelVertex1Y = null; |
||
639 | private JPanel jPanelVertex2X = null; |
||
640 | private JPanel jPanelVertex2Y = null; |
||
641 | |||
642 | private JLabel jLabelVertex1 = null; |
||
643 | private JLabel jLabelVertex2 = null; |
||
644 | private JLabel jLabelVertex1X = null; |
||
645 | private JLabel jLabelVertex1Y = null; |
||
646 | private JLabel jLabelVertex2X = null; |
||
647 | private JLabel jLabelVertex2Y = null; |
||
648 | 9915 | ppiqueras | private JTextFieldWithSpecificCaretPosition jTextFieldVertex1X = null; |
649 | private JTextFieldWithSpecificCaretPosition jTextFieldVertex1Y = null; |
||
650 | private JTextFieldWithSpecificCaretPosition jTextFieldVertex2X = null; |
||
651 | private JTextFieldWithSpecificCaretPosition jTextFieldVertex2Y = null; |
||
652 | 9899 | ppiqueras | private JRadioButton jRadioButtonGoToArea = null; |
653 | 9915 | ppiqueras | |
654 | 9943 | ppiqueras | private FocusListener focusListenerForCoordinateValidation = null; |
655 | 9842 | ppiqueras | |
656 | 9899 | ppiqueras | /**
|
657 | * This is the default constructor
|
||
658 | */
|
||
659 | public AreaCoordinatesPanel() {
|
||
660 | super();
|
||
661 | initialize(); |
||
662 | } |
||
663 | 9842 | ppiqueras | |
664 | 9899 | ppiqueras | /**
|
665 | * This method initializes this
|
||
666 | *
|
||
667 | * @return void
|
||
668 | */
|
||
669 | private void initialize() { |
||
670 | this.setLayout(null); |
||
671 | this.setBounds(DEFAULT_AREA_COORDINATES_PANEL_RECTANGLE);
|
||
672 | this.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray, 1)); |
||
673 | 9943 | ppiqueras | this.setToolTipText(PluginServices.getText(this, "select_by_vertexes_coordinates")); |
674 | 9899 | ppiqueras | // this.setBorder(javax.swing.BorderFactory.createTitledBorder(
|
675 | 9943 | ppiqueras | // null, PluginServices.getText(this, "select_by_vertexes_coordinates"),
|
676 | 9899 | ppiqueras | // javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
|
677 | // javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
|
||
678 | this.add(getJPanelVertex1());
|
||
679 | this.add(getJPanelVertex2());
|
||
680 | this.add(getJRadioButtonGoToArea());
|
||
681 | } |
||
682 | |||
683 | /**
|
||
684 | * Returns the default width of this component
|
||
685 | *
|
||
686 | * @return The default width
|
||
687 | */
|
||
688 | public int getDefaultWidth() { |
||
689 | return DEFAULT_COORDINATE_WIDTH * 2; |
||
690 | } |
||
691 | |||
692 | /**
|
||
693 | * Returns the default height of this component
|
||
694 | *
|
||
695 | * @return The default height
|
||
696 | */
|
||
697 | public int getDefaultHeight() { |
||
698 | return DEFAULT_COORDINATE_HEIGHT * 2; |
||
699 | } |
||
700 | |||
701 | /**
|
||
702 | * This method initializes jPanelVertex1
|
||
703 | *
|
||
704 | * @return javax.swing.JPanel
|
||
705 | */
|
||
706 | private JPanel getJPanelVertex1() { |
||
707 | if (jPanelVertex1 == null) { |
||
708 | jPanelVertex1 = new JPanel(); |
||
709 | jPanelVertex1.setBounds(DEFAULT_X_LOCATION, DEFAULT_Y_LEFT_UP_CORNER_LOCATION, DEFAULT_XY_COORDINATES_WIDTH, DEFAULT_COORDINATE_HEIGHT); |
||
710 | jPanelVertex1.setLayout(new GridBagLayout()); |
||
711 | jPanelVertex1.add(getJLabelVertex1(), null);
|
||
712 | jPanelVertex1.add(getJPanelVertex1X(), null);
|
||
713 | jPanelVertex1.add(getJPanelVertex1Y(), null);
|
||
714 | } |
||
715 | |||
716 | return jPanelVertex1;
|
||
717 | } |
||
718 | |||
719 | /**
|
||
720 | * This method initializes jPanelVertex2
|
||
721 | *
|
||
722 | * @return javax.swing.JPanel
|
||
723 | */
|
||
724 | private JPanel getJPanelVertex2() { |
||
725 | if (jPanelVertex2 == null) { |
||
726 | jPanelVertex2 = new JPanel(); |
||
727 | jPanelVertex2.setBounds(DEFAULT_X_LOCATION, DEFAULT_Y_LEFT_UP_CORNER_LOCATION + DEFAULT_COORDINATE_HEIGHT, DEFAULT_XY_COORDINATES_WIDTH, DEFAULT_COORDINATE_HEIGHT); |
||
728 | jPanelVertex2.setLayout(new GridBagLayout()); |
||
729 | jPanelVertex2.add(getJLabelVertex2(), null);
|
||
730 | jPanelVertex2.add(getJPanelVertex2X(), null);
|
||
731 | jPanelVertex2.add(getJPanelVertex2Y(), null);
|
||
732 | } |
||
733 | |||
734 | return jPanelVertex2;
|
||
735 | } |
||
736 | |||
737 | /**
|
||
738 | * This method initializes jLabelVertex1
|
||
739 | *
|
||
740 | * @return javax.swing.JPanel
|
||
741 | */
|
||
742 | private JLabel getJLabelVertex1() { |
||
743 | if (jLabelVertex1 == null) { |
||
744 | jLabelVertex1 = new JLabel(); |
||
745 | jLabelVertex1.setPreferredSize(DEFAULT_JLABEL_VERTEX_DIMENSION); |
||
746 | jLabelVertex1.setToolTipText(PluginServices.getText(this, "coordinates_from_area_left_up_vertex")); |
||
747 | jLabelVertex1.setText(PluginServices.getText(this, "vertex") + " 1:"); |
||
748 | jLabelVertex1.setHorizontalAlignment(SwingConstants.LEFT);
|
||
749 | jLabelVertex1.setVerticalAlignment(SwingConstants.CENTER);
|
||
750 | jLabelVertex1.setForeground(new Color(0, 0, 255)); // Blue color for text |
||
751 | } |
||
752 | return jLabelVertex1;
|
||
753 | } |
||
754 | 9842 | ppiqueras | |
755 | 9899 | ppiqueras | /**
|
756 | * This method initializes jLabelVertex2
|
||
757 | *
|
||
758 | * @return javax.swing.JPanel
|
||
759 | */
|
||
760 | private JLabel getJLabelVertex2() { |
||
761 | if (jLabelVertex2 == null) { |
||
762 | jLabelVertex2 = new JLabel(); |
||
763 | jLabelVertex2.setPreferredSize(DEFAULT_JLABEL_VERTEX_DIMENSION); |
||
764 | jLabelVertex2.setToolTipText(PluginServices.getText(this, "coordinates_from_area_right_bottom_vertex")); |
||
765 | jLabelVertex2.setText(PluginServices.getText(this, "vertex") + " 2:"); |
||
766 | jLabelVertex2.setHorizontalAlignment(SwingConstants.LEFT);
|
||
767 | jLabelVertex2.setVerticalAlignment(SwingConstants.CENTER);
|
||
768 | jLabelVertex2.setForeground(new Color(128, 64, 0)); // Brown color for text |
||
769 | } |
||
770 | return jLabelVertex2;
|
||
771 | } |
||
772 | 9842 | ppiqueras | |
773 | 9899 | ppiqueras | /**
|
774 | * This method initializes jPanelVertex1X
|
||
775 | *
|
||
776 | * @return javax.swing.JPanel
|
||
777 | */
|
||
778 | private JPanel getJPanelVertex1X() { |
||
779 | if (jPanelVertex1X == null) { |
||
780 | jPanelVertex1X = new JPanel(); |
||
781 | jPanelVertex1X.setPreferredSize(new Dimension(new Dimension(DEFAULT_COORDINATE_WIDTH, DEFAULT_COORDINATE_HEIGHT))); |
||
782 | jPanelVertex1X.setLayout(new GridBagLayout()); |
||
783 | jPanelVertex1X.add(getJLabelVertex1X(), null);
|
||
784 | jPanelVertex1X.add(getJTextFieldVertex1X(), null);
|
||
785 | } |
||
786 | |||
787 | return jPanelVertex1X;
|
||
788 | } |
||
789 | 9842 | ppiqueras | |
790 | 9899 | ppiqueras | /**
|
791 | * This method initializes jPanelVertex1Y
|
||
792 | *
|
||
793 | * @return javax.swing.JPanel
|
||
794 | */
|
||
795 | private JPanel getJPanelVertex1Y() { |
||
796 | if (jPanelVertex1Y == null) { |
||
797 | jPanelVertex1Y = new JPanel(); |
||
798 | jPanelVertex1Y.setPreferredSize(new Dimension(new Dimension(DEFAULT_COORDINATE_WIDTH, DEFAULT_COORDINATE_HEIGHT))); |
||
799 | jPanelVertex1Y.setLayout(new GridBagLayout()); |
||
800 | jPanelVertex1Y.add(getJLabelVertex1Y(), null);
|
||
801 | jPanelVertex1Y.add(getJTextFieldVertex1Y(), null);
|
||
802 | } |
||
803 | |||
804 | return jPanelVertex1Y;
|
||
805 | } |
||
806 | 9842 | ppiqueras | |
807 | 9899 | ppiqueras | /**
|
808 | * This method initializes jPanelVertex2X
|
||
809 | *
|
||
810 | * @return javax.swing.JPanel
|
||
811 | */
|
||
812 | private JPanel getJPanelVertex2X() { |
||
813 | if (jPanelVertex2X == null) { |
||
814 | jPanelVertex2X = new JPanel(); |
||
815 | jPanelVertex2X.setPreferredSize(new Dimension(new Dimension(DEFAULT_COORDINATE_WIDTH, DEFAULT_COORDINATE_HEIGHT))); |
||
816 | jPanelVertex2X.setLayout(new GridBagLayout()); |
||
817 | jPanelVertex2X.add(getJLabelVertex2X(), null);
|
||
818 | jPanelVertex2X.add(getJTextFieldVertex2X(), null);
|
||
819 | } |
||
820 | |||
821 | return jPanelVertex2X;
|
||
822 | } |
||
823 | |||
824 | /**
|
||
825 | * This method initializes jPanelVertex2Y
|
||
826 | *
|
||
827 | * @return javax.swing.JPanel
|
||
828 | */
|
||
829 | private JPanel getJPanelVertex2Y() { |
||
830 | if (jPanelVertex2Y == null) { |
||
831 | jPanelVertex2Y = new JPanel(); |
||
832 | jPanelVertex2Y.setPreferredSize(new Dimension(new Dimension(DEFAULT_COORDINATE_WIDTH, DEFAULT_COORDINATE_HEIGHT))); |
||
833 | jPanelVertex2Y.setLayout(new GridBagLayout()); |
||
834 | jPanelVertex2Y.add(getJLabelVertex2Y(), null);
|
||
835 | jPanelVertex2Y.add(getJTextFieldVertex2Y(), null);
|
||
836 | } |
||
837 | |||
838 | return jPanelVertex2Y;
|
||
839 | } |
||
840 | 9842 | ppiqueras | |
841 | 9899 | ppiqueras | /**
|
842 | * This method initializes jLabelVertex1X
|
||
843 | *
|
||
844 | * @return javax.swing.JLabel
|
||
845 | */
|
||
846 | private JLabel getJLabelVertex1X() { |
||
847 | if (jLabelVertex1X == null) { |
||
848 | jLabelVertex1X = new JLabel(); |
||
849 | jLabelVertex1X.setPreferredSize(new java.awt.Dimension(DEFAULT_COORDIANTE_LABEL_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT));
|
||
850 | jLabelVertex1X.setToolTipText(PluginServices.getText(this, "x_coordinate_from_area_left_up_vertex")); |
||
851 | jLabelVertex1X.setText(PluginServices.getText(this, "x") + ":"); |
||
852 | jLabelVertex1X.setHorizontalAlignment(SwingConstants.CENTER);
|
||
853 | jLabelVertex1X.setVerticalAlignment(SwingConstants.CENTER);
|
||
854 | jLabelVertex1X.setForeground(new Color(0, 0, 255)); // Blue color for text |
||
855 | } |
||
856 | |||
857 | return jLabelVertex1X;
|
||
858 | } |
||
859 | |||
860 | /**
|
||
861 | * This method initializes jLabelVertex2X
|
||
862 | *
|
||
863 | * @return javax.swing.JLabel
|
||
864 | */
|
||
865 | private JLabel getJLabelVertex2X() { |
||
866 | if (jLabelVertex2X == null) { |
||
867 | jLabelVertex2X = new JLabel(); |
||
868 | jLabelVertex2X.setPreferredSize(new java.awt.Dimension(DEFAULT_COORDIANTE_LABEL_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT));
|
||
869 | jLabelVertex2X.setToolTipText(PluginServices.getText(this, "x_coordinate_from_area_right_bottom_vertex")); |
||
870 | jLabelVertex2X.setText(PluginServices.getText(this, "x") + ":"); |
||
871 | jLabelVertex2X.setHorizontalAlignment(SwingConstants.CENTER);
|
||
872 | jLabelVertex2X.setVerticalAlignment(SwingConstants.CENTER);
|
||
873 | jLabelVertex2X.setForeground(new Color(128, 64, 0)); // Brown color for text |
||
874 | } |
||
875 | |||
876 | return jLabelVertex2X;
|
||
877 | } |
||
878 | |||
879 | /**
|
||
880 | * This method initializes jLabelVertex1Y
|
||
881 | *
|
||
882 | * @return javax.swing.JLabel
|
||
883 | */
|
||
884 | private JLabel getJLabelVertex1Y() { |
||
885 | if (jLabelVertex1Y == null) { |
||
886 | jLabelVertex1Y = new JLabel(); |
||
887 | jLabelVertex1Y.setPreferredSize(new java.awt.Dimension(DEFAULT_COORDIANTE_LABEL_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT));
|
||
888 | jLabelVertex1Y.setToolTipText(PluginServices.getText(this, "y_coordinate_from_area_left_up_vertex")); |
||
889 | jLabelVertex1Y.setText(PluginServices.getText(this, "y") + ":"); |
||
890 | jLabelVertex1Y.setHorizontalAlignment(SwingConstants.CENTER);
|
||
891 | jLabelVertex1Y.setVerticalAlignment(SwingConstants.CENTER);
|
||
892 | jLabelVertex1Y.setForeground(new Color(0, 0, 255)); // Blue color for text |
||
893 | } |
||
894 | |||
895 | return jLabelVertex1Y;
|
||
896 | } |
||
897 | |||
898 | /**
|
||
899 | * This method initializes jLabelVertex2Y
|
||
900 | *
|
||
901 | * @return javax.swing.JLabel
|
||
902 | */
|
||
903 | private JLabel getJLabelVertex2Y() { |
||
904 | if (jLabelVertex2Y == null) { |
||
905 | jLabelVertex2Y = new JLabel(); |
||
906 | jLabelVertex2Y.setPreferredSize(new java.awt.Dimension(DEFAULT_COORDIANTE_LABEL_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT));
|
||
907 | jLabelVertex2Y.setToolTipText(PluginServices.getText(this, "y_coordinate_from_area_right_bottom_vertex")); |
||
908 | jLabelVertex2Y.setText(PluginServices.getText(this, "y") + ":"); |
||
909 | jLabelVertex2Y.setHorizontalAlignment(SwingConstants.CENTER);
|
||
910 | jLabelVertex2Y.setVerticalAlignment(SwingConstants.CENTER);
|
||
911 | jLabelVertex2Y.setForeground(new Color(128, 64, 0)); // Brown color for text |
||
912 | } |
||
913 | |||
914 | return jLabelVertex2Y;
|
||
915 | } |
||
916 | 9915 | ppiqueras | //
|
917 | // /**
|
||
918 | // * This method initializes a FocusAdapter event adapter, it's 'focusLost()' method for set the caret position of
|
||
919 | // * the JTextField (source which generates the event of focusLost), to the first position.
|
||
920 | 9943 | ppiqueras | // * This adapter is done for use only with the JTextFields of the coordinates
|
921 | 9915 | ppiqueras | // *
|
922 | // * @return java.awt.event.FocusAdapter
|
||
923 | // */
|
||
924 | // private FocusAdapter getJFocusAdapterForJTextFields() {
|
||
925 | // if (focusAdapterForJTextFields == null) {
|
||
926 | // focusAdapterForJTextFields = new FocusAdapter() {
|
||
927 | // /*
|
||
928 | // * (non-Javadoc)
|
||
929 | // * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
|
||
930 | // */
|
||
931 | // public void focusLost(FocusEvent e) {
|
||
932 | // ((JTextField)e.getSource()).setCaretPosition(0);
|
||
933 | // }
|
||
934 | // };
|
||
935 | // }
|
||
936 | // return focusAdapterForJTextFields;
|
||
937 | // }
|
||
938 | 9943 | ppiqueras | |
939 | /**
|
||
940 | * Returns a focus listener for validate the text of a JTextField when that component loses its focus
|
||
941 | *
|
||
942 | * @return java.awt.event.FocusListener
|
||
943 | */
|
||
944 | private FocusListener getFocusListenerForCoordinateValidation() { |
||
945 | if (focusListenerForCoordinateValidation == null) { |
||
946 | focusListenerForCoordinateValidation = new FocusAdapter() { |
||
947 | /*
|
||
948 | * (non-Javadoc)
|
||
949 | * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
|
||
950 | */
|
||
951 | public void focusLost(FocusEvent e) { |
||
952 | validateCoordinate((JTextField)e.getSource());
|
||
953 | } |
||
954 | }; |
||
955 | } |
||
956 | |||
957 | return focusListenerForCoordinateValidation;
|
||
958 | } |
||
959 | 9842 | ppiqueras | |
960 | 9899 | ppiqueras | /**
|
961 | * This method initializes jTextFieldVertex1X
|
||
962 | *
|
||
963 | * @return javax.swing.JTextField
|
||
964 | */
|
||
965 | private JTextField getJTextFieldVertex1X() { |
||
966 | if (jTextFieldVertex1X == null) { |
||
967 | 9915 | ppiqueras | jTextFieldVertex1X = new JTextFieldWithSpecificCaretPosition();
|
968 | 9899 | ppiqueras | jTextFieldVertex1X.setPreferredSize(new Dimension(DEFAULT_TEXT_FIELDS_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT)); |
969 | jTextFieldVertex1X.setToolTipText(PluginServices.getText(this, "x_coordinate_from_area_left_up_vertex")); |
||
970 | 9943 | ppiqueras | jTextFieldVertex1X.addFocusListener(getFocusListenerForCoordinateValidation()); |
971 | 9899 | ppiqueras | } |
972 | return jTextFieldVertex1X;
|
||
973 | } |
||
974 | 9842 | ppiqueras | |
975 | 9899 | ppiqueras | /**
|
976 | * This method initializes jTextFieldVertex1Y
|
||
977 | *
|
||
978 | * @return javax.swing.JTextField
|
||
979 | */
|
||
980 | private JTextField getJTextFieldVertex1Y() { |
||
981 | if (jTextFieldVertex1Y == null) { |
||
982 | 9915 | ppiqueras | jTextFieldVertex1Y = new JTextFieldWithSpecificCaretPosition();
|
983 | 9899 | ppiqueras | jTextFieldVertex1Y.setPreferredSize(new Dimension(DEFAULT_TEXT_FIELDS_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT)); |
984 | jTextFieldVertex1Y.setToolTipText(PluginServices.getText(this, "y_coordinate_from_area_left_up_vertex")); |
||
985 | 9943 | ppiqueras | jTextFieldVertex1Y.addFocusListener(getFocusListenerForCoordinateValidation()); |
986 | 9899 | ppiqueras | } |
987 | return jTextFieldVertex1Y;
|
||
988 | } |
||
989 | 9842 | ppiqueras | |
990 | 9899 | ppiqueras | /**
|
991 | * This method initializes jTextFieldVertex2X
|
||
992 | *
|
||
993 | * @return javax.swing.JTextField
|
||
994 | */
|
||
995 | private JTextField getJTextFieldVertex2X() { |
||
996 | if (jTextFieldVertex2X == null) { |
||
997 | 9915 | ppiqueras | jTextFieldVertex2X = new JTextFieldWithSpecificCaretPosition();
|
998 | 9899 | ppiqueras | jTextFieldVertex2X.setPreferredSize(new Dimension(DEFAULT_TEXT_FIELDS_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT)); |
999 | jTextFieldVertex2X.setToolTipText(PluginServices.getText(this, "x_coordinate_from_area_right_bottom_vertex")); |
||
1000 | 9943 | ppiqueras | jTextFieldVertex2X.addFocusListener(getFocusListenerForCoordinateValidation()); |
1001 | 9899 | ppiqueras | } |
1002 | return jTextFieldVertex2X;
|
||
1003 | } |
||
1004 | 9842 | ppiqueras | |
1005 | 9899 | ppiqueras | /**
|
1006 | * This method initializes jTextFieldVertex2Y
|
||
1007 | *
|
||
1008 | * @return javax.swing.JTextField
|
||
1009 | */
|
||
1010 | private JTextField getJTextFieldVertex2Y() { |
||
1011 | if (jTextFieldVertex2Y == null) { |
||
1012 | 9915 | ppiqueras | jTextFieldVertex2Y = new JTextFieldWithSpecificCaretPosition();
|
1013 | 9899 | ppiqueras | jTextFieldVertex2Y.setPreferredSize(new Dimension(DEFAULT_TEXT_FIELDS_WIDTH, DEFAULT_LABELS_AND_TEXT_FIELDS_HEIGHT)); |
1014 | jTextFieldVertex2Y.setToolTipText(PluginServices.getText(this, "y_coordinate_from_area_right_bottom_vertex")); |
||
1015 | 9943 | ppiqueras | jTextFieldVertex2Y.addFocusListener(getFocusListenerForCoordinateValidation()); |
1016 | 9899 | ppiqueras | } |
1017 | return jTextFieldVertex2Y;
|
||
1018 | 9842 | ppiqueras | } |
1019 | 9943 | ppiqueras | |
1020 | /**
|
||
1021 | * Validates the coordinate of a JTextField
|
||
1022 | *
|
||
1023 | * @param coordinate javax.swing.JTextField
|
||
1024 | */
|
||
1025 | private void validateCoordinate(JTextField coordinate) { |
||
1026 | if (coordinate != null) { |
||
1027 | // If the format of the coordinate is incorrect, shows a message warning the user that problem and resets the coordinate text
|
||
1028 | 10071 | ppiqueras | if ((coordinate.getText().compareTo("") != 0) &&(! StringNumberUtilities.isExponentialRealNumber(coordinate.getText()))) { |
1029 | 9943 | ppiqueras | JOptionPane.showMessageDialog(this, PluginServices.getText(null, "incorrect_coordinate_format"), PluginServices.getText(null, "error"), JOptionPane.ERROR_MESSAGE); |
1030 | coordinate.setText(""); // Reset text |
||
1031 | } |
||
1032 | } |
||
1033 | } |
||
1034 | 9842 | ppiqueras | |
1035 | /**
|
||
1036 | 9899 | ppiqueras | * This method initializes jbuttonGoToArea
|
1037 | 9842 | ppiqueras | *
|
1038 | 9899 | ppiqueras | * @return javax.swing.JRadioButton
|
1039 | 9842 | ppiqueras | */
|
1040 | 9899 | ppiqueras | private JRadioButton getJRadioButtonGoToArea() { |
1041 | if (jRadioButtonGoToArea == null) { |
||
1042 | jRadioButtonGoToArea = new JRadioButton(); |
||
1043 | jRadioButtonGoToArea.setBounds(DEFAULT_JRADIOBUTTON_GO_TO_AREA_RECTANGLE); |
||
1044 | jRadioButtonGoToArea.setToolTipText(PluginServices.getText(this, "to_previsualize")); |
||
1045 | jRadioButtonGoToArea.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/to_previsualize_area.png"))); |
||
1046 | } |
||
1047 | return jRadioButtonGoToArea;
|
||
1048 | 8018 | jorpiell | } |
1049 | 9899 | ppiqueras | |
1050 | /**
|
||
1051 | * Sets the extent
|
||
1052 | * @param extent
|
||
1053 | */
|
||
1054 | public void setExtent(Rectangle2D extent){ |
||
1055 | getJTextFieldVertex1X().setText(String.valueOf(extent.getMaxX()));
|
||
1056 | getJTextFieldVertex1Y().setText(String.valueOf(extent.getMaxY()));
|
||
1057 | getJTextFieldVertex2X().setText(String.valueOf(extent.getMinX()));
|
||
1058 | getJTextFieldVertex2Y().setText(String.valueOf(extent.getMinY()));
|
||
1059 | } |
||
1060 | 8018 | jorpiell | |
1061 | 9899 | ppiqueras | /**
|
1062 | * Gets the extent
|
||
1063 | * @return
|
||
1064 | 8018 | jorpiell | */
|
1065 | 9899 | ppiqueras | public Rectangle2D getExtent(){ |
1066 | if ((!getJTextFieldVertex1X().getText().equals("")) && |
||
1067 | (!getJTextFieldVertex1Y().getText().equals("")) &&
|
||
1068 | (!getJTextFieldVertex2X().getText().equals("")) &&
|
||
1069 | (!getJTextFieldVertex2Y().getText().equals(""))){
|
||
1070 | Rectangle2D r2d = new Rectangle2D.Double(new Double(getJTextFieldVertex1X().getText()).doubleValue(), |
||
1071 | new Double(getJTextFieldVertex1Y().getText()).doubleValue(), |
||
1072 | new Double(getJTextFieldVertex2X().getText()).doubleValue(), |
||
1073 | new Double(getJTextFieldVertex2Y().getText()).doubleValue()); |
||
1074 | return r2d;
|
||
1075 | 8018 | jorpiell | } |
1076 | 9899 | ppiqueras | return null; |
1077 | 8018 | jorpiell | } |
1078 | 9899 | ppiqueras | |
1079 | /**
|
||
1080 | * Enables or disables all inner JTextField
|
||
1081 | *
|
||
1082 | * @param b A boolean value
|
||
1083 | */
|
||
1084 | public void setAllTextFieldsEnabled(boolean b) { |
||
1085 | getJTextFieldVertex1X().setEnabled(b); |
||
1086 | getJTextFieldVertex1Y().setEnabled(b); |
||
1087 | getJTextFieldVertex2X().setEnabled(b); |
||
1088 | getJTextFieldVertex2Y().setEnabled(b); |
||
1089 | } |
||
1090 | 8018 | jorpiell | } |
1091 | 9899 | ppiqueras | |
1092 | 9453 | jorpiell | /**
|
1093 | 9899 | ppiqueras | * DOCUMENTAR!!
|
1094 | *
|
||
1095 | * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
||
1096 | 9453 | jorpiell | */
|
1097 | 9899 | ppiqueras | public class AreaMapControlPanel extends MapControl { |
1098 | // private final Rectangle DEFAULT_AREA_MAPCONTROL_RECTANGLE = new Rectangle(0, 0, DEFAULT_AREA_MAPCONTROL_PANEL_RECTANGLE.width, DEFAULT_AREA_MAPCONTROL_PANEL_RECTANGLE.height);
|
||
1099 | |||
1100 | // private MapControl m_MapControl = null;
|
||
1101 | |||
1102 | /**
|
||
1103 | * Default constructor
|
||
1104 | */
|
||
1105 | public AreaMapControlPanel() {
|
||
1106 | this.initialize();
|
||
1107 | 9453 | jorpiell | } |
1108 | 9899 | ppiqueras | |
1109 | /**
|
||
1110 | * This method initializes this
|
||
1111 | */
|
||
1112 | private void initialize() { |
||
1113 | this.setLayout(null); |
||
1114 | this.setBounds(DEFAULT_AREA_MAPCONTROL_PANEL_RECTANGLE);
|
||
1115 | this.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray, 1)); |
||
1116 | // this.setBorder(javax.swing.BorderFactory.createTitledBorder(
|
||
1117 | // null, PluginServices.getText(this, "select_by_graphical_area"),
|
||
1118 | // javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
|
||
1119 | // javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
|
||
1120 | // this.add(this.getMapControl(DEFAULT_AREA_MAPCONTROL_PANEL_RECTANGLE.getSize()));
|
||
1121 | } |
||
1122 | |||
1123 | // /*
|
||
1124 | // * (non-Javadoc)
|
||
1125 | // * @see java.awt.Component#setEnabled(boolean)
|
||
1126 | // */
|
||
1127 | // public void setEnabled(boolean enabled) {
|
||
1128 | // this.setEnabled(false);
|
||
1129 | // this.getMapControl().setEnabled(false);
|
||
1130 | // }
|
||
1131 | |||
1132 | // /*
|
||
1133 | // * (non-Javadoc)
|
||
1134 | // * @see com.iver.cit.gvsig.project.documents.view.gui.IView#getMapControl()
|
||
1135 | // */
|
||
1136 | // public MapControl getMapControl() {
|
||
1137 | // return this.m_MapControl;
|
||
1138 | // }
|
||
1139 | |||
1140 | 9453 | jorpiell | |
1141 | 9899 | ppiqueras | /**
|
1142 | * Adds listeners to the inner MapControl of the inner area JPanel ??
|
||
1143 | * (SOBRAR?N ALGUNOS)
|
||
1144 | */
|
||
1145 | private void addListeneresToAreaPanel() { |
||
1146 | // //Listener de eventos de movimiento que pone las coordenadas del rat?n en la barra de estado
|
||
1147 | // StatusBarListener sbl = new StatusBarListener(this.areaMapControlPanel.getMapControl());
|
||
1148 | //
|
||
1149 | // // Zoom out (pinchas y el mapa se centra y te muestra m?s).
|
||
1150 | // // No es dibujando un rect?ngulo, es solo pinchando.
|
||
1151 | // ZoomOutListener zol = new ZoomOutListener(this.areaMapControlPanel.getMapControl());
|
||
1152 | // this.areaMapControlPanel.getMapControl().addMapTool("zoomOut", new Behavior[]{new PointBehavior(zol), new MouseMovementBehavior(sbl)});
|
||
1153 | //
|
||
1154 | // // Pan
|
||
1155 | // PanListener pl = new PanListener(this.areaMapControlPanel.getMapControl());
|
||
1156 | // this.areaMapControlPanel.getMapControl().addMapTool("pan", new Behavior[]{new MoveBehavior(pl), new MouseMovementBehavior(sbl)});
|
||
1157 | //
|
||
1158 | // // Medir
|
||
1159 | // MeasureListener mli = new MeasureListener(this.areaMapControlPanel.getMapControl());
|
||
1160 | // this.areaMapControlPanel.getMapControl().addMapTool("medicion", new Behavior[]{new PolylineBehavior(mli), new MouseMovementBehavior(sbl)});
|
||
1161 | //
|
||
1162 | // // Area
|
||
1163 | // AreaListener ali = new AreaListener(this.areaMapControlPanel.getMapControl());
|
||
1164 | // this.areaMapControlPanel.getMapControl().addMapTool("area", new Behavior[]{new PolygonBehavior(ali), new MouseMovementBehavior(sbl)});
|
||
1165 | //
|
||
1166 | // // Seleccion por punto
|
||
1167 | // PointSelectListener psl = new PointSelectListener(this.areaMapControlPanel.getMapControl());
|
||
1168 | // this.areaMapControlPanel.getMapControl().addMapTool("pointSelection", new Behavior[]{new PointBehavior(psl), new MouseMovementBehavior(sbl)});
|
||
1169 | //
|
||
1170 | // // Info por punto
|
||
1171 | // InfoListener il = new InfoListener(this.areaMapControlPanel.getMapControl());
|
||
1172 | // this.areaMapControlPanel.getMapControl().addMapTool("info", new Behavior[]{new PointBehavior(il), new MouseMovementBehavior(sbl)});
|
||
1173 | //
|
||
1174 | // // Link por punto
|
||
1175 | // LinkListener ll = new LinkListener(this.areaMapControlPanel.getMapControl());
|
||
1176 | // this.areaMapControlPanel.getMapControl().addMapTool("link", new Behavior[]{new PointBehavior(ll), new MouseMovementBehavior(sbl)});
|
||
1177 | //
|
||
1178 | // // Selecci?n por rect?ngulo
|
||
1179 | // RectangleSelectListener rsl = new RectangleSelectListener(this.areaMapControlPanel.getMapControl());
|
||
1180 | // this.areaMapControlPanel.getMapControl().addMapTool("rectSelection", new Behavior[]{new RectangleBehavior(rsl), new MouseMovementBehavior(sbl)});
|
||
1181 | //
|
||
1182 | // // Selecci?n por pol?gono
|
||
1183 | // PolygonSelectListener poligSel = new PolygonSelectListener(this.areaMapControlPanel.getMapControl());
|
||
1184 | // this.areaMapControlPanel.getMapControl().addMapTool("polSelection", new Behavior[]{new PolygonBehavior(poligSel), new MouseMovementBehavior(sbl)});
|
||
1185 | //
|
||
1186 | // // Zoom por rect?ngulo
|
||
1187 | // ZoomOutRightButtonListener zoil = new ZoomOutRightButtonListener(this.areaMapControlPanel.getMapControl());
|
||
1188 | // ZoomInListener zil = new ZoomInListener(this.areaMapControlPanel.getMapControl());
|
||
1189 | // this.areaMapControlPanel.getMapControl().addMapTool("zoomIn", new Behavior[]{new RectangleBehavior(zil),
|
||
1190 | // new PointBehavior(zoil), new MouseMovementBehavior(sbl)});
|
||
1191 | //
|
||
1192 | // SelectImageListener sil = new SelectImageListener(this.areaMapControlPanel.getMapControl());
|
||
1193 | // this.areaMapControlPanel.getMapControl().addMapTool("selectImage", new Behavior[]{
|
||
1194 | // new PointBehavior(sil), new MouseMovementBehavior(sbl)});
|
||
1195 | //
|
||
1196 | // ZoomPixelCursorListener zp = new ZoomPixelCursorListener(this.areaMapControlPanel.getMapControl());
|
||
1197 | // this.areaMapControlPanel.getMapControl().addMapTool("zoom_pixel_cursor", new Behavior[]{new PointBehavior(zp), new MouseMovementBehavior(sbl)});
|
||
1198 | //
|
||
1199 | // this.areaMapControlPanel.getMapControl().setTool("zoomIn"); // Por defecto
|
||
1200 | // // m_MapControl.setPaintEnabled(true);
|
||
1201 | 9709 | jorpiell | } |
1202 | 9899 | ppiqueras | |
1203 | // /**
|
||
1204 | // * This method initializes m_MapControl
|
||
1205 | // *
|
||
1206 | // * @return com.iver.cit.gvsig.fmap.MapControl
|
||
1207 | // */
|
||
1208 | // private MapControl getMapControl(Dimension d) {
|
||
1209 | // if (m_MapControl == null) {
|
||
1210 | // m_MapControl = new MapControl(); // Default is paintEnabled = false.
|
||
1211 | // m_MapControl.setBounds(DEFAULT_AREA_MAPCONTROL_RECTANGLE);
|
||
1212 | // }
|
||
1213 | //
|
||
1214 | // return m_MapControl;
|
||
1215 | // }
|
||
1216 | 9842 | ppiqueras | |
1217 | 9899 | ppiqueras | /**
|
1218 | * @see MapControl#drawMap(boolean)
|
||
1219 | */
|
||
1220 | public void repaintMap() { |
||
1221 | this.drawMap(false); |
||
1222 | 9842 | ppiqueras | } |
1223 | 9899 | ppiqueras | //
|
1224 | // /**
|
||
1225 | // * @see MapControl#getImage()
|
||
1226 | // */
|
||
1227 | // public BufferedImage getImage() {
|
||
1228 | // return getMapControl().getImage();
|
||
1229 | // }
|
||
1230 | //
|
||
1231 | // /**
|
||
1232 | // * @see MapControl#setProjection(IProjection)
|
||
1233 | // */
|
||
1234 | // public void setProjection(IProjection proj)
|
||
1235 | // {
|
||
1236 | // getMapControl().setProjection(proj);
|
||
1237 | // }
|
||
1238 | //
|
||
1239 | // /**
|
||
1240 | // * @see MapControl#getProjection()
|
||
1241 | // */
|
||
1242 | // public IProjection getProjection()
|
||
1243 | // {
|
||
1244 | // return getMapControl().getProjection();
|
||
1245 | // }
|
||
1246 | 9842 | ppiqueras | } |
1247 | 9899 | ppiqueras | } |