svn-gvsig-desktop / tags / v10_RC2c / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / fframes / dialogs / FFrameScaleBarDialog.java @ 8745
History | View | Annotate | Download (32.3 KB)
1 | 312 | fernando | /*
|
---|---|---|---|
2 | * Created on 02-jun-2004
|
||
3 | *
|
||
4 | */
|
||
5 | 1103 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
6 | *
|
||
7 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
8 | *
|
||
9 | * This program is free software; you can redistribute it and/or
|
||
10 | * modify it under the terms of the GNU General Public License
|
||
11 | * as published by the Free Software Foundation; either version 2
|
||
12 | * of the License, or (at your option) any later version.
|
||
13 | *
|
||
14 | * This program is distributed in the hope that it will be useful,
|
||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
17 | * GNU General Public License for more details.
|
||
18 | *
|
||
19 | * You should have received a copy of the GNU General Public License
|
||
20 | * along with this program; if not, write to the Free Software
|
||
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
22 | *
|
||
23 | * For more information, contact:
|
||
24 | *
|
||
25 | * Generalitat Valenciana
|
||
26 | * Conselleria d'Infraestructures i Transport
|
||
27 | * Av. Blasco Ib??ez, 50
|
||
28 | * 46010 VALENCIA
|
||
29 | * SPAIN
|
||
30 | *
|
||
31 | * +34 963862235
|
||
32 | * gvsig@gva.es
|
||
33 | * www.gvsig.gva.es
|
||
34 | *
|
||
35 | * or
|
||
36 | *
|
||
37 | * IVER T.I. S.A
|
||
38 | * Salamanca 50
|
||
39 | * 46005 Valencia
|
||
40 | * Spain
|
||
41 | *
|
||
42 | * +34 963163400
|
||
43 | * dac@iver.es
|
||
44 | */
|
||
45 | 312 | fernando | package com.iver.cit.gvsig.gui.layout.fframes.dialogs; |
46 | |||
47 | 1074 | vcaballero | |
48 | 399 | vcaballero | import java.awt.Color; |
49 | 312 | fernando | import java.awt.Component; |
50 | import java.awt.Dimension; |
||
51 | 7634 | caballero | import java.awt.FlowLayout; |
52 | 3374 | caballero | import java.awt.event.KeyEvent; |
53 | 312 | fernando | import java.awt.geom.Rectangle2D; |
54 | |||
55 | import javax.swing.ImageIcon; |
||
56 | 596 | fernando | import javax.swing.JCheckBox; |
57 | 312 | fernando | import javax.swing.JLabel; |
58 | import javax.swing.JList; |
||
59 | import javax.swing.JPanel; |
||
60 | 596 | fernando | import javax.swing.JTextField; |
61 | 312 | fernando | import javax.swing.ListCellRenderer; |
62 | |||
63 | 7634 | caballero | import com.iver.andami.PluginServices; |
64 | import com.iver.andami.ui.mdiManager.WindowInfo; |
||
65 | import com.iver.cit.gvsig.AddLayer; |
||
66 | import com.iver.cit.gvsig.gui.dialogs.FontChooser; |
||
67 | import com.iver.cit.gvsig.gui.layout.Attributes; |
||
68 | import com.iver.cit.gvsig.gui.layout.FLayoutUtilities; |
||
69 | import com.iver.cit.gvsig.gui.layout.Layout; |
||
70 | import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar; |
||
71 | import com.iver.cit.gvsig.gui.layout.fframes.FFrameView; |
||
72 | import com.iver.cit.gvsig.gui.layout.fframes.IFFrame; |
||
73 | import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel; |
||
74 | import com.iver.cit.gvsig.gui.panels.ColorChooserPanel; |
||
75 | 1074 | vcaballero | |
76 | 7634 | caballero | |
77 | 312 | fernando | /**
|
78 | * Dialogo para a?adir una barra de escala al Layout.
|
||
79 | *
|
||
80 | * @author Vicente Caballero Navarro
|
||
81 | */
|
||
82 | public class FFrameScaleBarDialog extends JPanel implements IFFrameDialog { |
||
83 | 2268 | fjp | private static final ImageIcon inumero = new ImageIcon(AddLayer.class.getClassLoader() |
84 | 1074 | vcaballero | .getResource("images/numero.png"));
|
85 | 2268 | fjp | private static final ImageIcon ibarra1 = new ImageIcon(AddLayer.class.getClassLoader() |
86 | 1074 | vcaballero | .getResource("images/barra1.png"));
|
87 | 2268 | fjp | private static final ImageIcon ibarra2 = new ImageIcon(AddLayer.class.getClassLoader() |
88 | 1074 | vcaballero | .getResource("images/barra2.png"));
|
89 | 2268 | fjp | private static final ImageIcon ibarra3 = new ImageIcon(AddLayer.class.getClassLoader() |
90 | 1074 | vcaballero | .getResource("images/barra3.png"));
|
91 | private javax.swing.JPanel jContentPane = null; |
||
92 | private javax.swing.JScrollPane jScrollPane = null; |
||
93 | private javax.swing.JList liVistas = null; |
||
94 | private javax.swing.JCheckBox chbMantenerIntervalo = null; |
||
95 | private javax.swing.JComboBox cbEscala = null; |
||
96 | private javax.swing.JComboBox cbUnidades = null; |
||
97 | private javax.swing.JLabel lIntervalo = null; |
||
98 | private javax.swing.JTextField tIntervalo = null; |
||
99 | private javax.swing.JLabel lNumIntervalos = null; |
||
100 | private javax.swing.JTextField tNumIntervalos = null; |
||
101 | private javax.swing.JLabel lDivIzquierda = null; |
||
102 | private javax.swing.JTextField tDivIzquierda = null; |
||
103 | private javax.swing.JButton bAceptar = null; |
||
104 | private javax.swing.JButton bCancelar = null; |
||
105 | 312 | fernando | |
106 | 1074 | vcaballero | //private ProjectView m_projectView=null;
|
107 | private FFrameView fframeview = null; |
||
108 | private Rectangle2D rect = new Rectangle2D.Double(); |
||
109 | private Layout m_layout = null; |
||
110 | private FFrameScaleBar fframescalebar = null; //new FFrameScaleBar(); |
||
111 | private boolean isAcepted = false; |
||
112 | private ImageIcon[] images = new ImageIcon[4]; |
||
113 | private javax.swing.JButton bFuente = null; |
||
114 | private JPanel pMarcoVista = null; |
||
115 | 399 | vcaballero | private JPanel pDescripcion = null; |
116 | private JTextField tfDescripcion = null; |
||
117 | private JPanel pUnidades = null; |
||
118 | private JCheckBox chbSobreDescripcion = null; |
||
119 | private JCheckBox chbMostrarUnidades = null; |
||
120 | private JCheckBox chbSobreUnidades = null; |
||
121 | private JPanel pEtiquetas = null; |
||
122 | private JCheckBox chbEtiquetas = null; |
||
123 | private JPanel pBarra = null; |
||
124 | private JPanel jPanel5 = null; |
||
125 | private JPanel jPanel6 = null; |
||
126 | private JPanel jPanel7 = null; |
||
127 | 6806 | fjp | private ColorChooserPanel bUnidadesColor = null; |
128 | private ColorChooserPanel bBarraColor = null; |
||
129 | 1074 | vcaballero | private Color barcolor = null; |
130 | private Color textcolor = null; |
||
131 | |||
132 | 399 | vcaballero | //private JPanel jPanel = null;
|
133 | //private JPanel jPanel1 = null;
|
||
134 | private JPanel jPanel2 = null; |
||
135 | private JCheckBox jCheckBox = null; |
||
136 | 2305 | vcaballero | private JPRotation pRotation = null; |
137 | 2592 | caballero | private JLabel lblBarColor = null; |
138 | 3374 | caballero | private JTextField txtNumDec = null; |
139 | private JLabel lblNumDec = null; |
||
140 | 312 | fernando | |
141 | 1074 | vcaballero | /**
|
142 | * This is the default constructor
|
||
143 | *
|
||
144 | * @param layout DOCUMENT ME!
|
||
145 | * @param fframe DOCUMENT ME!
|
||
146 | */
|
||
147 | public FFrameScaleBarDialog(Layout layout, FFrameScaleBar fframe) {
|
||
148 | super();
|
||
149 | fframescalebar = fframe; |
||
150 | barcolor = fframescalebar.getBarColor(); |
||
151 | textcolor = fframescalebar.getTextColor(); |
||
152 | 312 | fernando | |
153 | 6693 | caballero | if (fframescalebar.getFFrameDependence() != null && fframescalebar.getDescription().equals("")) { |
154 | 7023 | caballero | getTfNumberScale().setText("1:" +
|
155 | 3114 | caballero | String.valueOf(((FFrameView)fframescalebar.getFFrameDependence()).getScale()));
|
156 | 1074 | vcaballero | } |
157 | 312 | fernando | |
158 | 1074 | vcaballero | m_layout = layout; |
159 | initialize(); |
||
160 | } |
||
161 | 312 | fernando | |
162 | 1074 | vcaballero | /**
|
163 | * DOCUMENT ME!
|
||
164 | *
|
||
165 | * @param r DOCUMENT ME!
|
||
166 | */
|
||
167 | public void setRectangle(Rectangle2D r) { |
||
168 | rect.setRect(r); |
||
169 | } |
||
170 | 312 | fernando | |
171 | 1074 | vcaballero | /**
|
172 | * This method initializes this
|
||
173 | */
|
||
174 | private void initialize() { |
||
175 | this.setLayout(null); |
||
176 | this.add(getJContentPane(), null); |
||
177 | 2305 | vcaballero | this.setSize(621, 400); |
178 | 312 | fernando | |
179 | 1074 | vcaballero | if (fframescalebar.getStyle() == 0) { |
180 | getChbMantenerIntervalo().setEnabled(false);
|
||
181 | 312 | fernando | |
182 | 1074 | vcaballero | ///getLUnidades().setEnabled(false);
|
183 | getCbUnidades().setEnabled(false);
|
||
184 | getChbEtiquetas().setEnabled(false);
|
||
185 | getBBarraColor().setEnabled(false);
|
||
186 | getChbMostrarUnidades().setEnabled(false);
|
||
187 | getChbSobreUnidades().setEnabled(false);
|
||
188 | getLIntervalo().setEnabled(false);
|
||
189 | getTIntervalo().setEnabled(false);
|
||
190 | getLNumIntervalos().setEnabled(false);
|
||
191 | getTNumIntervalos().setEnabled(false);
|
||
192 | getLDivIzquierda().setEnabled(false);
|
||
193 | getTDivIzquierda().setEnabled(false);
|
||
194 | } |
||
195 | 2305 | vcaballero | getPRotation().setRotation(fframescalebar.getRotation()); |
196 | 1074 | vcaballero | } |
197 | 312 | fernando | |
198 | 1074 | vcaballero | /**
|
199 | * This method initializes jContentPane
|
||
200 | *
|
||
201 | * @return javax.swing.JPanel
|
||
202 | */
|
||
203 | private javax.swing.JPanel getJContentPane() {
|
||
204 | if (jContentPane == null) { |
||
205 | jContentPane = new javax.swing.JPanel();
|
||
206 | jContentPane.setLayout(null);
|
||
207 | jContentPane.add(getBAceptar(), null);
|
||
208 | jContentPane.add(getBCancelar(), null);
|
||
209 | 2305 | vcaballero | jContentPane.add(getPRotation(), null);
|
210 | jContentPane.setSize(617, 386); |
||
211 | 1074 | vcaballero | jContentPane.setPreferredSize(new java.awt.Dimension(50, 50)); |
212 | jContentPane.setLocation(0, 6); |
||
213 | jContentPane.add(getPMarcoVista(), null);
|
||
214 | jContentPane.add(getPDescripcion(), null);
|
||
215 | jContentPane.add(getPUnidades(), null);
|
||
216 | jContentPane.add(getPBarra(), null);
|
||
217 | jContentPane.add(getPEtiquetas(), null);
|
||
218 | } |
||
219 | 312 | fernando | |
220 | 1074 | vcaballero | return jContentPane;
|
221 | } |
||
222 | 312 | fernando | |
223 | 1074 | vcaballero | /**
|
224 | * This method initializes jScrollPane
|
||
225 | *
|
||
226 | * @return javax.swing.JScrollPane
|
||
227 | */
|
||
228 | private javax.swing.JScrollPane getJScrollPane() {
|
||
229 | if (jScrollPane == null) { |
||
230 | jScrollPane = new javax.swing.JScrollPane();
|
||
231 | 7634 | caballero | jScrollPane.setPreferredSize(new java.awt.Dimension(250,55)); |
232 | 1074 | vcaballero | jScrollPane.setViewportView(getLiVistas()); |
233 | } |
||
234 | 312 | fernando | |
235 | 1074 | vcaballero | return jScrollPane;
|
236 | } |
||
237 | 312 | fernando | |
238 | 1074 | vcaballero | /**
|
239 | * This method initializes liVistas
|
||
240 | *
|
||
241 | * @return javax.swing.JList
|
||
242 | */
|
||
243 | private javax.swing.JList getLiVistas() {
|
||
244 | if (liVistas == null) { |
||
245 | ListViewModel listmodel = new ListViewModel();
|
||
246 | 2915 | caballero | listmodel.addViews(m_layout); |
247 | 312 | fernando | |
248 | 1074 | vcaballero | ///ArrayList list = listmodel.getViews();
|
249 | 312 | fernando | |
250 | 1074 | vcaballero | liVistas = new javax.swing.JList();
|
251 | 312 | fernando | |
252 | 7634 | caballero | liVistas.setSize(new java.awt.Dimension(250,52)); |
253 | 1074 | vcaballero | liVistas.setModel(listmodel); |
254 | 312 | fernando | |
255 | 1074 | vcaballero | for (int i = 0; i < liVistas.getModel().getSize(); i++) { |
256 | 3114 | caballero | if (fframescalebar.getFFrameDependence() != null) { |
257 | 1074 | vcaballero | fframeview = (FFrameView) liVistas.getModel().getElementAt(i); |
258 | 312 | fernando | |
259 | 3114 | caballero | if (fframeview == fframescalebar.getFFrameDependence()) {
|
260 | 1074 | vcaballero | liVistas.setSelectedIndex(i); |
261 | } |
||
262 | } |
||
263 | } |
||
264 | 312 | fernando | |
265 | 1074 | vcaballero | liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
266 | 3239 | caballero | private int selectIndex=-1; |
267 | 1074 | vcaballero | public void valueChanged( |
268 | 4778 | caballero | javax.swing.event.ListSelectionEvent e) { |
269 | 6408 | caballero | IFFrame[] fframes=m_layout.getFFrames();
|
270 | 6604 | caballero | int selectInt = ((JList) e.getSource()) |
271 | 4778 | caballero | .getSelectedIndex(); |
272 | if (selectInt != selectIndex) {
|
||
273 | selectIndex = selectInt; |
||
274 | if (selectIndex == -1) |
||
275 | return;
|
||
276 | fframeview = (FFrameView) liVistas.getModel() |
||
277 | .getElementAt(selectInt); |
||
278 | 312 | fernando | |
279 | 6408 | caballero | for (int i = 0; i < fframes.length; i++) { |
280 | IFFrame f = fframes[i]; |
||
281 | 312 | fernando | |
282 | 4778 | caballero | if (f instanceof FFrameView) { |
283 | if (((FFrameView) f).getView() == fframeview
|
||
284 | .getView()) { |
||
285 | fframescalebar |
||
286 | .setFFrameDependence(fframeview); |
||
287 | } |
||
288 | } |
||
289 | 1074 | vcaballero | } |
290 | 4778 | caballero | |
291 | getTNumIntervalos().setText( |
||
292 | String.valueOf(fframescalebar
|
||
293 | .getNumInterval())); |
||
294 | getTDivIzquierda().setText( |
||
295 | String.valueOf(fframescalebar
|
||
296 | .getNumLeft())); |
||
297 | getTIntervalo().setText( |
||
298 | fframescalebar.obtainInterval()); |
||
299 | 6693 | caballero | getTfNumberScale().setText( |
300 | fframescalebar.getDescription()); |
||
301 | 1074 | vcaballero | } |
302 | } |
||
303 | 4778 | caballero | }); |
304 | 1074 | vcaballero | } |
305 | 312 | fernando | |
306 | 1074 | vcaballero | return liVistas;
|
307 | } |
||
308 | 312 | fernando | |
309 | 1074 | vcaballero | /**
|
310 | * This method initializes chbMantenerIntervalo
|
||
311 | *
|
||
312 | * @return javax.swing.JCheckBox
|
||
313 | */
|
||
314 | private javax.swing.JCheckBox getChbMantenerIntervalo() {
|
||
315 | if (chbMantenerIntervalo == null) { |
||
316 | chbMantenerIntervalo = new javax.swing.JCheckBox();
|
||
317 | chbMantenerIntervalo.setSelected(fframescalebar.isbIntervalSet()); |
||
318 | chbMantenerIntervalo.setText(PluginServices.getText(this,
|
||
319 | "mantener_intervalo"));
|
||
320 | chbMantenerIntervalo.setPreferredSize(new java.awt.Dimension(200, 20)); |
||
321 | chbMantenerIntervalo.addActionListener(new java.awt.event.ActionListener() {
|
||
322 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
323 | fframescalebar.setIntervalSet(getChbMantenerIntervalo() |
||
324 | .isSelected()); |
||
325 | } |
||
326 | }); |
||
327 | } |
||
328 | 312 | fernando | |
329 | 1074 | vcaballero | return chbMantenerIntervalo;
|
330 | } |
||
331 | 312 | fernando | |
332 | 1074 | vcaballero | /**
|
333 | * This method initializes cbEscala
|
||
334 | *
|
||
335 | * @return javax.swing.JComboBox
|
||
336 | */
|
||
337 | private javax.swing.JComboBox getCbEscala() {
|
||
338 | if (cbEscala == null) { |
||
339 | //String[] s={"n?merico","barra1","barra2","barra3","barra4"};
|
||
340 | cbEscala = new javax.swing.JComboBox();
|
||
341 | images[0] = inumero;
|
||
342 | images[1] = ibarra1;
|
||
343 | images[2] = ibarra2;
|
||
344 | images[3] = ibarra3;
|
||
345 | 312 | fernando | |
346 | 1074 | vcaballero | /* Image img=img = new BufferedImage(100, 25,
|
347 | BufferedImage.TYPE_INT_ARGB);
|
||
348 | img.getGraphics().drawImage(images[3].getImage(),0,0,null);
|
||
349 | img.getGraphics().setXORMode(Color.yellow);
|
||
350 | images[3]=new ImageIcon(img);
|
||
351 | */
|
||
352 | ComboBoxRenderer renderer = new ComboBoxRenderer();
|
||
353 | renderer.setPreferredSize(new Dimension(100, 25)); |
||
354 | cbEscala.setRenderer(renderer); |
||
355 | cbEscala.setMaximumRowCount(4);
|
||
356 | 312 | fernando | |
357 | 1074 | vcaballero | cbEscala.addItem("0");
|
358 | cbEscala.addItem("1");
|
||
359 | cbEscala.addItem("2");
|
||
360 | cbEscala.addItem("3");
|
||
361 | cbEscala.setSelectedIndex(fframescalebar.getStyle()); |
||
362 | cbEscala.setPreferredSize(new java.awt.Dimension(200, 20)); |
||
363 | cbEscala.addActionListener(new java.awt.event.ActionListener() {
|
||
364 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
365 | fframescalebar.setStyle(getCbEscala().getSelectedIndex()); |
||
366 | 312 | fernando | |
367 | 1074 | vcaballero | if (cbEscala.getSelectedIndex() == 0) { |
368 | getChbMantenerIntervalo().setEnabled(false);
|
||
369 | getChbMostrarUnidades().setEnabled(false);
|
||
370 | getChbSobreUnidades().setEnabled(false);
|
||
371 | getCbUnidades().setEnabled(false);
|
||
372 | getChbEtiquetas().setEnabled(false);
|
||
373 | getBBarraColor().setEnabled(false);
|
||
374 | getLIntervalo().setEnabled(false);
|
||
375 | getTIntervalo().setEnabled(false);
|
||
376 | getLNumIntervalos().setEnabled(false);
|
||
377 | getTNumIntervalos().setEnabled(false);
|
||
378 | getLDivIzquierda().setEnabled(false);
|
||
379 | getTDivIzquierda().setEnabled(false);
|
||
380 | } else {
|
||
381 | getChbMantenerIntervalo().setEnabled(true);
|
||
382 | getChbMostrarUnidades().setEnabled(true);
|
||
383 | getChbSobreUnidades().setEnabled(true);
|
||
384 | getCbUnidades().setEnabled(true);
|
||
385 | getChbEtiquetas().setEnabled(true);
|
||
386 | getBBarraColor().setEnabled(true);
|
||
387 | getLIntervalo().setEnabled(true);
|
||
388 | getTIntervalo().setEnabled(true);
|
||
389 | getLNumIntervalos().setEnabled(true);
|
||
390 | getTNumIntervalos().setEnabled(true);
|
||
391 | getLDivIzquierda().setEnabled(true);
|
||
392 | getTDivIzquierda().setEnabled(true);
|
||
393 | } |
||
394 | } |
||
395 | }); |
||
396 | } |
||
397 | 312 | fernando | |
398 | 1074 | vcaballero | return cbEscala;
|
399 | } |
||
400 | 312 | fernando | |
401 | 1074 | vcaballero | /**
|
402 | * This method initializes cbUnidades
|
||
403 | *
|
||
404 | * @return javax.swing.JComboBox
|
||
405 | */
|
||
406 | private javax.swing.JComboBox getCbUnidades() {
|
||
407 | if (cbUnidades == null) { |
||
408 | //String[] s={"Kil?metros","metros","cent?metros","mil?metros","millas","yardas","pies","pulgadas"};
|
||
409 | cbUnidades = new javax.swing.JComboBox(Attributes.NAMES); |
||
410 | cbUnidades.setSelectedIndex(fframescalebar.getUnits()); |
||
411 | cbUnidades.setPreferredSize(new java.awt.Dimension(150, 20)); |
||
412 | cbUnidades.addActionListener(new java.awt.event.ActionListener() {
|
||
413 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
414 | fframescalebar.setUnits(getCbUnidades() |
||
415 | .getSelectedIndex()); |
||
416 | 3374 | caballero | getTIntervalo().setText(fframescalebar.obtainInterval()); |
417 | 1074 | vcaballero | } |
418 | }); |
||
419 | } |
||
420 | 312 | fernando | |
421 | 1074 | vcaballero | return cbUnidades;
|
422 | } |
||
423 | 312 | fernando | |
424 | 1074 | vcaballero | /**
|
425 | * This method initializes lIntervalo
|
||
426 | *
|
||
427 | * @return javax.swing.JLabel
|
||
428 | */
|
||
429 | private javax.swing.JLabel getLIntervalo() {
|
||
430 | if (lIntervalo == null) { |
||
431 | lIntervalo = new javax.swing.JLabel();
|
||
432 | lIntervalo.setText(PluginServices.getText(this, "Intervalo")); |
||
433 | 7634 | caballero | lIntervalo.setPreferredSize(new java.awt.Dimension(155,20)); |
434 | 1074 | vcaballero | } |
435 | 312 | fernando | |
436 | 1074 | vcaballero | return lIntervalo;
|
437 | } |
||
438 | 312 | fernando | |
439 | 1074 | vcaballero | /**
|
440 | * This method initializes tIntervalo
|
||
441 | *
|
||
442 | * @return javax.swing.JTextField
|
||
443 | */
|
||
444 | private javax.swing.JTextField getTIntervalo() {
|
||
445 | if (tIntervalo == null) { |
||
446 | tIntervalo = new javax.swing.JTextField();
|
||
447 | 7634 | caballero | tIntervalo.setPreferredSize(new java.awt.Dimension(80,20)); |
448 | 3374 | caballero | tIntervalo.setText(fframescalebar.getInterval()); |
449 | 1074 | vcaballero | tIntervalo.addKeyListener(new java.awt.event.KeyAdapter() {
|
450 | public void keyReleased(java.awt.event.KeyEvent e) { |
||
451 | if (!tIntervalo.getText().toString().equals("")) { |
||
452 | 3290 | caballero | fframescalebar.setInterval(Double.parseDouble(
|
453 | 1074 | vcaballero | tIntervalo.getText().toString())); |
454 | getTNumIntervalos().setText(String.valueOf(
|
||
455 | fframescalebar.getNumInterval())); |
||
456 | } |
||
457 | } |
||
458 | }); |
||
459 | } |
||
460 | 312 | fernando | |
461 | 1074 | vcaballero | return tIntervalo;
|
462 | } |
||
463 | 312 | fernando | |
464 | 1074 | vcaballero | /**
|
465 | * This method initializes lNumIntervalos
|
||
466 | *
|
||
467 | * @return javax.swing.JLabel
|
||
468 | */
|
||
469 | private javax.swing.JLabel getLNumIntervalos() {
|
||
470 | if (lNumIntervalos == null) { |
||
471 | lNumIntervalos = new javax.swing.JLabel();
|
||
472 | 5503 | cesar | lNumIntervalos.setText(PluginServices.getText(this, "Num_intervalos")); |
473 | 7634 | caballero | lNumIntervalos.setPreferredSize(new java.awt.Dimension(155,20)); |
474 | 1074 | vcaballero | } |
475 | 312 | fernando | |
476 | 1074 | vcaballero | return lNumIntervalos;
|
477 | } |
||
478 | 312 | fernando | |
479 | 1074 | vcaballero | /**
|
480 | * This method initializes tNumIntervalos
|
||
481 | *
|
||
482 | * @return javax.swing.JTextField
|
||
483 | */
|
||
484 | private javax.swing.JTextField getTNumIntervalos() {
|
||
485 | if (tNumIntervalos == null) { |
||
486 | tNumIntervalos = new javax.swing.JTextField();
|
||
487 | 7634 | caballero | tNumIntervalos.setPreferredSize(new java.awt.Dimension(80,20)); |
488 | 1074 | vcaballero | tNumIntervalos.setText(Integer.toString(
|
489 | fframescalebar.getNumInterval())); |
||
490 | tNumIntervalos.addKeyListener(new java.awt.event.KeyAdapter() {
|
||
491 | public void keyReleased(java.awt.event.KeyEvent e) { |
||
492 | if (!tNumIntervalos.getText().toString().equals("")) { |
||
493 | fframescalebar.setNumInterval(Integer.parseInt(
|
||
494 | tNumIntervalos.getText().toString())); |
||
495 | 3374 | caballero | getTIntervalo().setText(fframescalebar.obtainInterval()); |
496 | 1074 | vcaballero | } |
497 | } |
||
498 | }); |
||
499 | } |
||
500 | 312 | fernando | |
501 | 1074 | vcaballero | return tNumIntervalos;
|
502 | } |
||
503 | 312 | fernando | |
504 | 1074 | vcaballero | /**
|
505 | * This method initializes lDivIzquierda
|
||
506 | *
|
||
507 | * @return javax.swing.JLabel
|
||
508 | */
|
||
509 | private javax.swing.JLabel getLDivIzquierda() {
|
||
510 | if (lDivIzquierda == null) { |
||
511 | lDivIzquierda = new javax.swing.JLabel();
|
||
512 | lDivIzquierda.setText(PluginServices.getText(this,
|
||
513 | "divisiones_izquierda"));
|
||
514 | 7634 | caballero | lDivIzquierda.setPreferredSize(new java.awt.Dimension(155,20)); |
515 | 1074 | vcaballero | } |
516 | 312 | fernando | |
517 | 1074 | vcaballero | return lDivIzquierda;
|
518 | } |
||
519 | 312 | fernando | |
520 | 1074 | vcaballero | /**
|
521 | * This method initializes tDivIzquierda
|
||
522 | *
|
||
523 | * @return javax.swing.JTextField
|
||
524 | */
|
||
525 | private javax.swing.JTextField getTDivIzquierda() {
|
||
526 | if (tDivIzquierda == null) { |
||
527 | tDivIzquierda = new javax.swing.JTextField();
|
||
528 | 7634 | caballero | tDivIzquierda.setPreferredSize(new java.awt.Dimension(80,20)); |
529 | 1074 | vcaballero | tDivIzquierda.setText(Integer.toString(fframescalebar.getNumLeft()));
|
530 | tDivIzquierda.addKeyListener(new java.awt.event.KeyAdapter() {
|
||
531 | public void keyReleased(java.awt.event.KeyEvent e) { |
||
532 | if (tDivIzquierda.getText().toString().equals("")) { |
||
533 | tDivIzquierda.setText("0");
|
||
534 | } else {
|
||
535 | fframescalebar.setNumLeft(Integer.parseInt(
|
||
536 | tDivIzquierda.getText())); |
||
537 | } |
||
538 | } |
||
539 | }); |
||
540 | } |
||
541 | 312 | fernando | |
542 | 1074 | vcaballero | return tDivIzquierda;
|
543 | } |
||
544 | 312 | fernando | |
545 | 1074 | vcaballero | /**
|
546 | * This method initializes bAceptar
|
||
547 | *
|
||
548 | * @return javax.swing.JButton
|
||
549 | */
|
||
550 | private javax.swing.JButton getBAceptar() {
|
||
551 | if (bAceptar == null) { |
||
552 | bAceptar = new javax.swing.JButton();
|
||
553 | bAceptar.setSize(85, 26); |
||
554 | bAceptar.setText(PluginServices.getText(this, "Aceptar")); |
||
555 | bAceptar.setLocation(106, 347); |
||
556 | bAceptar.setPreferredSize(new java.awt.Dimension(79, 23)); |
||
557 | bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
||
558 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
559 | fframescalebar.setUnits(getCbUnidades() |
||
560 | .getSelectedIndex()); |
||
561 | fframescalebar.setBoundBox(FLayoutUtilities.toSheetRect( |
||
562 | rect, m_layout.getAT())); |
||
563 | 312 | fernando | |
564 | 1074 | vcaballero | fframescalebar.setBarColor(barcolor); |
565 | fframescalebar.setTextColor(textcolor); |
||
566 | fframescalebar.setShowNameUnits(getChbMostrarUnidades() |
||
567 | .isSelected()); |
||
568 | fframescalebar.setShowDescription(getJCheckBox() |
||
569 | .isSelected()); |
||
570 | fframescalebar.setAboveDescription(getChbSobreDescripcion() |
||
571 | .isSelected()); |
||
572 | fframescalebar.setAboveIntervals(getChbEtiquetas() |
||
573 | .isSelected()); |
||
574 | fframescalebar.setAboveName(getChbSobreUnidades() |
||
575 | .isSelected()); |
||
576 | 2305 | vcaballero | fframescalebar.setRotation(getPRotation().getRotation()); |
577 | 3374 | caballero | fframescalebar.setNumDec(Integer.parseInt(getNumDec().getText()));
|
578 | 6880 | cesar | PluginServices.getMDIManager().closeWindow(FFrameScaleBarDialog.this); |
579 | 1074 | vcaballero | m_layout.refresh(); |
580 | isAcepted = true;
|
||
581 | } |
||
582 | }); |
||
583 | } |
||
584 | 312 | fernando | |
585 | 1074 | vcaballero | return bAceptar;
|
586 | } |
||
587 | 312 | fernando | |
588 | 1074 | vcaballero | /**
|
589 | * This method initializes bCancelar
|
||
590 | *
|
||
591 | * @return javax.swing.JButton
|
||
592 | */
|
||
593 | private javax.swing.JButton getBCancelar() {
|
||
594 | if (bCancelar == null) { |
||
595 | bCancelar = new javax.swing.JButton();
|
||
596 | bCancelar.setSize(85, 26); |
||
597 | bCancelar.setText(PluginServices.getText(this, "Cancelar")); |
||
598 | bCancelar.setLocation(297, 347); |
||
599 | bCancelar.setPreferredSize(new java.awt.Dimension(85, 23)); |
||
600 | bCancelar.addActionListener(new java.awt.event.ActionListener() {
|
||
601 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
602 | 6880 | cesar | PluginServices.getMDIManager().closeWindow(FFrameScaleBarDialog.this); |
603 | 1074 | vcaballero | } |
604 | }); |
||
605 | } |
||
606 | 312 | fernando | |
607 | 1074 | vcaballero | return bCancelar;
|
608 | } |
||
609 | 312 | fernando | |
610 | 1074 | vcaballero | /* (non-Javadoc)
|
611 | * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
||
612 | */
|
||
613 | 6880 | cesar | public WindowInfo getWindowInfo() {
|
614 | WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
||
615 | 1074 | vcaballero | m_viewinfo.setTitle(PluginServices.getText(this,
|
616 | "Propiedades_escala_grafica"));
|
||
617 | 312 | fernando | |
618 | 1074 | vcaballero | return m_viewinfo;
|
619 | } |
||
620 | 312 | fernando | |
621 | 1074 | vcaballero | /**
|
622 | 7634 | caballero | * @see com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
|
623 | 1074 | vcaballero | */
|
624 | public boolean getIsAcepted() { |
||
625 | return isAcepted;
|
||
626 | } |
||
627 | 312 | fernando | |
628 | 399 | vcaballero | /**
|
629 | 6880 | cesar | * @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
630 | 1074 | vcaballero | */
|
631 | public void viewActivated() { |
||
632 | } |
||
633 | |||
634 | /**
|
||
635 | * This method initializes bFuente
|
||
636 | *
|
||
637 | * @return javax.swing.JButton
|
||
638 | */
|
||
639 | private javax.swing.JButton getBFuente() {
|
||
640 | if (bFuente == null) { |
||
641 | bFuente = new javax.swing.JButton();
|
||
642 | bFuente.setText(PluginServices.getText(this, "fuente")); |
||
643 | bFuente.addActionListener(new java.awt.event.ActionListener() {
|
||
644 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
645 | fframescalebar.setFont(FontChooser.showDialog( |
||
646 | PluginServices.getText(this, "seleccion_fuente"), |
||
647 | fframescalebar.getFont())); // fchoser=new FontChooser();
|
||
648 | } |
||
649 | }); |
||
650 | } |
||
651 | |||
652 | return bFuente;
|
||
653 | } |
||
654 | |||
655 | /**
|
||
656 | * This method initializes pMarcoVista
|
||
657 | *
|
||
658 | * @return javax.swing.JPanel
|
||
659 | */
|
||
660 | 399 | vcaballero | private JPanel getPMarcoVista() { |
661 | if (pMarcoVista == null) { |
||
662 | pMarcoVista = new JPanel(); |
||
663 | 7634 | caballero | pMarcoVista.setBounds(7, 9, 263, 86); |
664 | 1074 | vcaballero | pMarcoVista.setBorder(javax.swing.BorderFactory.createTitledBorder( |
665 | 7634 | caballero | null, PluginServices.getText(this,PluginServices.getText(this,"marco_vista")),javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.black)); |
666 | 399 | vcaballero | pMarcoVista.add(getJScrollPane(), null);
|
667 | } |
||
668 | 1074 | vcaballero | |
669 | 399 | vcaballero | return pMarcoVista;
|
670 | } |
||
671 | 1074 | vcaballero | |
672 | 399 | vcaballero | /**
|
673 | 1074 | vcaballero | * This method initializes pDescripcion
|
674 | *
|
||
675 | * @return javax.swing.JPanel
|
||
676 | */
|
||
677 | 399 | vcaballero | private JPanel getPDescripcion() { |
678 | if (pDescripcion == null) { |
||
679 | 7634 | caballero | FlowLayout flowLayout1 = new FlowLayout(); |
680 | flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
||
681 | 399 | vcaballero | pDescripcion = new JPanel(); |
682 | 7634 | caballero | pDescripcion.setLayout(flowLayout1); |
683 | pDescripcion.setBounds(275, 9, 204, 110); |
||
684 | 6693 | caballero | pDescripcion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"Escala"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.black)); |
685 | pDescripcion.add(getTfNumberScale(), null);
|
||
686 | 399 | vcaballero | pDescripcion.add(getJCheckBox(), null);
|
687 | pDescripcion.add(getChbSobreDescripcion(), null);
|
||
688 | } |
||
689 | 1074 | vcaballero | |
690 | 399 | vcaballero | return pDescripcion;
|
691 | } |
||
692 | 1074 | vcaballero | |
693 | 399 | vcaballero | /**
|
694 | 1074 | vcaballero | * This method initializes tfDescripcion
|
695 | *
|
||
696 | * @return javax.swing.JTextField
|
||
697 | */
|
||
698 | 6693 | caballero | private JTextField getTfNumberScale() { |
699 | 399 | vcaballero | if (tfDescripcion == null) { |
700 | tfDescripcion = new JTextField(); |
||
701 | 7634 | caballero | tfDescripcion.setPreferredSize(new java.awt.Dimension(180,20)); |
702 | 1074 | vcaballero | |
703 | 6693 | caballero | tfDescripcion.setEditable(false);
|
704 | 399 | vcaballero | /*if (fframeview!=null){
|
705 | 1074 | vcaballero | getTfDescripcion().setText("escala 1:"+String.valueOf(fframeview.getScale()));
|
706 | }
|
||
707 | */
|
||
708 | 6693 | caballero | tfDescripcion.setText(fframescalebar.getDescription()); |
709 | 399 | vcaballero | } |
710 | 1074 | vcaballero | |
711 | 399 | vcaballero | return tfDescripcion;
|
712 | } |
||
713 | 1074 | vcaballero | |
714 | 399 | vcaballero | /**
|
715 | 1074 | vcaballero | * This method initializes pUnidades
|
716 | *
|
||
717 | * @return javax.swing.JPanel
|
||
718 | */
|
||
719 | 399 | vcaballero | private JPanel getPUnidades() { |
720 | if (pUnidades == null) { |
||
721 | 7634 | caballero | FlowLayout flowLayout = new FlowLayout(); |
722 | flowLayout.setAlignment(java.awt.FlowLayout.LEFT); |
||
723 | 399 | vcaballero | pUnidades = new JPanel(); |
724 | 7634 | caballero | pUnidades.setLayout(flowLayout); |
725 | pUnidades.setLocation(274, 122); |
||
726 | pUnidades.setSize(204, 110); |
||
727 | 1074 | vcaballero | pUnidades.setBorder(javax.swing.BorderFactory.createTitledBorder( |
728 | 7634 | caballero | null, PluginServices.getText(this, "unidades"),javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.black)); |
729 | 399 | vcaballero | pUnidades.add(getCbUnidades(), null);
|
730 | pUnidades.add(getChbMostrarUnidades(), null);
|
||
731 | pUnidades.add(getChbSobreUnidades(), null);
|
||
732 | } |
||
733 | 1074 | vcaballero | |
734 | 399 | vcaballero | return pUnidades;
|
735 | } |
||
736 | 1074 | vcaballero | |
737 | 399 | vcaballero | /**
|
738 | 1074 | vcaballero | * This method initializes chbSobreDescripcion
|
739 | *
|
||
740 | * @return javax.swing.JCheckBox
|
||
741 | */
|
||
742 | 399 | vcaballero | private JCheckBox getChbSobreDescripcion() { |
743 | if (chbSobreDescripcion == null) { |
||
744 | chbSobreDescripcion = new JCheckBox(); |
||
745 | chbSobreDescripcion.setSelected(fframescalebar.isAboveDescription()); |
||
746 | 7634 | caballero | chbSobreDescripcion.setPreferredSize(new java.awt.Dimension(180,24)); |
747 | 2560 | caballero | chbSobreDescripcion.setText(PluginServices.getText(this,"sobre_la_barra")); |
748 | 399 | vcaballero | } |
749 | 1074 | vcaballero | |
750 | 399 | vcaballero | return chbSobreDescripcion;
|
751 | } |
||
752 | 1074 | vcaballero | |
753 | 399 | vcaballero | /**
|
754 | 1074 | vcaballero | * This method initializes chbMostrarUnidades
|
755 | *
|
||
756 | * @return javax.swing.JCheckBox
|
||
757 | */
|
||
758 | 399 | vcaballero | private JCheckBox getChbMostrarUnidades() { |
759 | if (chbMostrarUnidades == null) { |
||
760 | chbMostrarUnidades = new JCheckBox(); |
||
761 | 2560 | caballero | chbMostrarUnidades.setText(PluginServices.getText(this,"mostrar_unidades")); |
762 | 399 | vcaballero | chbMostrarUnidades.setSelected(fframescalebar.isShowNameUnits()); |
763 | 1074 | vcaballero | chbMostrarUnidades.setPreferredSize(new java.awt.Dimension(150, 24)); |
764 | 399 | vcaballero | } |
765 | 1074 | vcaballero | |
766 | 399 | vcaballero | return chbMostrarUnidades;
|
767 | } |
||
768 | 1074 | vcaballero | |
769 | 399 | vcaballero | /**
|
770 | 1074 | vcaballero | * This method initializes chbSobreUnidades
|
771 | *
|
||
772 | * @return javax.swing.JCheckBox
|
||
773 | */
|
||
774 | 399 | vcaballero | private JCheckBox getChbSobreUnidades() { |
775 | if (chbSobreUnidades == null) { |
||
776 | chbSobreUnidades = new JCheckBox(); |
||
777 | chbSobreUnidades.setSelected(fframescalebar.isAboveName()); |
||
778 | 2560 | caballero | chbSobreUnidades.setText(PluginServices.getText(this,"sobre_la_barra")); |
779 | 1074 | vcaballero | chbSobreUnidades.setPreferredSize(new java.awt.Dimension(150, 24)); |
780 | 399 | vcaballero | } |
781 | 1074 | vcaballero | |
782 | 399 | vcaballero | return chbSobreUnidades;
|
783 | } |
||
784 | 1074 | vcaballero | |
785 | 399 | vcaballero | /**
|
786 | 1074 | vcaballero | * This method initializes pEtiquetas
|
787 | *
|
||
788 | * @return javax.swing.JPanel
|
||
789 | */
|
||
790 | 399 | vcaballero | private JPanel getPEtiquetas() { |
791 | if (pEtiquetas == null) { |
||
792 | 7634 | caballero | FlowLayout flowLayout2 = new FlowLayout(); |
793 | flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
||
794 | 399 | vcaballero | pEtiquetas = new JPanel(); |
795 | 7634 | caballero | pEtiquetas.setLayout(flowLayout2); |
796 | 1074 | vcaballero | pEtiquetas.setBorder(javax.swing.BorderFactory.createTitledBorder( |
797 | 7634 | caballero | null, PluginServices.getText(this, "etiquetas"),javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.black)); |
798 | pEtiquetas.setBounds(276, 235, 204, 104); |
||
799 | 399 | vcaballero | pEtiquetas.add(getChbEtiquetas(), null);
|
800 | pEtiquetas.add(getJPanel2(), null);
|
||
801 | } |
||
802 | 1074 | vcaballero | |
803 | 399 | vcaballero | return pEtiquetas;
|
804 | } |
||
805 | 1074 | vcaballero | |
806 | 399 | vcaballero | /**
|
807 | 1074 | vcaballero | * This method initializes chbEtiquetas
|
808 | *
|
||
809 | * @return javax.swing.JCheckBox
|
||
810 | */
|
||
811 | 399 | vcaballero | private JCheckBox getChbEtiquetas() { |
812 | if (chbEtiquetas == null) { |
||
813 | chbEtiquetas = new JCheckBox(); |
||
814 | chbEtiquetas.setSelected(fframescalebar.isAboveIntervals()); |
||
815 | 2580 | caballero | chbEtiquetas.setText(PluginServices.getText(this,"sobre_la_barra")); |
816 | 399 | vcaballero | } |
817 | 1074 | vcaballero | |
818 | 399 | vcaballero | return chbEtiquetas;
|
819 | } |
||
820 | 1074 | vcaballero | |
821 | 399 | vcaballero | /**
|
822 | 1074 | vcaballero | * This method initializes pBarra
|
823 | *
|
||
824 | * @return javax.swing.JPanel
|
||
825 | */
|
||
826 | 399 | vcaballero | private JPanel getPBarra() { |
827 | if (pBarra == null) { |
||
828 | 7634 | caballero | FlowLayout flowLayout3 = new FlowLayout(); |
829 | flowLayout3.setAlignment(java.awt.FlowLayout.LEFT); |
||
830 | 3374 | caballero | lblNumDec = new JLabel(); |
831 | 7634 | caballero | lblNumDec.setText(PluginServices.getText(this,"numero_decimales_mostrar")); |
832 | 2592 | caballero | lblBarColor = new JLabel(); |
833 | lblBarColor.setText(PluginServices.getText(this,"color")); |
||
834 | 399 | vcaballero | pBarra = new JPanel(); |
835 | 7634 | caballero | pBarra.setLayout(flowLayout3); |
836 | 7636 | caballero | pBarra.setBounds(8, 98, 263, 241); |
837 | 1074 | vcaballero | pBarra.setBorder(javax.swing.BorderFactory.createTitledBorder( |
838 | 7634 | caballero | null, PluginServices.getText(this,"barra"),javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.black)); |
839 | 3469 | caballero | pBarra.add(getChbMantenerIntervalo(), null);
|
840 | 399 | vcaballero | pBarra.add(getCbEscala(), null);
|
841 | 3374 | caballero | pBarra.add(lblNumDec, null);
|
842 | pBarra.add(getNumDec(), null);
|
||
843 | pBarra.add(getJPanel5(), null);
|
||
844 | 399 | vcaballero | pBarra.add(getJPanel7(), null);
|
845 | pBarra.add(getJPanel6(), null);
|
||
846 | 2592 | caballero | pBarra.add(lblBarColor, null);
|
847 | 399 | vcaballero | pBarra.add(getBBarraColor(), null);
|
848 | } |
||
849 | 1074 | vcaballero | |
850 | 399 | vcaballero | return pBarra;
|
851 | } |
||
852 | 1074 | vcaballero | |
853 | 399 | vcaballero | /**
|
854 | 1074 | vcaballero | * This method initializes jPanel5
|
855 | *
|
||
856 | * @return javax.swing.JPanel
|
||
857 | */
|
||
858 | 399 | vcaballero | private JPanel getJPanel5() { |
859 | if (jPanel5 == null) { |
||
860 | jPanel5 = new JPanel(); |
||
861 | 7634 | caballero | jPanel5.setPreferredSize(new java.awt.Dimension(245,30)); |
862 | 399 | vcaballero | jPanel5.add(getLIntervalo(), null);
|
863 | jPanel5.add(getTIntervalo(), null);
|
||
864 | } |
||
865 | 1074 | vcaballero | |
866 | 399 | vcaballero | return jPanel5;
|
867 | } |
||
868 | 1074 | vcaballero | |
869 | 399 | vcaballero | /**
|
870 | 1074 | vcaballero | * This method initializes jPanel6
|
871 | *
|
||
872 | * @return javax.swing.JPanel
|
||
873 | */
|
||
874 | 399 | vcaballero | private JPanel getJPanel6() { |
875 | if (jPanel6 == null) { |
||
876 | jPanel6 = new JPanel(); |
||
877 | 7634 | caballero | jPanel6.setPreferredSize(new java.awt.Dimension(245,30)); |
878 | 399 | vcaballero | jPanel6.add(getLDivIzquierda(), null);
|
879 | jPanel6.add(getTDivIzquierda(), null);
|
||
880 | } |
||
881 | 1074 | vcaballero | |
882 | 399 | vcaballero | return jPanel6;
|
883 | } |
||
884 | 1074 | vcaballero | |
885 | 399 | vcaballero | /**
|
886 | 1074 | vcaballero | * This method initializes jPanel7
|
887 | *
|
||
888 | * @return javax.swing.JPanel
|
||
889 | */
|
||
890 | 399 | vcaballero | private JPanel getJPanel7() { |
891 | if (jPanel7 == null) { |
||
892 | jPanel7 = new JPanel(); |
||
893 | 7634 | caballero | jPanel7.setPreferredSize(new java.awt.Dimension(245,30)); |
894 | 399 | vcaballero | jPanel7.add(getLNumIntervalos(), null);
|
895 | jPanel7.add(getTNumIntervalos(), null);
|
||
896 | } |
||
897 | 1074 | vcaballero | |
898 | 399 | vcaballero | return jPanel7;
|
899 | } |
||
900 | 1074 | vcaballero | |
901 | 399 | vcaballero | /**
|
902 | 1074 | vcaballero | * This method initializes bUnidadesColor
|
903 | *
|
||
904 | * @return javax.swing.JButton
|
||
905 | */
|
||
906 | 6806 | fjp | private ColorChooserPanel getBUnidadesColor() {
|
907 | 399 | vcaballero | if (bUnidadesColor == null) { |
908 | 6806 | fjp | bUnidadesColor = new ColorChooserPanel();
|
909 | bUnidadesColor.setAlpha(255);
|
||
910 | bUnidadesColor.setColor(textcolor); |
||
911 | bUnidadesColor.setPreferredSize(new java.awt.Dimension(100,25)); |
||
912 | 1074 | vcaballero | bUnidadesColor.addActionListener(new java.awt.event.ActionListener() {
|
913 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
914 | 6806 | fjp | textcolor = getBUnidadesColor().getColor(); |
915 | 1074 | vcaballero | } |
916 | }); |
||
917 | 399 | vcaballero | } |
918 | 1074 | vcaballero | |
919 | 399 | vcaballero | return bUnidadesColor;
|
920 | } |
||
921 | 1074 | vcaballero | |
922 | 399 | vcaballero | /**
|
923 | 1074 | vcaballero | * This method initializes bBarraColor
|
924 | *
|
||
925 | * @return javax.swing.JButton
|
||
926 | */
|
||
927 | 6806 | fjp | private ColorChooserPanel getBBarraColor() {
|
928 | 399 | vcaballero | if (bBarraColor == null) { |
929 | 6806 | fjp | bBarraColor = new ColorChooserPanel();
|
930 | bBarraColor.setPreferredSize(new java.awt.Dimension(100,25)); |
||
931 | bBarraColor.setAlpha(255);
|
||
932 | bBarraColor.setColor(barcolor); |
||
933 | 1074 | vcaballero | bBarraColor.addActionListener(new java.awt.event.ActionListener() {
|
934 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
935 | 6806 | fjp | // JDialog dlg;
|
936 | // JColorChooser colorChooser;
|
||
937 | // colorChooser = new JColorChooser();
|
||
938 | // dlg = JColorChooser.createDialog((JFrame) null,
|
||
939 | // PluginServices.getText(this, "Elegir_Color"),
|
||
940 | // true, colorChooser, null, null);
|
||
941 | // dlg.show(true);
|
||
942 | //
|
||
943 | barcolor = getBBarraColor().getColor(); |
||
944 | 1074 | vcaballero | |
945 | 6806 | fjp | // bBarraColor.setBackground(barcolor);
|
946 | // bBarraColor.setForeground(barcolor);
|
||
947 | 1074 | vcaballero | } |
948 | }); |
||
949 | 399 | vcaballero | } |
950 | 1074 | vcaballero | |
951 | 399 | vcaballero | return bBarraColor;
|
952 | } |
||
953 | 1074 | vcaballero | |
954 | 399 | vcaballero | /**
|
955 | 1074 | vcaballero | * This method initializes jPanel
|
956 | *
|
||
957 | * @return javax.swing.JPanel
|
||
958 | */
|
||
959 | |||
960 | 399 | vcaballero | /*private JPanel getJPanel() {
|
961 | 1074 | vcaballero | if (jPanel == null) {
|
962 | jPanel = new JPanel();
|
||
963 | jPanel.setPreferredSize(new java.awt.Dimension(44,24));
|
||
964 | jPanel.setForeground(barcolor);
|
||
965 | jPanel.setBackground(barcolor);
|
||
966 | }
|
||
967 | return jPanel;
|
||
968 | }
|
||
969 | */
|
||
970 | |||
971 | 399 | vcaballero | /**
|
972 | 1074 | vcaballero | * This method initializes jPanel1
|
973 | *
|
||
974 | * @return javax.swing.JPanel
|
||
975 | */
|
||
976 | |||
977 | /* private JPanel getJPanel1() {
|
||
978 | if (jPanel1 == null) {
|
||
979 | jPanel1 = new JPanel();
|
||
980 | jPanel1.setBackground(textcolor);
|
||
981 | jPanel1.setPreferredSize(new java.awt.Dimension(44,24));
|
||
982 | }
|
||
983 | return jPanel1;
|
||
984 | }
|
||
985 | */
|
||
986 | |||
987 | 399 | vcaballero | /**
|
988 | 1074 | vcaballero | * This method initializes jPanel2
|
989 | *
|
||
990 | * @return javax.swing.JPanel
|
||
991 | */
|
||
992 | 399 | vcaballero | private JPanel getJPanel2() { |
993 | if (jPanel2 == null) { |
||
994 | jPanel2 = new JPanel(); |
||
995 | jPanel2.add(getBFuente(), null);
|
||
996 | jPanel2.add(getBUnidadesColor(), null);
|
||
997 | 1074 | vcaballero | |
998 | 399 | vcaballero | //jPanel2.add(getJPanel1(), null);
|
999 | } |
||
1000 | 1074 | vcaballero | |
1001 | 399 | vcaballero | return jPanel2;
|
1002 | } |
||
1003 | 1074 | vcaballero | |
1004 | 399 | vcaballero | /**
|
1005 | 1074 | vcaballero | * This method initializes jCheckBox
|
1006 | *
|
||
1007 | * @return javax.swing.JCheckBox
|
||
1008 | */
|
||
1009 | 399 | vcaballero | private JCheckBox getJCheckBox() { |
1010 | if (jCheckBox == null) { |
||
1011 | jCheckBox = new JCheckBox(); |
||
1012 | jCheckBox.setSelected(fframescalebar.isShowDescription()); |
||
1013 | 7634 | caballero | jCheckBox.setPreferredSize(new java.awt.Dimension(180,24)); |
1014 | 6693 | caballero | jCheckBox.setText(PluginServices.getText(this,"mostrar_escala_numerica")); |
1015 | 399 | vcaballero | } |
1016 | 1074 | vcaballero | |
1017 | 399 | vcaballero | return jCheckBox;
|
1018 | } |
||
1019 | 1074 | vcaballero | |
1020 | /**
|
||
1021 | * DOCUMENT ME!
|
||
1022 | *
|
||
1023 | * @author Vicente Caballero Navarro
|
||
1024 | */
|
||
1025 | class ComboBoxRenderer extends JLabel implements ListCellRenderer { |
||
1026 | /**
|
||
1027 | * Crea un nuevo ComboBoxRenderer.
|
||
1028 | */
|
||
1029 | public ComboBoxRenderer() {
|
||
1030 | setOpaque(true);
|
||
1031 | setHorizontalAlignment(CENTER); |
||
1032 | setVerticalAlignment(CENTER); |
||
1033 | } |
||
1034 | |||
1035 | /*
|
||
1036 | * This method finds the image and text corresponding
|
||
1037 | * to the selected value and returns the label, set up
|
||
1038 | * to display the text and image.
|
||
1039 | */
|
||
1040 | public Component getListCellRendererComponent(JList list, Object value, |
||
1041 | int index, boolean isSelected, boolean cellHasFocus) { |
||
1042 | //Get the selected index. (The index param isn't
|
||
1043 | //always valid, so just use the value.)
|
||
1044 | ///int selectedIndex = ((Integer)value).intValue();
|
||
1045 | if (isSelected) {
|
||
1046 | setBackground(list.getSelectionBackground()); |
||
1047 | setForeground(list.getSelectionForeground()); |
||
1048 | } else {
|
||
1049 | setBackground(list.getBackground()); |
||
1050 | setForeground(list.getForeground()); |
||
1051 | } |
||
1052 | |||
1053 | ImageIcon icon = images[Integer.parseInt((String) value)]; |
||
1054 | setIcon(icon); |
||
1055 | |||
1056 | return this; |
||
1057 | } |
||
1058 | } |
||
1059 | 2305 | vcaballero | |
1060 | /**
|
||
1061 | 4778 | caballero | * This method initializes pRotation
|
1062 | *
|
||
1063 | * @return javax.swing.JPanel
|
||
1064 | */
|
||
1065 | 2305 | vcaballero | private JPRotation getPRotation() {
|
1066 | if (pRotation == null) { |
||
1067 | pRotation = new JPRotation();
|
||
1068 | pRotation.setBounds(480, 10, 120, 120); |
||
1069 | } |
||
1070 | return pRotation;
|
||
1071 | } |
||
1072 | 3374 | caballero | |
1073 | /**
|
||
1074 | 4778 | caballero | * This method initializes numDec
|
1075 | *
|
||
1076 | * @return javax.swing.JTextField
|
||
1077 | 3374 | caballero | */
|
1078 | private JTextField getNumDec() { |
||
1079 | if (txtNumDec == null) { |
||
1080 | txtNumDec = new JTextField(); |
||
1081 | txtNumDec.setPreferredSize(new java.awt.Dimension(30,20)); |
||
1082 | txtNumDec.setText(String.valueOf(fframescalebar.getNumDec()));
|
||
1083 | txtNumDec.addKeyListener(new java.awt.event.KeyAdapter() {
|
||
1084 | public void keyReleased(KeyEvent arg0) { |
||
1085 | super.keyReleased(arg0);
|
||
1086 | if (!getNumDec().getText().toString().equals("")) { |
||
1087 | fframescalebar.setNumDec(Integer.parseInt(
|
||
1088 | getNumDec().getText().toString())); |
||
1089 | getTIntervalo().setText(fframescalebar.obtainInterval()); |
||
1090 | } |
||
1091 | } |
||
1092 | }); |
||
1093 | } |
||
1094 | return txtNumDec;
|
||
1095 | } |
||
1096 | 1074 | vcaballero | } // @jve:decl-index=0:visual-constraint="17,10"
|
1097 | // @jve:visual-info decl-index=0 visual-constraint="10,10" |