Revision 1074 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameScaleBarDialog.java

View differences:

FFrameScaleBarDialog.java
1 1
/*
2 2
 * Created on 02-jun-2004
3 3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6 4
 */
7 5
package com.iver.cit.gvsig.gui.layout.fframes.dialogs;
8 6

  
7
import com.iver.andami.PluginServices;
8
import com.iver.andami.ui.mdiManager.ViewInfo;
9

  
10
import com.iver.cit.gvsig.Abrir;
11
import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
12
import com.iver.cit.gvsig.gui.layout.Attributes;
13
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
14
import com.iver.cit.gvsig.gui.layout.Layout;
15
import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
16
import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
17
import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
18
import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel;
19

  
9 20
import java.awt.Color;
10 21
import java.awt.Component;
11 22
import java.awt.Dimension;
12 23
import java.awt.geom.Rectangle2D;
13
import java.util.ArrayList;
14 24

  
15 25
import javax.swing.ImageIcon;
16 26
import javax.swing.JButton;
......
24 34
import javax.swing.JTextField;
25 35
import javax.swing.ListCellRenderer;
26 36

  
27
import com.iver.andami.PluginServices;
28
import com.iver.andami.Utilities;
29
import com.iver.andami.ui.mdiManager.ViewInfo;
30
import com.iver.cit.gvsig.Abrir;
31
import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
32
import com.iver.cit.gvsig.gui.layout.Attributes;
33
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
34
import com.iver.cit.gvsig.gui.layout.Layout;
35
import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
36
import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
37
import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
38
import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel;
37

  
39 38
/**
40 39
 * Dialogo para a?adir una barra de escala al Layout.
41 40
 *
42 41
 * @author Vicente Caballero Navarro
43 42
 */
44 43
public class FFrameScaleBarDialog extends JPanel implements IFFrameDialog {
45
    private static final ImageIcon inumero = new ImageIcon(Abrir.class.getClassLoader()
46
                                                                      .getResource("images/numero.png"));
47
    private static final ImageIcon ibarra1 = new ImageIcon(Abrir.class.getClassLoader()
48
                                                                      .getResource("images/barra1.png"));
49
    private static final ImageIcon ibarra2 = new ImageIcon(Abrir.class.getClassLoader()
50
                                                                      .getResource("images/barra2.png"));
51
    private static final ImageIcon ibarra3 = new ImageIcon(Abrir.class.getClassLoader()
52
                                                                      .getResource("images/barra3.png"));
53
    private javax.swing.JPanel jContentPane = null;
54
    private javax.swing.JScrollPane jScrollPane = null;
55
    private javax.swing.JList liVistas = null;
56
    private javax.swing.JCheckBox chbMantenerIntervalo = null;
57
    private javax.swing.JComboBox cbEscala = null;
58
    private javax.swing.JComboBox cbUnidades = null;
59
    private javax.swing.JLabel lIntervalo = null;
60
    private javax.swing.JTextField tIntervalo = null;
61
    private javax.swing.JLabel lNumIntervalos = null;
62
    private javax.swing.JTextField tNumIntervalos = null;
63
    private javax.swing.JLabel lDivIzquierda = null;
64
    private javax.swing.JTextField tDivIzquierda = null;
65
    private javax.swing.JButton bAceptar = null;
66
    private javax.swing.JButton bCancelar = null;
44
	private static final ImageIcon inumero = new ImageIcon(Abrir.class.getClassLoader()
45
																	  .getResource("images/numero.png"));
46
	private static final ImageIcon ibarra1 = new ImageIcon(Abrir.class.getClassLoader()
47
																	  .getResource("images/barra1.png"));
48
	private static final ImageIcon ibarra2 = new ImageIcon(Abrir.class.getClassLoader()
49
																	  .getResource("images/barra2.png"));
50
	private static final ImageIcon ibarra3 = new ImageIcon(Abrir.class.getClassLoader()
51
																	  .getResource("images/barra3.png"));
52
	private javax.swing.JPanel jContentPane = null;
53
	private javax.swing.JScrollPane jScrollPane = null;
54
	private javax.swing.JList liVistas = null;
55
	private javax.swing.JCheckBox chbMantenerIntervalo = null;
56
	private javax.swing.JComboBox cbEscala = null;
57
	private javax.swing.JComboBox cbUnidades = null;
58
	private javax.swing.JLabel lIntervalo = null;
59
	private javax.swing.JTextField tIntervalo = null;
60
	private javax.swing.JLabel lNumIntervalos = null;
61
	private javax.swing.JTextField tNumIntervalos = null;
62
	private javax.swing.JLabel lDivIzquierda = null;
63
	private javax.swing.JTextField tDivIzquierda = null;
64
	private javax.swing.JButton bAceptar = null;
65
	private javax.swing.JButton bCancelar = null;
67 66

  
68
    //private ProjectView m_projectView=null;
69
    private FFrameView fframeview = null;
70
    private Rectangle2D rect = new Rectangle2D.Double();
71
    private Layout m_layout = null;
72
    private FFrameScaleBar fframescalebar = null; //new FFrameScaleBar();
73
    private boolean isAcepted = false;
74
    private ImageIcon[] images = new ImageIcon[4];
75
    private javax.swing.JButton bFuente = null;
76
    private JPanel pMarcoVista = null;
67
	//private ProjectView m_projectView=null;
68
	private FFrameView fframeview = null;
69
	private Rectangle2D rect = new Rectangle2D.Double();
70
	private Layout m_layout = null;
71
	private FFrameScaleBar fframescalebar = null; //new FFrameScaleBar();
72
	private boolean isAcepted = false;
73
	private ImageIcon[] images = new ImageIcon[4];
74
	private javax.swing.JButton bFuente = null;
75
	private JPanel pMarcoVista = null;
77 76
	private JPanel pDescripcion = null;
78 77
	private JTextField tfDescripcion = null;
79 78
	private JPanel pUnidades = null;
......
88 87
	private JPanel jPanel7 = null;
89 88
	private JButton bUnidadesColor = null;
90 89
	private JButton bBarraColor = null;
91
	private Color barcolor=null;
92
	private Color textcolor=null;
90
	private Color barcolor = null;
91
	private Color textcolor = null;
92

  
93 93
	//private JPanel jPanel = null;
94 94
	//private JPanel jPanel1 = null;
95 95
	private JPanel jPanel2 = null;
96 96
	private JCheckBox jCheckBox = null;
97
    /**
98
     * This is the default constructor
99
     *
100
     * @param layout DOCUMENT ME!
101
     * @param fframe DOCUMENT ME!
102
     */
103
    public FFrameScaleBarDialog(Layout layout, FFrameScaleBar fframe) {
104
        super();
105
        fframescalebar = fframe;
106
        barcolor=fframescalebar.getBarColor();
107
        textcolor=fframescalebar.getTextColor();
108
        if (fframescalebar.getFFrameView()!=null){
109
        getTfDescripcion().setText("escala 1:"+String.valueOf(fframescalebar.getFFrameView().getScale()));
110
        }
111
        m_layout = layout;
112
        initialize();
113
    }
114 97

  
115
    /**
116
     * DOCUMENT ME!
117
     *
118
     * @param r DOCUMENT ME!
119
     */
120
    public void setRectangle(Rectangle2D r) {
121
        rect.setRect(r);
122
    }
98
	/**
99
	 * This is the default constructor
100
	 *
101
	 * @param layout DOCUMENT ME!
102
	 * @param fframe DOCUMENT ME!
103
	 */
104
	public FFrameScaleBarDialog(Layout layout, FFrameScaleBar fframe) {
105
		super();
106
		fframescalebar = fframe;
107
		barcolor = fframescalebar.getBarColor();
108
		textcolor = fframescalebar.getTextColor();
123 109

  
124
    /**
125
     * This method initializes this
126
     */
127
    private void initialize() {
128
        this.setLayout(null);
129
        this.add(getJContentPane(), null);
130
        this.setSize(491, 400);
110
		if (fframescalebar.getFFrameView() != null) {
111
			getTfDescripcion().setText("escala 1:" +
112
				String.valueOf(fframescalebar.getFFrameView().getScale()));
113
		}
131 114

  
132
        if (fframescalebar.getStyle() == 0) {
133
            getChbMantenerIntervalo().setEnabled(false);
134
            ///getLUnidades().setEnabled(false);
135
            getCbUnidades().setEnabled(false);
136
            getChbEtiquetas().setEnabled(false);
137
            getBBarraColor().setEnabled(false);
138
            getChbMostrarUnidades().setEnabled(false);
139
            getChbSobreUnidades().setEnabled(false);
140
            getLIntervalo().setEnabled(false);
141
            getTIntervalo().setEnabled(false);
142
            getLNumIntervalos().setEnabled(false);
143
            getTNumIntervalos().setEnabled(false);
144
            getLDivIzquierda().setEnabled(false);
145
            getTDivIzquierda().setEnabled(false);
146
        }
147
    }
115
		m_layout = layout;
116
		initialize();
117
	}
148 118

  
149
    /**
150
     * This method initializes jContentPane
151
     *
152
     * @return javax.swing.JPanel
153
     */
154
    private javax.swing.JPanel getJContentPane() {
155
        if (jContentPane == null) {
156
            jContentPane = new javax.swing.JPanel();
157
            jContentPane.setLayout(null);
158
            jContentPane.add(getBAceptar(), null);
159
            jContentPane.add(getBCancelar(), null);
160
            jContentPane.setSize(488, 386);
161
            jContentPane.setPreferredSize(new java.awt.Dimension(50, 50));
162
            jContentPane.setLocation(0, 6);
163
            jContentPane.add(getPMarcoVista(), null);
164
            jContentPane.add(getPDescripcion(), null);
165
            jContentPane.add(getPUnidades(), null);
166
            jContentPane.add(getPBarra(), null);
167
            jContentPane.add(getPEtiquetas(), null);
168
        }
119
	/**
120
	 * DOCUMENT ME!
121
	 *
122
	 * @param r DOCUMENT ME!
123
	 */
124
	public void setRectangle(Rectangle2D r) {
125
		rect.setRect(r);
126
	}
169 127

  
170
        return jContentPane;
171
    }
128
	/**
129
	 * This method initializes this
130
	 */
131
	private void initialize() {
132
		this.setLayout(null);
133
		this.add(getJContentPane(), null);
134
		this.setSize(491, 400);
172 135

  
173
    /**
174
     * This method initializes jScrollPane
175
     *
176
     * @return javax.swing.JScrollPane
177
     */
178
    private javax.swing.JScrollPane getJScrollPane() {
179
        if (jScrollPane == null) {
180
            jScrollPane = new javax.swing.JScrollPane();
181
            jScrollPane.setPreferredSize(new java.awt.Dimension(220,50));
182
            jScrollPane.setViewportView(getLiVistas());
183
        }
136
		if (fframescalebar.getStyle() == 0) {
137
			getChbMantenerIntervalo().setEnabled(false);
184 138

  
185
        return jScrollPane;
186
    }
139
			///getLUnidades().setEnabled(false);
140
			getCbUnidades().setEnabled(false);
141
			getChbEtiquetas().setEnabled(false);
142
			getBBarraColor().setEnabled(false);
143
			getChbMostrarUnidades().setEnabled(false);
144
			getChbSobreUnidades().setEnabled(false);
145
			getLIntervalo().setEnabled(false);
146
			getTIntervalo().setEnabled(false);
147
			getLNumIntervalos().setEnabled(false);
148
			getTNumIntervalos().setEnabled(false);
149
			getLDivIzquierda().setEnabled(false);
150
			getTDivIzquierda().setEnabled(false);
151
		}
152
	}
187 153

  
188
    /**
189
     * This method initializes liVistas
190
     *
191
     * @return javax.swing.JList
192
     */
193
    private javax.swing.JList getLiVistas() {
194
        if (liVistas == null) {
195
            ListViewModel listmodel = new ListViewModel();
196
            listmodel.addViewsforScale(m_layout);
154
	/**
155
	 * This method initializes jContentPane
156
	 *
157
	 * @return javax.swing.JPanel
158
	 */
159
	private javax.swing.JPanel getJContentPane() {
160
		if (jContentPane == null) {
161
			jContentPane = new javax.swing.JPanel();
162
			jContentPane.setLayout(null);
163
			jContentPane.add(getBAceptar(), null);
164
			jContentPane.add(getBCancelar(), null);
165
			jContentPane.setSize(488, 386);
166
			jContentPane.setPreferredSize(new java.awt.Dimension(50, 50));
167
			jContentPane.setLocation(0, 6);
168
			jContentPane.add(getPMarcoVista(), null);
169
			jContentPane.add(getPDescripcion(), null);
170
			jContentPane.add(getPUnidades(), null);
171
			jContentPane.add(getPBarra(), null);
172
			jContentPane.add(getPEtiquetas(), null);
173
		}
197 174

  
198
            ArrayList list = listmodel.getViews();
175
		return jContentPane;
176
	}
199 177

  
200
            liVistas = new javax.swing.JList();
178
	/**
179
	 * This method initializes jScrollPane
180
	 *
181
	 * @return javax.swing.JScrollPane
182
	 */
183
	private javax.swing.JScrollPane getJScrollPane() {
184
		if (jScrollPane == null) {
185
			jScrollPane = new javax.swing.JScrollPane();
186
			jScrollPane.setPreferredSize(new java.awt.Dimension(220, 50));
187
			jScrollPane.setViewportView(getLiVistas());
188
		}
201 189

  
202
            liVistas.setModel(listmodel);
190
		return jScrollPane;
191
	}
203 192

  
204
            for (int i = 0; i < liVistas.getModel().getSize(); i++) {
205
                if (fframescalebar.getFFrameView() != null) {
206
                    fframeview = (FFrameView) liVistas.getModel().getElementAt(i);
193
	/**
194
	 * This method initializes liVistas
195
	 *
196
	 * @return javax.swing.JList
197
	 */
198
	private javax.swing.JList getLiVistas() {
199
		if (liVistas == null) {
200
			ListViewModel listmodel = new ListViewModel();
201
			listmodel.addViewsforScale(m_layout);
207 202

  
208
                    if (fframeview == fframescalebar.getFFrameView()) {
209
                        liVistas.setSelectedIndex(i);
210
                    }
211
                }
212
            }
203
			///ArrayList list = listmodel.getViews();
213 204

  
214
            liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
215
                    public void valueChanged(
216
                        javax.swing.event.ListSelectionEvent e) {
217
                        int selectInt = (int) e.getFirstIndex();
218
                        fframeview = (FFrameView) liVistas.getModel().getElementAt(selectInt);
205
			liVistas = new javax.swing.JList();
219 206

  
220
                        for (int i = 0; i < m_layout.getFFrames().size();
221
                                i++) {
222
                            IFFrame f = (IFFrame) m_layout.getFFrames().get(i);
207
			liVistas.setModel(listmodel);
223 208

  
224
                            if (f instanceof FFrameView) {
225
                                if (((FFrameView) f).getView() == fframeview.getView()) {
226
                                    fframescalebar.setFFrameView(fframeview);
227
                                }
228
                            }
229
                        }
209
			for (int i = 0; i < liVistas.getModel().getSize(); i++) {
210
				if (fframescalebar.getFFrameView() != null) {
211
					fframeview = (FFrameView) liVistas.getModel().getElementAt(i);
230 212

  
231
                        getTNumIntervalos().setText(String.valueOf(
232
                                fframescalebar.getNumInterval()));
233
                        getTDivIzquierda().setText(String.valueOf(
234
                                fframescalebar.getNumLeft()));
235
                        getTIntervalo().setText(String.valueOf(
236
                                fframescalebar.obtainInterval()));
237
                        getTfDescripcion().setText(fframescalebar.getDescripcion());
238
                    }
239
                });
240
        }
213
					if (fframeview == fframescalebar.getFFrameView()) {
214
						liVistas.setSelectedIndex(i);
215
					}
216
				}
217
			}
241 218

  
242
        return liVistas;
243
    }
219
			liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
220
					public void valueChanged(
221
						javax.swing.event.ListSelectionEvent e) {
222
						int selectInt = (int) e.getFirstIndex();
223
						fframeview = (FFrameView) liVistas.getModel()
224
														  .getElementAt(selectInt);
244 225

  
245
    /**
246
     * This method initializes chbMantenerIntervalo
247
     *
248
     * @return javax.swing.JCheckBox
249
     */
250
    private javax.swing.JCheckBox getChbMantenerIntervalo() {
251
        if (chbMantenerIntervalo == null) {
252
            chbMantenerIntervalo = new javax.swing.JCheckBox();
253
            chbMantenerIntervalo.setSelected(fframescalebar.isbIntervalSet());
254
            chbMantenerIntervalo.setText(PluginServices.getText(this, "mantener_intervalo"));
255
            chbMantenerIntervalo.setPreferredSize(new java.awt.Dimension(200,20));
256
            chbMantenerIntervalo.addActionListener(new java.awt.event.ActionListener() {
257
                    public void actionPerformed(java.awt.event.ActionEvent e) {
258
                        fframescalebar.setIntervalSet(getChbMantenerIntervalo().isSelected());
259
                    }
260
                });
261
        }
226
						for (int i = 0; i < m_layout.getFFrames().size();
227
								i++) {
228
							IFFrame f = (IFFrame) m_layout.getFFrames().get(i);
262 229

  
263
        return chbMantenerIntervalo;
264
    }
230
							if (f instanceof FFrameView) {
231
								if (((FFrameView) f).getView() == fframeview.getView()) {
232
									fframescalebar.setFFrameView(fframeview);
233
								}
234
							}
235
						}
265 236

  
266
    /**
267
     * This method initializes cbEscala
268
     *
269
     * @return javax.swing.JComboBox
270
     */
271
    private javax.swing.JComboBox getCbEscala() {
272
        if (cbEscala == null) {
273
            //String[] s={"n?merico","barra1","barra2","barra3","barra4"};
274
            cbEscala = new javax.swing.JComboBox();
275
            images[0] = inumero;
276
            images[1] = ibarra1;
277
            images[2] = ibarra2;
278
            images[3] = ibarra3;
279
          /*  Image img=img = new BufferedImage(100, 25,
280
                    BufferedImage.TYPE_INT_ARGB);
281
            img.getGraphics().drawImage(images[3].getImage(),0,0,null);
282
            img.getGraphics().setXORMode(Color.yellow);
283
             images[3]=new ImageIcon(img);          
284
            */
285
            ComboBoxRenderer renderer = new ComboBoxRenderer();
286
            renderer.setPreferredSize(new Dimension(100, 25));
287
            cbEscala.setRenderer(renderer);
288
            cbEscala.setMaximumRowCount(4);
237
						getTNumIntervalos().setText(String.valueOf(
238
								fframescalebar.getNumInterval()));
239
						getTDivIzquierda().setText(String.valueOf(
240
								fframescalebar.getNumLeft()));
241
						getTIntervalo().setText(String.valueOf(
242
								fframescalebar.obtainInterval()));
243
						getTfDescripcion().setText(fframescalebar.getDescripcion());
244
					}
245
				});
246
		}
289 247

  
290
            cbEscala.addItem("0");
291
            cbEscala.addItem("1");
292
            cbEscala.addItem("2");
293
            cbEscala.addItem("3");
294
            cbEscala.setSelectedIndex(fframescalebar.getStyle());
295
            cbEscala.setPreferredSize(new java.awt.Dimension(200, 20));
296
            cbEscala.addActionListener(new java.awt.event.ActionListener() {
297
                    public void actionPerformed(java.awt.event.ActionEvent e) {
298
                        fframescalebar.setStyle(getCbEscala().getSelectedIndex());
248
		return liVistas;
249
	}
299 250

  
300
                        if (cbEscala.getSelectedIndex() == 0) {
301
                            getChbMantenerIntervalo().setEnabled(false);
302
                            getChbMostrarUnidades().setEnabled(false);
303
                            getChbSobreUnidades().setEnabled(false);
304
                            getCbUnidades().setEnabled(false);
305
                            getChbEtiquetas().setEnabled(false);
306
                            getBBarraColor().setEnabled(false);
307
                            getLIntervalo().setEnabled(false);
308
                            getTIntervalo().setEnabled(false);
309
                            getLNumIntervalos().setEnabled(false);
310
                            getTNumIntervalos().setEnabled(false);
311
                            getLDivIzquierda().setEnabled(false);
312
                            getTDivIzquierda().setEnabled(false);
313
                        } else {
314
                            getChbMantenerIntervalo().setEnabled(true);
315
                            getChbMostrarUnidades().setEnabled(true);
316
                            getChbSobreUnidades().setEnabled(true);
317
                            getCbUnidades().setEnabled(true);
318
                            getChbEtiquetas().setEnabled(true);
319
                            getBBarraColor().setEnabled(true);
320
                            getLIntervalo().setEnabled(true);
321
                            getTIntervalo().setEnabled(true);
322
                            getLNumIntervalos().setEnabled(true);
323
                            getTNumIntervalos().setEnabled(true);
324
                            getLDivIzquierda().setEnabled(true);
325
                            getTDivIzquierda().setEnabled(true);
326
                        }
327
                    }
328
                });
329
        }
251
	/**
252
	 * This method initializes chbMantenerIntervalo
253
	 *
254
	 * @return javax.swing.JCheckBox
255
	 */
256
	private javax.swing.JCheckBox getChbMantenerIntervalo() {
257
		if (chbMantenerIntervalo == null) {
258
			chbMantenerIntervalo = new javax.swing.JCheckBox();
259
			chbMantenerIntervalo.setSelected(fframescalebar.isbIntervalSet());
260
			chbMantenerIntervalo.setText(PluginServices.getText(this,
261
					"mantener_intervalo"));
262
			chbMantenerIntervalo.setPreferredSize(new java.awt.Dimension(200, 20));
263
			chbMantenerIntervalo.addActionListener(new java.awt.event.ActionListener() {
264
					public void actionPerformed(java.awt.event.ActionEvent e) {
265
						fframescalebar.setIntervalSet(getChbMantenerIntervalo()
266
														  .isSelected());
267
					}
268
				});
269
		}
330 270

  
331
        return cbEscala;
332
    }
271
		return chbMantenerIntervalo;
272
	}
333 273

  
334
    /**
335
     * This method initializes cbUnidades
336
     *
337
     * @return javax.swing.JComboBox
338
     */
339
    private javax.swing.JComboBox getCbUnidades() {
340
        if (cbUnidades == null) {
341
            //String[] s={"Kil?metros","metros","cent?metros","mil?metros","millas","yardas","pies","pulgadas"};
342
            cbUnidades = new javax.swing.JComboBox(Attributes.NAMES);
343
            cbUnidades.setSelectedIndex(fframescalebar.getUnits());
344
            cbUnidades.setPreferredSize(new java.awt.Dimension(150,20));
345
            cbUnidades.addActionListener(new java.awt.event.ActionListener() {
346
                    public void actionPerformed(java.awt.event.ActionEvent e) {
347
                        fframescalebar.setUnits(getCbUnidades()
348
                                                    .getSelectedIndex());
349
                        getTIntervalo().setText(Long.toString(
350
                                fframescalebar.obtainInterval()));
351
                    }
352
                });
353
        }
274
	/**
275
	 * This method initializes cbEscala
276
	 *
277
	 * @return javax.swing.JComboBox
278
	 */
279
	private javax.swing.JComboBox getCbEscala() {
280
		if (cbEscala == null) {
281
			//String[] s={"n?merico","barra1","barra2","barra3","barra4"};
282
			cbEscala = new javax.swing.JComboBox();
283
			images[0] = inumero;
284
			images[1] = ibarra1;
285
			images[2] = ibarra2;
286
			images[3] = ibarra3;
354 287

  
355
        return cbUnidades;
356
    }
288
			/*  Image img=img = new BufferedImage(100, 25,
289
			   BufferedImage.TYPE_INT_ARGB);
290
			   img.getGraphics().drawImage(images[3].getImage(),0,0,null);
291
			   img.getGraphics().setXORMode(Color.yellow);
292
			    images[3]=new ImageIcon(img);
293
			 */
294
			ComboBoxRenderer renderer = new ComboBoxRenderer();
295
			renderer.setPreferredSize(new Dimension(100, 25));
296
			cbEscala.setRenderer(renderer);
297
			cbEscala.setMaximumRowCount(4);
357 298

  
358
    /**
359
     * This method initializes lIntervalo
360
     *
361
     * @return javax.swing.JLabel
362
     */
363
    private javax.swing.JLabel getLIntervalo() {
364
        if (lIntervalo == null) {
365
            lIntervalo = new javax.swing.JLabel();
366
            lIntervalo.setText(PluginServices.getText(this, "Intervalo"));
367
            lIntervalo.setPreferredSize(new java.awt.Dimension(90,20));
368
        }
299
			cbEscala.addItem("0");
300
			cbEscala.addItem("1");
301
			cbEscala.addItem("2");
302
			cbEscala.addItem("3");
303
			cbEscala.setSelectedIndex(fframescalebar.getStyle());
304
			cbEscala.setPreferredSize(new java.awt.Dimension(200, 20));
305
			cbEscala.addActionListener(new java.awt.event.ActionListener() {
306
					public void actionPerformed(java.awt.event.ActionEvent e) {
307
						fframescalebar.setStyle(getCbEscala().getSelectedIndex());
369 308

  
370
        return lIntervalo;
371
    }
309
						if (cbEscala.getSelectedIndex() == 0) {
310
							getChbMantenerIntervalo().setEnabled(false);
311
							getChbMostrarUnidades().setEnabled(false);
312
							getChbSobreUnidades().setEnabled(false);
313
							getCbUnidades().setEnabled(false);
314
							getChbEtiquetas().setEnabled(false);
315
							getBBarraColor().setEnabled(false);
316
							getLIntervalo().setEnabled(false);
317
							getTIntervalo().setEnabled(false);
318
							getLNumIntervalos().setEnabled(false);
319
							getTNumIntervalos().setEnabled(false);
320
							getLDivIzquierda().setEnabled(false);
321
							getTDivIzquierda().setEnabled(false);
322
						} else {
323
							getChbMantenerIntervalo().setEnabled(true);
324
							getChbMostrarUnidades().setEnabled(true);
325
							getChbSobreUnidades().setEnabled(true);
326
							getCbUnidades().setEnabled(true);
327
							getChbEtiquetas().setEnabled(true);
328
							getBBarraColor().setEnabled(true);
329
							getLIntervalo().setEnabled(true);
330
							getTIntervalo().setEnabled(true);
331
							getLNumIntervalos().setEnabled(true);
332
							getTNumIntervalos().setEnabled(true);
333
							getLDivIzquierda().setEnabled(true);
334
							getTDivIzquierda().setEnabled(true);
335
						}
336
					}
337
				});
338
		}
372 339

  
373
    /**
374
     * This method initializes tIntervalo
375
     *
376
     * @return javax.swing.JTextField
377
     */
378
    private javax.swing.JTextField getTIntervalo() {
379
        if (tIntervalo == null) {
380
            tIntervalo = new javax.swing.JTextField();
381
            tIntervalo.setPreferredSize(new java.awt.Dimension(90,20));
382
            tIntervalo.setText(Long.toString(fframescalebar.getInterval()));
383
            tIntervalo.addKeyListener(new java.awt.event.KeyAdapter() {
384
                    public void keyReleased(java.awt.event.KeyEvent e) {
385
                        if (!tIntervalo.getText().toString().equals("")) {
386
                            fframescalebar.setInterval(Long.parseLong(
387
                                    tIntervalo.getText().toString()));
388
                            getTNumIntervalos().setText(String.valueOf(
389
                                    fframescalebar.getNumInterval()));
390
                        }
391
                    }
392
                });
393
        }
340
		return cbEscala;
341
	}
394 342

  
395
        return tIntervalo;
396
    }
343
	/**
344
	 * This method initializes cbUnidades
345
	 *
346
	 * @return javax.swing.JComboBox
347
	 */
348
	private javax.swing.JComboBox getCbUnidades() {
349
		if (cbUnidades == null) {
350
			//String[] s={"Kil?metros","metros","cent?metros","mil?metros","millas","yardas","pies","pulgadas"};
351
			cbUnidades = new javax.swing.JComboBox(Attributes.NAMES);
352
			cbUnidades.setSelectedIndex(fframescalebar.getUnits());
353
			cbUnidades.setPreferredSize(new java.awt.Dimension(150, 20));
354
			cbUnidades.addActionListener(new java.awt.event.ActionListener() {
355
					public void actionPerformed(java.awt.event.ActionEvent e) {
356
						fframescalebar.setUnits(getCbUnidades()
357
													.getSelectedIndex());
358
						getTIntervalo().setText(Long.toString(
359
								fframescalebar.obtainInterval()));
360
					}
361
				});
362
		}
397 363

  
398
    /**
399
     * This method initializes lNumIntervalos
400
     *
401
     * @return javax.swing.JLabel
402
     */
403
    private javax.swing.JLabel getLNumIntervalos() {
404
        if (lNumIntervalos == null) {
405
            lNumIntervalos = new javax.swing.JLabel();
406
            lNumIntervalos.setText(PluginServices.getText(this, "N?m_intervalos"));
407
            lNumIntervalos.setPreferredSize(new java.awt.Dimension(90,20));
408
        }
364
		return cbUnidades;
365
	}
409 366

  
410
        return lNumIntervalos;
411
    }
367
	/**
368
	 * This method initializes lIntervalo
369
	 *
370
	 * @return javax.swing.JLabel
371
	 */
372
	private javax.swing.JLabel getLIntervalo() {
373
		if (lIntervalo == null) {
374
			lIntervalo = new javax.swing.JLabel();
375
			lIntervalo.setText(PluginServices.getText(this, "Intervalo"));
376
			lIntervalo.setPreferredSize(new java.awt.Dimension(90, 20));
377
		}
412 378

  
413
    /**
414
     * This method initializes tNumIntervalos
415
     *
416
     * @return javax.swing.JTextField
417
     */
418
    private javax.swing.JTextField getTNumIntervalos() {
419
        if (tNumIntervalos == null) {
420
            tNumIntervalos = new javax.swing.JTextField();
421
            tNumIntervalos.setPreferredSize(new java.awt.Dimension(90,20));
422
            tNumIntervalos.setText(Integer.toString(
423
                    fframescalebar.getNumInterval()));
424
            tNumIntervalos.addKeyListener(new java.awt.event.KeyAdapter() {
425
                    public void keyReleased(java.awt.event.KeyEvent e) {
426
                        if (!tNumIntervalos.getText().toString().equals("")) {
427
                            fframescalebar.setNumInterval(Integer.parseInt(
428
                                    tNumIntervalos.getText().toString()));
429
                            getTIntervalo().setText(String.valueOf(
430
                                    fframescalebar.obtainInterval()));
431
                        }
432
                    }
433
                });
434
        }
379
		return lIntervalo;
380
	}
435 381

  
436
        return tNumIntervalos;
437
    }
382
	/**
383
	 * This method initializes tIntervalo
384
	 *
385
	 * @return javax.swing.JTextField
386
	 */
387
	private javax.swing.JTextField getTIntervalo() {
388
		if (tIntervalo == null) {
389
			tIntervalo = new javax.swing.JTextField();
390
			tIntervalo.setPreferredSize(new java.awt.Dimension(90, 20));
391
			tIntervalo.setText(Long.toString(fframescalebar.getInterval()));
392
			tIntervalo.addKeyListener(new java.awt.event.KeyAdapter() {
393
					public void keyReleased(java.awt.event.KeyEvent e) {
394
						if (!tIntervalo.getText().toString().equals("")) {
395
							fframescalebar.setInterval(Long.parseLong(
396
									tIntervalo.getText().toString()));
397
							getTNumIntervalos().setText(String.valueOf(
398
									fframescalebar.getNumInterval()));
399
						}
400
					}
401
				});
402
		}
438 403

  
439
    /**
440
     * This method initializes lDivIzquierda
441
     *
442
     * @return javax.swing.JLabel
443
     */
444
    private javax.swing.JLabel getLDivIzquierda() {
445
        if (lDivIzquierda == null) {
446
            lDivIzquierda = new javax.swing.JLabel();
447
            lDivIzquierda.setText(PluginServices.getText(this, "divisiones_izquierda"));
448
            lDivIzquierda.setPreferredSize(new java.awt.Dimension(90,20));
449
        }
404
		return tIntervalo;
405
	}
450 406

  
451
        return lDivIzquierda;
452
    }
407
	/**
408
	 * This method initializes lNumIntervalos
409
	 *
410
	 * @return javax.swing.JLabel
411
	 */
412
	private javax.swing.JLabel getLNumIntervalos() {
413
		if (lNumIntervalos == null) {
414
			lNumIntervalos = new javax.swing.JLabel();
415
			lNumIntervalos.setText(PluginServices.getText(this, "N?m_intervalos"));
416
			lNumIntervalos.setPreferredSize(new java.awt.Dimension(90, 20));
417
		}
453 418

  
454
    /**
455
     * This method initializes tDivIzquierda
456
     *
457
     * @return javax.swing.JTextField
458
     */
459
    private javax.swing.JTextField getTDivIzquierda() {
460
        if (tDivIzquierda == null) {
461
            tDivIzquierda = new javax.swing.JTextField();
462
            tDivIzquierda.setPreferredSize(new java.awt.Dimension(90,20));
463
            tDivIzquierda.setText(Integer.toString(fframescalebar.getNumLeft()));
464
            tDivIzquierda.addKeyListener(new java.awt.event.KeyAdapter() {
465
                    public void keyReleased(java.awt.event.KeyEvent e) {
466
                        if (tDivIzquierda.getText().toString().equals("")) {
467
                            tDivIzquierda.setText("0");
468
                        } else {
469
                            fframescalebar.setNumLeft(Integer.parseInt(
470
                                    tDivIzquierda.getText()));
471
                        }
472
                    }
473
                });
474
        }
419
		return lNumIntervalos;
420
	}
475 421

  
476
        return tDivIzquierda;
477
    }
422
	/**
423
	 * This method initializes tNumIntervalos
424
	 *
425
	 * @return javax.swing.JTextField
426
	 */
427
	private javax.swing.JTextField getTNumIntervalos() {
428
		if (tNumIntervalos == null) {
429
			tNumIntervalos = new javax.swing.JTextField();
430
			tNumIntervalos.setPreferredSize(new java.awt.Dimension(90, 20));
431
			tNumIntervalos.setText(Integer.toString(
432
					fframescalebar.getNumInterval()));
433
			tNumIntervalos.addKeyListener(new java.awt.event.KeyAdapter() {
434
					public void keyReleased(java.awt.event.KeyEvent e) {
435
						if (!tNumIntervalos.getText().toString().equals("")) {
436
							fframescalebar.setNumInterval(Integer.parseInt(
437
									tNumIntervalos.getText().toString()));
438
							getTIntervalo().setText(String.valueOf(
439
									fframescalebar.obtainInterval()));
440
						}
441
					}
442
				});
443
		}
478 444

  
479
    /**
480
     * This method initializes bAceptar
481
     *
482
     * @return javax.swing.JButton
483
     */
484
    private javax.swing.JButton getBAceptar() {
485
        if (bAceptar == null) {
486
            bAceptar = new javax.swing.JButton();
487
            bAceptar.setSize(85, 26);
488
            bAceptar.setText(PluginServices.getText(this, "Aceptar"));
489
            bAceptar.setLocation(106, 347);
490
            bAceptar.setPreferredSize(new java.awt.Dimension(79, 23));
491
            bAceptar.addActionListener(new java.awt.event.ActionListener() {
492
                    public void actionPerformed(java.awt.event.ActionEvent e) {
493
                        fframescalebar.setUnits(getCbUnidades()
494
                                                    .getSelectedIndex());
495
                        fframescalebar.setBoundBox(FLayoutUtilities.toSheetRect(
496
                                rect, m_layout.getAT()));
445
		return tNumIntervalos;
446
	}
497 447

  
498
                        fframescalebar.setBarColor(barcolor);
499
                        fframescalebar.setTextColor(textcolor);
500
                        fframescalebar.setShowNameUnits(getChbMostrarUnidades().isSelected());
501
                        fframescalebar.setShowDescription(getJCheckBox().isSelected());
502
                        fframescalebar.setAboveDescription(getChbSobreDescripcion().isSelected());
503
                        fframescalebar.setAboveIntervals(getChbEtiquetas().isSelected());
504
                        fframescalebar.setAboveName(getChbSobreUnidades().isSelected());
505
                        fframescalebar.setDescripcion(getTfDescripcion().getText());
506
                        PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
507
                        m_layout.refresh();
508
                        isAcepted = true;
509
                    }
510
                });
511
        }
448
	/**
449
	 * This method initializes lDivIzquierda
450
	 *
451
	 * @return javax.swing.JLabel
452
	 */
453
	private javax.swing.JLabel getLDivIzquierda() {
454
		if (lDivIzquierda == null) {
455
			lDivIzquierda = new javax.swing.JLabel();
456
			lDivIzquierda.setText(PluginServices.getText(this,
457
					"divisiones_izquierda"));
458
			lDivIzquierda.setPreferredSize(new java.awt.Dimension(90, 20));
459
		}
512 460

  
513
        return bAceptar;
514
    }
461
		return lDivIzquierda;
462
	}
515 463

  
516
    /**
517
     * This method initializes bCancelar
518
     *
519
     * @return javax.swing.JButton
520
     */
521
    private javax.swing.JButton getBCancelar() {
522
        if (bCancelar == null) {
523
            bCancelar = new javax.swing.JButton();
524
            bCancelar.setSize(85, 26);
525
            bCancelar.setText(PluginServices.getText(this, "Cancelar"));
526
            bCancelar.setLocation(297, 347);
527
            bCancelar.setPreferredSize(new java.awt.Dimension(85, 23));
528
            bCancelar.addActionListener(new java.awt.event.ActionListener() {
529
                    public void actionPerformed(java.awt.event.ActionEvent e) {
530
                    	PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
531
                    }
532
                });
533
        }
464
	/**
465
	 * This method initializes tDivIzquierda
466
	 *
467
	 * @return javax.swing.JTextField
468
	 */
469
	private javax.swing.JTextField getTDivIzquierda() {
470
		if (tDivIzquierda == null) {
471
			tDivIzquierda = new javax.swing.JTextField();
472
			tDivIzquierda.setPreferredSize(new java.awt.Dimension(90, 20));
473
			tDivIzquierda.setText(Integer.toString(fframescalebar.getNumLeft()));
474
			tDivIzquierda.addKeyListener(new java.awt.event.KeyAdapter() {
475
					public void keyReleased(java.awt.event.KeyEvent e) {
476
						if (tDivIzquierda.getText().toString().equals("")) {
477
							tDivIzquierda.setText("0");
478
						} else {
479
							fframescalebar.setNumLeft(Integer.parseInt(
480
									tDivIzquierda.getText()));
481
						}
482
					}
483
				});
484
		}
534 485

  
535
        return bCancelar;
536
    }
486
		return tDivIzquierda;
487
	}
537 488

  
538
    /* (non-Javadoc)
539
     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
540
     */
541
    public ViewInfo getViewInfo() {
542
    	ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
543
    		m_viewinfo.setTitle(PluginServices.getText(this,"Propiedades_escala_grafica"));
544
    	
545
        return m_viewinfo;
546
    }
489
	/**
490
	 * This method initializes bAceptar
491
	 *
492
	 * @return javax.swing.JButton
493
	 */
494
	private javax.swing.JButton getBAceptar() {
495
		if (bAceptar == null) {
496
			bAceptar = new javax.swing.JButton();
497
			bAceptar.setSize(85, 26);
498
			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
499
			bAceptar.setLocation(106, 347);
500
			bAceptar.setPreferredSize(new java.awt.Dimension(79, 23));
501
			bAceptar.addActionListener(new java.awt.event.ActionListener() {
502
					public void actionPerformed(java.awt.event.ActionEvent e) {
503
						fframescalebar.setUnits(getCbUnidades()
504
													.getSelectedIndex());
505
						fframescalebar.setBoundBox(FLayoutUtilities.toSheetRect(
506
								rect, m_layout.getAT()));
547 507

  
548
    /**
549
     * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
550
     */
551
    public boolean getIsAcepted() {
552
        return isAcepted;
553
    }
508
						fframescalebar.setBarColor(barcolor);
509
						fframescalebar.setTextColor(textcolor);
510
						fframescalebar.setShowNameUnits(getChbMostrarUnidades()
511
															.isSelected());
512
						fframescalebar.setShowDescription(getJCheckBox()
513
															  .isSelected());
514
						fframescalebar.setAboveDescription(getChbSobreDescripcion()
515
															   .isSelected());
516
						fframescalebar.setAboveIntervals(getChbEtiquetas()
517
															 .isSelected());
518
						fframescalebar.setAboveName(getChbSobreUnidades()
519
														.isSelected());
520
						fframescalebar.setDescripcion(getTfDescripcion()
521
														  .getText());
522
						PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
523
						m_layout.refresh();
524
						isAcepted = true;
525
					}
526
				});
527
		}
554 528

  
555
    /**
556
     * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
557
     */
558
    public void viewActivated() {
559
    }
529
		return bAceptar;
530
	}
560 531

  
561
    /**
562
     * This method initializes bFuente
563
     *
564
     * @return javax.swing.JButton
565
     */
566
    private javax.swing.JButton getBFuente() {
567
        if (bFuente == null) {
568
            bFuente = new javax.swing.JButton();
569
            bFuente.setText(PluginServices.getText(this, "fuente"));
570
            bFuente.addActionListener(new java.awt.event.ActionListener() {
571
                    public void actionPerformed(java.awt.event.ActionEvent e) {
572
                        fframescalebar.setFont(FontChooser.showDialog(
573
                                PluginServices.getText(this, "seleccion_fuente"),
574
                                fframescalebar.getFont())); // fchoser=new FontChooser();
575
                    }
576
                });
577
        }
532
	/**
533
	 * This method initializes bCancelar
534
	 *
535
	 * @return javax.swing.JButton
536
	 */
537
	private javax.swing.JButton getBCancelar() {
538
		if (bCancelar == null) {
539
			bCancelar = new javax.swing.JButton();
540
			bCancelar.setSize(85, 26);
541
			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
542
			bCancelar.setLocation(297, 347);
543
			bCancelar.setPreferredSize(new java.awt.Dimension(85, 23));
544
			bCancelar.addActionListener(new java.awt.event.ActionListener() {
545
					public void actionPerformed(java.awt.event.ActionEvent e) {
546
						PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
547
					}
548
				});
549
		}
578 550

  
579
        return bFuente;
580
    }
551
		return bCancelar;
552
	}
581 553

  
582
    /**
583
     * DOCUMENT ME!
584
     *
585
     * @author Vicente Caballero Navarro
586
     * 
587
     */
588
    class ComboBoxRenderer extends JLabel implements ListCellRenderer {
589
        /**
590
         * Crea un nuevo ComboBoxRenderer.
591
         */
592
        public ComboBoxRenderer() {
593
            setOpaque(true);
594
            setHorizontalAlignment(CENTER);
595
            setVerticalAlignment(CENTER);
596
        }
554
	/* (non-Javadoc)
555
	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
556
	 */
557
	public ViewInfo getViewInfo() {
558
		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
559
		m_viewinfo.setTitle(PluginServices.getText(this,
560
				"Propiedades_escala_grafica"));
597 561

  
598
        /*
599
         * This method finds the image and text corresponding
600
         * to the selected value and returns the label, set up
601
         * to display the text and image.
602
         */
603
        public Component getListCellRendererComponent(JList list, Object value,
604
            int index, boolean isSelected, boolean cellHasFocus) {
605
            //Get the selected index. (The index param isn't
606
            //always valid, so just use the value.)
607
            ///int selectedIndex = ((Integer)value).intValue();
608
            if (isSelected) {
609
                setBackground(list.getSelectionBackground());
610
                setForeground(list.getSelectionForeground());
611
            } else {
612
                setBackground(list.getBackground());
613
                setForeground(list.getForeground());
614
            }
562
		return m_viewinfo;
563
	}
615 564

  
616
            ImageIcon icon = images[Integer.parseInt((String) value)];
617
            setIcon(icon);
565
	/**
566
	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
567
	 */
568
	public boolean getIsAcepted() {
569
		return isAcepted;
570
	}
618 571

  
619
            return this;
620
        }
621
    }
622 572
	/**
623
	 * This method initializes pMarcoVista	
624
	 * 	
625
	 * @return javax.swing.JPanel	
626
	 */    
573
	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
574
	 */
575
	public void viewActivated() {
576
	}
577

  
578
	/**
579
	 * This method initializes bFuente
580
	 *
581
	 * @return javax.swing.JButton
582
	 */
583
	private javax.swing.JButton getBFuente() {
584
		if (bFuente == null) {
585
			bFuente = new javax.swing.JButton();
586
			bFuente.setText(PluginServices.getText(this, "fuente"));
587
			bFuente.addActionListener(new java.awt.event.ActionListener() {
588
					public void actionPerformed(java.awt.event.ActionEvent e) {
589
						fframescalebar.setFont(FontChooser.showDialog(
590
								PluginServices.getText(this, "seleccion_fuente"),
591
								fframescalebar.getFont())); // fchoser=new FontChooser();
592
					}
593
				});
594
		}
595

  
596
		return bFuente;
597
	}
598

  
599
	/**
600
	 * This method initializes pMarcoVista
601
	 *
602
	 * @return javax.swing.JPanel
603
	 */
627 604
	private JPanel getPMarcoVista() {
628 605
		if (pMarcoVista == null) {
629 606
			pMarcoVista = new JPanel();
630 607
			pMarcoVista.setBounds(7, 9, 240, 86);
631
			pMarcoVista.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "marco_vista"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
608
			pMarcoVista.setBorder(javax.swing.BorderFactory.createTitledBorder(
609
					null, PluginServices.getText(this, "marco_vista"),
610
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
611
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
632 612
			pMarcoVista.add(getJScrollPane(), null);
633 613
		}
614

  
634 615
		return pMarcoVista;
635 616
	}
617

  
636 618
	/**
637
	 * This method initializes pDescripcion	
638
	 * 	
639
	 * @return javax.swing.JPanel	
640
	 */    
619
	 * This method initializes pDescripcion
620
	 *
621
	 * @return javax.swing.JPanel
622
	 */
641 623
	private JPanel getPDescripcion() {
642 624
		if (pDescripcion == null) {
643 625
			pDescripcion = new JPanel();
644 626
			pDescripcion.setBounds(256, 9, 216, 110);
645
			pDescripcion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "descripcion", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
627
			pDescripcion.setBorder(javax.swing.BorderFactory.createTitledBorder(
628
					null, "descripcion",
629
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
630
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
646 631
			pDescripcion.add(getTfDescripcion(), null);
647 632
			pDescripcion.add(getJCheckBox(), null);
648 633
			pDescripcion.add(getChbSobreDescripcion(), null);
649 634
		}
635

  
650 636
		return pDescripcion;
651 637
	}
638

  
652 639
	/**
653
	 * This method initializes tfDescripcion	
654
	 * 	
655
	 * @return javax.swing.JTextField	
656
	 */    
640
	 * This method initializes tfDescripcion
641
	 *
642
	 * @return javax.swing.JTextField
643
	 */
657 644
	private JTextField getTfDescripcion() {
658 645
		if (tfDescripcion == null) {
659 646
			tfDescripcion = new JTextField();
660
			tfDescripcion.setPreferredSize(new java.awt.Dimension(190,20));
647
			tfDescripcion.setPreferredSize(new java.awt.Dimension(190, 20));
648

  
661 649
			/*if (fframeview!=null){
662
				  getTfDescripcion().setText("escala 1:"+String.valueOf(fframeview.getScale()));
663
			}
664
			*/
650
			   getTfDescripcion().setText("escala 1:"+String.valueOf(fframeview.getScale()));
651
			   }
652
			 */
665 653
			tfDescripcion.setText(fframescalebar.getDescripcion());
666
			
667 654
		}
655

  
668 656
		return tfDescripcion;
669 657
	}
658

  
670 659
	/**
671
	 * This method initializes pUnidades	
672
	 * 	
673
	 * @return javax.swing.JPanel	
674
	 */    
660
	 * This method initializes pUnidades
661
	 *
662
	 * @return javax.swing.JPanel
663
	 */
675 664
	private JPanel getPUnidades() {
676 665
		if (pUnidades == null) {
677 666
			pUnidades = new JPanel();
678 667
			pUnidades.setLocation(255, 129);
679 668
			pUnidades.setSize(216, 107);
680
			pUnidades.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "unidades"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
669
			pUnidades.setBorder(javax.swing.BorderFactory.createTitledBorder(
670
					null, PluginServices.getText(this, "unidades"),
671
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
672
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
681 673
			pUnidades.add(getCbUnidades(), null);
682 674
			pUnidades.add(getChbMostrarUnidades(), null);
683 675
			pUnidades.add(getChbSobreUnidades(), null);
684 676
		}
677

  
685 678
		return pUnidades;
686 679
	}
680

  
687 681
	/**
688
	 * This method initializes chbSobreDescripcion	
689
	 * 	
690
	 * @return javax.swing.JCheckBox	
691
	 */    
682
	 * This method initializes chbSobreDescripcion
683
	 *
684
	 * @return javax.swing.JCheckBox
685
	 */
692 686
	private JCheckBox getChbSobreDescripcion() {
693 687
		if (chbSobreDescripcion == null) {
694 688
			chbSobreDescripcion = new JCheckBox();
695 689
			chbSobreDescripcion.setSelected(fframescalebar.isAboveDescription());
696 690
			chbSobreDescripcion.setText("sobre_la_barra");
697 691
		}
692

  
698 693
		return chbSobreDescripcion;
699 694
	}
695

  
700 696
	/**
701
	 * This method initializes chbMostrarUnidades	
702
	 * 	
703
	 * @return javax.swing.JCheckBox	
704
	 */    
697
	 * This method initializes chbMostrarUnidades
698
	 *
699
	 * @return javax.swing.JCheckBox
700
	 */
705 701
	private JCheckBox getChbMostrarUnidades() {
706 702
		if (chbMostrarUnidades == null) {
707 703
			chbMostrarUnidades = new JCheckBox();
708 704
			chbMostrarUnidades.setText("mostrar_unidades");
709 705
			chbMostrarUnidades.setSelected(fframescalebar.isShowNameUnits());
710
			chbMostrarUnidades.setPreferredSize(new java.awt.Dimension(150,24));
706
			chbMostrarUnidades.setPreferredSize(new java.awt.Dimension(150, 24));
711 707
		}
708

  
712 709
		return chbMostrarUnidades;
713 710
	}
711

  
714 712
	/**
715
	 * This method initializes chbSobreUnidades	
716
	 * 	
717
	 * @return javax.swing.JCheckBox	
718
	 */    
713
	 * This method initializes chbSobreUnidades
714
	 *
715
	 * @return javax.swing.JCheckBox
716
	 */
719 717
	private JCheckBox getChbSobreUnidades() {
720 718
		if (chbSobreUnidades == null) {
721 719
			chbSobreUnidades = new JCheckBox();
722 720
			chbSobreUnidades.setSelected(fframescalebar.isAboveName());
723 721
			chbSobreUnidades.setText("sobre_la_barra");
724
			chbSobreUnidades.setPreferredSize(new java.awt.Dimension(150,24));
722
			chbSobreUnidades.setPreferredSize(new java.awt.Dimension(150, 24));
725 723
		}
724

  
726 725
		return chbSobreUnidades;
727 726
	}
727

  
728 728
	/**
729
	 * This method initializes pEtiquetas	
730
	 * 	
731
	 * @return javax.swing.JPanel	
732
	 */    
729
	 * This method initializes pEtiquetas
730
	 *
731
	 * @return javax.swing.JPanel
732
	 */
733 733
	private JPanel getPEtiquetas() {
734 734
		if (pEtiquetas == null) {
735 735
			pEtiquetas = new JPanel();
736
			pEtiquetas.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "etiquetas"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
736
			pEtiquetas.setBorder(javax.swing.BorderFactory.createTitledBorder(
737
					null, PluginServices.getText(this, "etiquetas"),
738
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
739
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
737 740
			pEtiquetas.setBounds(257, 246, 216, 93);
738 741
			pEtiquetas.add(getChbEtiquetas(), null);
739 742
			pEtiquetas.add(getJPanel2(), null);
740 743
		}
744

  
741 745
		return pEtiquetas;
742 746
	}
747

  
743 748
	/**
744
	 * This method initializes chbEtiquetas	
745
	 * 	
746
	 * @return javax.swing.JCheckBox	
747
	 */    
749
	 * This method initializes chbEtiquetas
750
	 *
751
	 * @return javax.swing.JCheckBox
752
	 */
748 753
	private JCheckBox getChbEtiquetas() {
749 754
		if (chbEtiquetas == null) {
750 755
			chbEtiquetas = new JCheckBox();
751 756
			chbEtiquetas.setSelected(fframescalebar.isAboveIntervals());
752 757
			chbEtiquetas.setText("sobre_la_barra");
753 758
		}
759

  
754 760
		return chbEtiquetas;
755 761
	}
762

  
756 763
	/**
757
	 * This method initializes pBarra	
758
	 * 	
759
	 * @return javax.swing.JPanel	
760
	 */    
764
	 * This method initializes pBarra
765
	 *
766
	 * @return javax.swing.JPanel
767
	 */
761 768
	private JPanel getPBarra() {
762 769
		if (pBarra == null) {
763 770
			pBarra = new JPanel();
764 771
			pBarra.setBounds(8, 104, 240, 235);
765
			pBarra.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "barra", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
772
			pBarra.setBorder(javax.swing.BorderFactory.createTitledBorder(
773
					null, "barra",
774
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
775
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
766 776
			pBarra.add(getCbEscala(), null);
767 777
			pBarra.add(getChbMantenerIntervalo(), null);
768 778
			pBarra.add(getJPanel5(), null);
769 779
			pBarra.add(getJPanel7(), null);
770 780
			pBarra.add(getJPanel6(), null);
771 781
			pBarra.add(getBBarraColor(), null);
782

  
772 783
			//pBarra.add(getJPanel(), null);
773 784
		}
785

  
774 786
		return pBarra;
775 787
	}
788

  
776 789
	/**
777
	 * This method initializes jPanel5	
778
	 * 	
779
	 * @return javax.swing.JPanel	
780
	 */    
790
	 * This method initializes jPanel5
791
	 *
792
	 * @return javax.swing.JPanel
793
	 */
781 794
	private JPanel getJPanel5() {
782 795
		if (jPanel5 == null) {
783 796
			jPanel5 = new JPanel();
784
			jPanel5.setPreferredSize(new java.awt.Dimension(200,30));
797
			jPanel5.setPreferredSize(new java.awt.Dimension(200, 30));
785 798
			jPanel5.add(getLIntervalo(), null);
786 799
			jPanel5.add(getTIntervalo(), null);
787 800
		}
801

  
788 802
		return jPanel5;
789 803
	}
804

  
790 805
	/**
791
	 * This method initializes jPanel6	
792
	 * 	
793
	 * @return javax.swing.JPanel	
794
	 */    
806
	 * This method initializes jPanel6
807
	 *
808
	 * @return javax.swing.JPanel
809
	 */
795 810
	private JPanel getJPanel6() {
796 811
		if (jPanel6 == null) {
797 812
			jPanel6 = new JPanel();
798 813
			jPanel6.add(getLDivIzquierda(), null);
799 814
			jPanel6.add(getTDivIzquierda(), null);
800 815
		}
816

  
801 817
		return jPanel6;
802 818
	}
819

  
803 820
	/**
804
	 * This method initializes jPanel7	
805
	 * 	
806
	 * @return javax.swing.JPanel	
807
	 */    
821
	 * This method initializes jPanel7
822
	 *
823
	 * @return javax.swing.JPanel
824
	 */
808 825
	private JPanel getJPanel7() {
809 826
		if (jPanel7 == null) {
810 827
			jPanel7 = new JPanel();
811 828
			jPanel7.add(getLNumIntervalos(), null);
812 829
			jPanel7.add(getTNumIntervalos(), null);
813 830
		}
831

  
814 832
		return jPanel7;
815 833
	}
834

  
816 835
	/**
817
	 * This method initializes bUnidadesColor	
818
	 * 	
819
	 * @return javax.swing.JButton	
820
	 */    
836
	 * This method initializes bUnidadesColor
837
	 *
838
	 * @return javax.swing.JButton
839
	 */
821 840
	private JButton getBUnidadesColor() {
822 841
		if (bUnidadesColor == null) {
823 842
			bUnidadesColor = new JButton();
824 843
			bUnidadesColor.setText("color");
825 844
			bUnidadesColor.setForeground(Color.white);
826 845
			bUnidadesColor.setBackground(textcolor);
827
			bUnidadesColor.addActionListener(new java.awt.event.ActionListener() { 
828
				public void actionPerformed(java.awt.event.ActionEvent e) {    
829
					JDialog dlg;
830
                    JColorChooser colorChooser;
831
                    colorChooser = new JColorChooser();
832
                    dlg = JColorChooser.createDialog((JFrame) null,
833
                            PluginServices.getText(this, "Elegir_Color"),
834
                            true, colorChooser, null, null);
835
                    dlg.show(true);
836
		
837
                    textcolor = (Color) colorChooser.getColor();
838
                    //getJPanel1().setBackground(textcolor);
839
                    bUnidadesColor.setBackground(textcolor);
840
				}
841
			});
846
			bUnidadesColor.addActionListener(new java.awt.event.ActionListener() {
847
					public void actionPerformed(java.awt.event.ActionEvent e) {
848
						JDialog dlg;
849
						JColorChooser colorChooser;
850
						colorChooser = new JColorChooser();
851
						dlg = JColorChooser.createDialog((JFrame) null,
852
								PluginServices.getText(this, "Elegir_Color"),
853
								true, colorChooser, null, null);
854
						dlg.show(true);
855

  
856
						textcolor = (Color) colorChooser.getColor();
857

  
858
						//getJPanel1().setBackground(textcolor);
859
						bUnidadesColor.setBackground(textcolor);
860
					}
861
				});
842 862
		}
863

  
843 864
		return bUnidadesColor;
844 865
	}
866

  
845 867
	/**
846
	 * This method initializes bBarraColor	
847
	 * 	
848
	 * @return javax.swing.JButton	
849
	 */    
868
	 * This method initializes bBarraColor
869
	 *
870
	 * @return javax.swing.JButton
871
	 */
850 872
	private JButton getBBarraColor() {
851 873
		if (bBarraColor == null) {
852 874
			bBarraColor = new JButton();
853 875
			bBarraColor.setText("color");
854 876
			bBarraColor.setForeground(Color.white);
855 877
			bBarraColor.setBackground(barcolor);
856
			bBarraColor.addActionListener(new java.awt.event.ActionListener() { 
857
				public void actionPerformed(java.awt.event.ActionEvent e) {    
858
					JDialog dlg;
859
                    JColorChooser colorChooser;
860
                    colorChooser = new JColorChooser();
861
                    dlg = JColorChooser.createDialog((JFrame) null,
862
                            PluginServices.getText(this, "Elegir_Color"),
863
                            true, colorChooser, null, null);
864
                    dlg.show(true);
865
		
866
                    barcolor = (Color) colorChooser.getColor();
867
                    //getJPanel().setBackground(barcolor);
868
                    bBarraColor.setBackground(barcolor);
869
				}
870
			});
878
			bBarraColor.addActionListener(new java.awt.event.ActionListener() {
879
					public void actionPerformed(java.awt.event.ActionEvent e) {
880
						JDialog dlg;
881
						JColorChooser colorChooser;
882
						colorChooser = new JColorChooser();
883
						dlg = JColorChooser.createDialog((JFrame) null,
884
								PluginServices.getText(this, "Elegir_Color"),
885
								true, colorChooser, null, null);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff