svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / thememanager / legendmanager / panels / FPanelLegendLabels.java @ 6998
History | View | Annotate | Download (16.2 KB)
1 | 1671 | jmorell | /*
|
---|---|---|---|
2 | * Created on 01-jun-2004
|
||
3 | *
|
||
4 | */
|
||
5 | /* 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 | package com.iver.cit.gvsig.gui.thememanager.legendmanager.panels; |
||
46 | |||
47 | import java.awt.Font; |
||
48 | import java.awt.event.ActionEvent; |
||
49 | 3035 | fjp | import java.sql.Types; |
50 | import java.util.ArrayList; |
||
51 | 1671 | jmorell | |
52 | import javax.swing.ButtonGroup; |
||
53 | import javax.swing.DefaultComboBoxModel; |
||
54 | import javax.swing.JPanel; |
||
55 | |||
56 | import com.iver.andami.PluginServices; |
||
57 | 2610 | fernando | import com.iver.cit.gvsig.ProjectExtension; |
58 | 2183 | fernando | import com.iver.cit.gvsig.fmap.DriverException; |
59 | 1671 | jmorell | import com.iver.cit.gvsig.fmap.core.FShape; |
60 | import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
||
61 | import com.iver.cit.gvsig.fmap.layers.FLayer; |
||
62 | 4874 | fjp | import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
63 | 1671 | jmorell | import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
64 | import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial; |
||
65 | import com.iver.cit.gvsig.fmap.rendering.Legend; |
||
66 | import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
||
67 | 6118 | jaume | import com.iver.cit.gvsig.gui.dialogs.FontChooser; |
68 | 6117 | jaume | import com.iver.cit.gvsig.gui.panels.ColorChooserPanel; |
69 | |||
70 | 3035 | fjp | import javax.swing.JComboBox; |
71 | import javax.swing.JLabel; |
||
72 | import javax.swing.JCheckBox; |
||
73 | 1671 | jmorell | |
74 | /**
|
||
75 | * @author fjp
|
||
76 | *
|
||
77 | */
|
||
78 | public class FPanelLegendLabels extends JPanel implements ILegendPanel { |
||
79 | 6996 | jaume | private static final double FONT_SCALE_FACTOR = 1.4; |
80 | |||
81 | |||
82 | 6989 | jaume | private static final Font DEFAULT_FONT = |
83 | 1671 | jmorell | new Font("SansSerif", Font.PLAIN, 9); |
84 | 6989 | jaume | |
85 | |||
86 | 1671 | jmorell | // private TOC m_TOC;
|
87 | private VectorialLegend m_Renderer;
|
||
88 | private ClassifiableVectorial m_lyr;
|
||
89 | private FSymbol m_FSymbol;
|
||
90 | 6989 | jaume | |
91 | 1671 | jmorell | private ColorChooserPanel m_colorChooser = new ColorChooserPanel(); |
92 | 6989 | jaume | |
93 | |||
94 | 2438 | caballero | //private javax.swing.JLabel jLabel = null;
|
95 | 1671 | jmorell | private javax.swing.JCheckBox jCheckBox = null; |
96 | private javax.swing.JLabel jLabel1 = null; |
||
97 | 3035 | fjp | private javax.swing.JComboBox jComboBoxTextField = null; |
98 | 1671 | jmorell | private javax.swing.JLabel jLabel2 = null; |
99 | 3035 | fjp | private javax.swing.JComboBox jComboBoxHeightField = null; |
100 | 1671 | jmorell | private javax.swing.JPanel jPanel = null; |
101 | private javax.swing.JTextField jTextField = null; |
||
102 | private javax.swing.JRadioButton jRadioButton = null; |
||
103 | private javax.swing.JRadioButton jRadioButton1 = null; |
||
104 | private FPreviewSymbol fPreviewSymbol = null; |
||
105 | private javax.swing.JLabel jLabel3 = null; |
||
106 | private javax.swing.JButton jButton = null; |
||
107 | 6989 | jaume | |
108 | 1671 | jmorell | private Font labelFont = DEFAULT_FONT; |
109 | 2438 | caballero | //private JPanel parent;
|
110 | 1671 | jmorell | private javax.swing.JLabel jLabel4 = null; |
111 | 3035 | fjp | |
112 | |||
113 | private JComboBox jComboBoxRotationField = null; |
||
114 | |||
115 | |||
116 | private JLabel jLabel = null; |
||
117 | |||
118 | |||
119 | private JCheckBox jCheckBoxTextOnly = null; |
||
120 | 1671 | jmorell | /**
|
121 | * This is the default constructor
|
||
122 | */
|
||
123 | public FPanelLegendLabels(JPanel parent) { |
||
124 | super();
|
||
125 | 2438 | caballero | //this.parent = parent;
|
126 | 1671 | jmorell | initialize(); |
127 | } |
||
128 | /**
|
||
129 | * This method initializes this
|
||
130 | 6989 | jaume | *
|
131 | 1671 | jmorell | * @return void
|
132 | */
|
||
133 | private void initialize() { |
||
134 | 3035 | fjp | jLabel = new JLabel(); |
135 | jLabel.setBounds(30, 110, 138, 18); |
||
136 | 6989 | jaume | jLabel.setText(PluginServices.getText(this, "rotation_field")); |
137 | 1671 | jmorell | this.setLayout(null); |
138 | this.setSize(454, 230); |
||
139 | 3035 | fjp | this.add(getJCheckBoxTextOnly(), null); |
140 | this.add(jLabel, null); |
||
141 | this.add(getJComboBoxRotationField(), null); |
||
142 | 1671 | jmorell | this.add(getJCheckBox(), null); |
143 | this.add(getJLabel1(), null); |
||
144 | 3035 | fjp | this.add(getJComboBoxTextField(), null); |
145 | 1671 | jmorell | this.add(getJLabel2(), null); |
146 | 3035 | fjp | this.add(getJComboBoxHeightField(), null); |
147 | 1671 | jmorell | this.add(getJPanel(), null); |
148 | this.add(getFPreviewSymbol(), null); |
||
149 | this.add(getJLabel3(), null); |
||
150 | this.add(getJButton(), null); |
||
151 | 6989 | jaume | |
152 | 1671 | jmorell | // m_colorChooser = new ColorChooserPanel();
|
153 | // m_colorChooser.setColor(Color.RED);
|
||
154 | m_colorChooser.setAlpha(255);
|
||
155 | 3035 | fjp | m_colorChooser.setBounds(312, 115, 99, 34); |
156 | 1671 | jmorell | m_colorChooser.addActionListener(new java.awt.event.ActionListener() {
|
157 | public void actionPerformed(ActionEvent e) { |
||
158 | updateControls(); |
||
159 | } |
||
160 | 6989 | jaume | }); |
161 | 1671 | jmorell | this.add(getJLabel4(), null); |
162 | this.add(m_colorChooser);
|
||
163 | 6989 | jaume | |
164 | 1671 | jmorell | } |
165 | public void setLayer(FLayer lyr, Legend r) |
||
166 | { |
||
167 | m_lyr = (ClassifiableVectorial) lyr; |
||
168 | 6989 | jaume | m_Renderer = (VectorialLegend)r; |
169 | 1671 | jmorell | |
170 | 6989 | jaume | fillFieldNames(); |
171 | 3035 | fjp | getJComboBoxTextField().getModel().setSelectedItem(m_Renderer.getLabelField()); |
172 | getJComboBoxHeightField().getModel().setSelectedItem(m_Renderer.getLabelHeightField()); |
||
173 | getJComboBoxRotationField().getModel().setSelectedItem(m_Renderer.getLabelRotationField()); |
||
174 | 1671 | jmorell | setFSymbol(r.getDefaultSymbol()); |
175 | 6989 | jaume | |
176 | 1671 | jmorell | if (m_Renderer.getLabelField() != null) |
177 | getJCheckBox().setSelected(true);
|
||
178 | else
|
||
179 | getJCheckBox().setSelected(false);
|
||
180 | |||
181 | 6989 | jaume | |
182 | |||
183 | |||
184 | 1671 | jmorell | } |
185 | public void setFSymbol(FSymbol sym) |
||
186 | { |
||
187 | if (sym == null) |
||
188 | { |
||
189 | m_FSymbol = new FSymbol(FShape.MULTI);
|
||
190 | } |
||
191 | else
|
||
192 | m_FSymbol = sym; |
||
193 | 6989 | jaume | |
194 | 1671 | jmorell | if (m_FSymbol.getFontColor()!=null){ |
195 | m_colorChooser.setColor(m_FSymbol.getFontColor()); |
||
196 | } |
||
197 | fPreviewSymbol.setSymbol(m_FSymbol); |
||
198 | 6989 | jaume | |
199 | 1671 | jmorell | getJRadioButton1().setSelected(!m_FSymbol.isFontSizeInPixels()); |
200 | 3035 | fjp | getJCheckBoxTextOnly().setSelected(!m_FSymbol.isShapeVisible()); |
201 | 6996 | jaume | double size = m_FSymbol.getFontSize();
|
202 | 6998 | jaume | // Scale the value of the font size to the value of the height
|
203 | // and avoid too much decimal numbers
|
||
204 | size = ((int) (100*size / FONT_SCALE_FACTOR))/100; |
||
205 | 6996 | jaume | getJTextField().setText(String.valueOf(size));
|
206 | 1671 | jmorell | |
207 | 6989 | jaume | |
208 | 1671 | jmorell | } |
209 | |||
210 | private void updateControls() { |
||
211 | 3035 | fjp | getJComboBoxTextField().setEnabled(getJCheckBox().isSelected()); |
212 | getJComboBoxHeightField().setEnabled(getJCheckBox().isSelected()); |
||
213 | getJComboBoxRotationField().setEnabled(getJCheckBox().isSelected()); |
||
214 | 1671 | jmorell | getJRadioButton().setEnabled(getJCheckBox().isSelected()); |
215 | getJRadioButton1().setEnabled(getJCheckBox().isSelected()); |
||
216 | getJTextField().setEnabled(getJCheckBox().isSelected()); |
||
217 | if (getJCheckBox().isSelected())
|
||
218 | { |
||
219 | FSymbol sym = m_FSymbol; |
||
220 | sym.setFont(labelFont); |
||
221 | sym.setFontColor(m_colorChooser.getColor()); |
||
222 | fPreviewSymbol.setSymbol(sym); |
||
223 | } |
||
224 | } |
||
225 | 2584 | caballero | public void updateValuesFromControls(VectorialLegend l) { |
226 | 1671 | jmorell | if (getJCheckBox().isSelected())
|
227 | { |
||
228 | 2741 | fjp | m_FSymbol = l.getDefaultSymbol(); |
229 | 2775 | fjp | m_FSymbol.setFont(labelFont); |
230 | 3035 | fjp | l.setLabelField((String) getJComboBoxTextField().getSelectedItem());
|
231 | l.setLabelHeightField((String) getJComboBoxHeightField().getSelectedItem());
|
||
232 | l.setLabelRotationField((String) getJComboBoxRotationField().getSelectedItem());
|
||
233 | 1671 | jmorell | m_FSymbol.setFontColor(m_colorChooser.getColor()); |
234 | 2584 | caballero | //m_FSymbol.setSymbolType(m_Renderer.getShapeType());
|
235 | 6998 | jaume | float fontSize = Float.parseFloat(getJTextField().getText()); |
236 | fontSize *= FONT_SCALE_FACTOR; |
||
237 | 1671 | jmorell | if (!getJRadioButton().isSelected())
|
238 | { |
||
239 | 6989 | jaume | // meters
|
240 | 6996 | jaume | /*
|
241 | * Java scales font size by defining the cell diagonal.
|
||
242 | * To obtain the right height value we need to apply a
|
||
243 | * factor to the diagonal to get a right value for the
|
||
244 | * height.
|
||
245 | */
|
||
246 | 6998 | jaume | m_FSymbol.setFontSize(fontSize); // Para que se pueda crear correctamente al recuperar del proyecto
|
247 | 1671 | jmorell | m_FSymbol.setFontSizeInPixels(false);
|
248 | } |
||
249 | else
|
||
250 | 6989 | jaume | { |
251 | // pixels
|
||
252 | 1671 | jmorell | m_FSymbol.setFont(labelFont); |
253 | 6998 | jaume | m_FSymbol.setFont(labelFont.deriveFont(fontSize)); |
254 | m_FSymbol.setFontSize(fontSize); |
||
255 | 1671 | jmorell | m_FSymbol.setFontSizeInPixels(true);
|
256 | 3035 | fjp | } |
257 | m_FSymbol.setShapeVisible(true);
|
||
258 | if (getJCheckBoxTextOnly().isSelected())
|
||
259 | m_FSymbol.setShapeVisible(false);
|
||
260 | 6989 | jaume | |
261 | 2584 | caballero | l.setDefaultSymbol(m_FSymbol); |
262 | 2741 | fjp | // System.out.println("Color punto 3 " + m_FSymbol.getColor().toString());
|
263 | 1671 | jmorell | } |
264 | else
|
||
265 | { |
||
266 | // Para que no se dibujen las etiquetas, el campo labelField del Renderer
|
||
267 | // ha de ser null
|
||
268 | 2584 | caballero | l.setLabelField(null);
|
269 | 1671 | jmorell | } |
270 | } |
||
271 | |||
272 | 6989 | jaume | |
273 | |||
274 | |||
275 | 1671 | jmorell | private void fillFieldNames() { |
276 | |||
277 | SelectableDataSource rs; |
||
278 | try {
|
||
279 | 4874 | fjp | // rs = ((ProjectExtension) PluginServices.getExtension(ProjectExtension.class)).getProject().getDataSourceByLayer((FLayer) m_lyr);
|
280 | rs = ((FLyrVect)m_lyr).getRecordset(); |
||
281 | 2183 | fernando | String[] nomFields; |
282 | 3035 | fjp | ArrayList nomNumericFields = new ArrayList(); |
283 | 1671 | jmorell | nomFields = new String[rs.getFieldCount()]; |
284 | 2183 | fernando | for (int i = 0; i < rs.getFieldCount(); i++) { |
285 | nomFields[i] = rs.getFieldName(i).trim(); |
||
286 | 3035 | fjp | if ((rs.getFieldType(i) == Types.FLOAT) |
287 | || (rs.getFieldType(i) == Types.BIGINT)
|
||
288 | || (rs.getFieldType(i) == Types.DOUBLE)
|
||
289 | || (rs.getFieldType(i) == Types.INTEGER))
|
||
290 | nomNumericFields.add(nomFields[i]); |
||
291 | 2183 | fernando | } |
292 | 1671 | jmorell | |
293 | 2183 | fernando | DefaultComboBoxModel cM_labelField = new DefaultComboBoxModel(nomFields); |
294 | 3035 | fjp | getJComboBoxTextField().setModel(cM_labelField); |
295 | DefaultComboBoxModel cM_HeightField = new DefaultComboBoxModel(nomNumericFields.toArray(new String[0])); |
||
296 | getJComboBoxHeightField().setModel(cM_HeightField); |
||
297 | DefaultComboBoxModel cM_RotationField = new DefaultComboBoxModel(nomNumericFields.toArray(new String[0])); |
||
298 | getJComboBoxRotationField().setModel(cM_RotationField); |
||
299 | 6989 | jaume | |
300 | 2183 | fernando | } catch (DriverException e) {
|
301 | e.printStackTrace(); |
||
302 | } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
||
303 | e.printStackTrace(); |
||
304 | } |
||
305 | 1671 | jmorell | } |
306 | 6989 | jaume | |
307 | |||
308 | 1671 | jmorell | /**
|
309 | |||
310 | 6989 | jaume | * This method initializes jCheckBox
|
311 | 1671 | jmorell | |
312 | 6989 | jaume | *
|
313 | 1671 | jmorell | |
314 | 6989 | jaume | * @return javax.swing.JCheckBox
|
315 | 1671 | jmorell | |
316 | 6989 | jaume | */
|
317 | 1671 | jmorell | private javax.swing.JCheckBox getJCheckBox() {
|
318 | if (jCheckBox == null) { |
||
319 | jCheckBox = new javax.swing.JCheckBox();
|
||
320 | jCheckBox.setText(PluginServices.getText(this,"Habilitar_etiquetado")); |
||
321 | 2379 | jmorell | jCheckBox.setBounds(28, 22, 152, 23); |
322 | 6989 | jaume | jCheckBox.addItemListener(new java.awt.event.ItemListener() {
|
323 | 1671 | jmorell | |
324 | 6989 | jaume | public void itemStateChanged(java.awt.event.ItemEvent e) { |
325 | updateControls(); |
||
326 | 1671 | jmorell | |
327 | } |
||
328 | }); |
||
329 | |||
330 | } |
||
331 | return jCheckBox;
|
||
332 | } |
||
333 | |||
334 | /**
|
||
335 | |||
336 | 6989 | jaume | * This method initializes jLabel1
|
337 | 1671 | jmorell | |
338 | 6989 | jaume | *
|
339 | 1671 | jmorell | |
340 | 6989 | jaume | * @return javax.swing.JLabel
|
341 | 1671 | jmorell | |
342 | 6989 | jaume | */
|
343 | 1671 | jmorell | private javax.swing.JLabel getJLabel1() {
|
344 | if (jLabel1 == null) { |
||
345 | jLabel1 = new javax.swing.JLabel();
|
||
346 | jLabel1.setText(PluginServices.getText(this,"Campo_de_etiquetado")); |
||
347 | 2379 | jmorell | jLabel1.setBounds(29, 53, 139, 21); |
348 | 1671 | jmorell | } |
349 | return jLabel1;
|
||
350 | } |
||
351 | |||
352 | /**
|
||
353 | |||
354 | 6989 | jaume | * This method initializes jComboBox
|
355 | 1671 | jmorell | |
356 | 6989 | jaume | *
|
357 | 1671 | jmorell | |
358 | 6989 | jaume | * @return javax.swing.JComboBox
|
359 | 1671 | jmorell | |
360 | 6989 | jaume | */
|
361 | 3035 | fjp | private javax.swing.JComboBox getJComboBoxTextField() {
|
362 | if (jComboBoxTextField == null) { |
||
363 | jComboBoxTextField = new javax.swing.JComboBox();
|
||
364 | jComboBoxTextField.setBounds(175, 52, 110, 19); |
||
365 | jComboBoxTextField.setEnabled(false);
|
||
366 | 1671 | jmorell | } |
367 | 3035 | fjp | return jComboBoxTextField;
|
368 | 1671 | jmorell | } |
369 | |||
370 | /**
|
||
371 | |||
372 | 6989 | jaume | * This method initializes jLabel2
|
373 | 1671 | jmorell | |
374 | 6989 | jaume | *
|
375 | 1671 | jmorell | |
376 | 6989 | jaume | * @return javax.swing.JLabel
|
377 | 1671 | jmorell | |
378 | 6989 | jaume | */
|
379 | 1671 | jmorell | private javax.swing.JLabel getJLabel2() {
|
380 | if (jLabel2 == null) { |
||
381 | jLabel2 = new javax.swing.JLabel();
|
||
382 | 3035 | fjp | jLabel2.setBounds(29, 81, 137, 21); |
383 | 1671 | jmorell | jLabel2.setText(PluginServices.getText(this,"campo_altura_texto")); |
384 | 3035 | fjp | jLabel2.setVisible(true);
|
385 | 1671 | jmorell | } |
386 | return jLabel2;
|
||
387 | } |
||
388 | |||
389 | /**
|
||
390 | |||
391 | 6989 | jaume | * This method initializes jComboBox1
|
392 | 1671 | jmorell | |
393 | 6989 | jaume | *
|
394 | 1671 | jmorell | |
395 | 6989 | jaume | * @return javax.swing.JComboBox
|
396 | 1671 | jmorell | |
397 | 6989 | jaume | */
|
398 | 3035 | fjp | private javax.swing.JComboBox getJComboBoxHeightField() {
|
399 | if (jComboBoxHeightField == null) { |
||
400 | jComboBoxHeightField = new javax.swing.JComboBox();
|
||
401 | jComboBoxHeightField.setBounds(175, 82, 110, 18); |
||
402 | jComboBoxHeightField.setEnabled(true);
|
||
403 | jComboBoxHeightField.setVisible(true);
|
||
404 | 1671 | jmorell | } |
405 | 3035 | fjp | return jComboBoxHeightField;
|
406 | 1671 | jmorell | } |
407 | |||
408 | /**
|
||
409 | |||
410 | 6989 | jaume | * This method initializes jPanel
|
411 | 1671 | jmorell | |
412 | 6989 | jaume | *
|
413 | 1671 | jmorell | |
414 | 6989 | jaume | * @return javax.swing.JPanel
|
415 | 1671 | jmorell | |
416 | 6989 | jaume | */
|
417 | 1671 | jmorell | private javax.swing.JPanel getJPanel() {
|
418 | if (jPanel == null) { |
||
419 | jPanel = new javax.swing.JPanel();
|
||
420 | jPanel.setLayout(null);
|
||
421 | jPanel.setBounds(29, 136, 258, 84); |
||
422 | jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"Altura_fija_de_texto"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
||
423 | ButtonGroup jButtonGroup = new ButtonGroup(); |
||
424 | jButtonGroup.add(getJRadioButton1()); |
||
425 | jButtonGroup.add(getJRadioButton()); |
||
426 | jPanel.add(getJRadioButton1(), null);
|
||
427 | jPanel.add(getJRadioButton(), null);
|
||
428 | jPanel.add(getJTextField(), null);
|
||
429 | } |
||
430 | return jPanel;
|
||
431 | } |
||
432 | |||
433 | /**
|
||
434 | |||
435 | 6989 | jaume | * This method initializes jTextField
|
436 | 1671 | jmorell | |
437 | 6989 | jaume | *
|
438 | 1671 | jmorell | |
439 | 6989 | jaume | * @return javax.swing.JTextField
|
440 | 1671 | jmorell | |
441 | 6989 | jaume | */
|
442 | 1671 | jmorell | private javax.swing.JTextField getJTextField() {
|
443 | if (jTextField == null) { |
||
444 | jTextField = new javax.swing.JTextField();
|
||
445 | jTextField.setBounds(26, 32, 76, 21); |
||
446 | jTextField.setEnabled(false);
|
||
447 | jTextField.setText("10");
|
||
448 | } |
||
449 | return jTextField;
|
||
450 | } |
||
451 | |||
452 | /**
|
||
453 | |||
454 | 6989 | jaume | * This method initializes jRadioButton
|
455 | 1671 | jmorell | |
456 | 6989 | jaume | *
|
457 | 1671 | jmorell | |
458 | 6989 | jaume | * @return javax.swing.JRadioButton
|
459 | 1671 | jmorell | |
460 | 6989 | jaume | */
|
461 | 1671 | jmorell | private javax.swing.JRadioButton getJRadioButton() {
|
462 | if (jRadioButton == null) { |
||
463 | jRadioButton = new javax.swing.JRadioButton();
|
||
464 | jRadioButton.setText(PluginServices.getText(this,"En_pixels")); |
||
465 | jRadioButton.setBounds(145, 44, 100, 23); |
||
466 | jRadioButton.setEnabled(false);
|
||
467 | jRadioButton.setSelected(true);
|
||
468 | } |
||
469 | return jRadioButton;
|
||
470 | } |
||
471 | |||
472 | /**
|
||
473 | |||
474 | 6989 | jaume | * This method initializes jRadioButton1
|
475 | 1671 | jmorell | |
476 | 6989 | jaume | *
|
477 | 1671 | jmorell | |
478 | 6989 | jaume | * @return javax.swing.JRadioButton
|
479 | 1671 | jmorell | |
480 | 6989 | jaume | */
|
481 | 1671 | jmorell | private javax.swing.JRadioButton getJRadioButton1() {
|
482 | if (jRadioButton1 == null) { |
||
483 | jRadioButton1 = new javax.swing.JRadioButton();
|
||
484 | jRadioButton1.setText(PluginServices.getText(this,"En_metros")); |
||
485 | 6989 | jaume | jRadioButton1.setBounds(145, 16, 100, 23); |
486 | 1671 | jmorell | jRadioButton1.setEnabled(false);
|
487 | } |
||
488 | return jRadioButton1;
|
||
489 | } |
||
490 | |||
491 | /**
|
||
492 | |||
493 | 6989 | jaume | * This method initializes fPreviewSymbol
|
494 | 1671 | jmorell | |
495 | 6989 | jaume | *
|
496 | 1671 | jmorell | |
497 | 6989 | jaume | * @return com.iver.cit.opensig.gui.Panels.FPreviewSymbol
|
498 | 1671 | jmorell | |
499 | 6989 | jaume | */
|
500 | 1671 | jmorell | public FPreviewSymbol getFPreviewSymbol() {
|
501 | if (fPreviewSymbol == null) { |
||
502 | fPreviewSymbol = new FPreviewSymbol();
|
||
503 | fPreviewSymbol.setBounds(311, 53, 134, 77); |
||
504 | } |
||
505 | return fPreviewSymbol;
|
||
506 | } |
||
507 | |||
508 | /**
|
||
509 | |||
510 | 6989 | jaume | * This method initializes jLabel3
|
511 | 1671 | jmorell | |
512 | 6989 | jaume | *
|
513 | 1671 | jmorell | |
514 | 6989 | jaume | * @return javax.swing.JLabel
|
515 | 1671 | jmorell | |
516 | 6989 | jaume | */
|
517 | 1671 | jmorell | private javax.swing.JLabel getJLabel3() {
|
518 | if (jLabel3 == null) { |
||
519 | jLabel3 = new javax.swing.JLabel();
|
||
520 | jLabel3.setBounds(312, 28, 100, 18); |
||
521 | jLabel3.setText(PluginServices.getText(this,"Previsualizacion")); |
||
522 | 2204 | vcaballero | jLabel3.setVisible(false);
|
523 | 1671 | jmorell | } |
524 | return jLabel3;
|
||
525 | } |
||
526 | |||
527 | /**
|
||
528 | |||
529 | 6989 | jaume | * This method initializes jButton
|
530 | 1671 | jmorell | |
531 | 6989 | jaume | *
|
532 | 1671 | jmorell | |
533 | 6989 | jaume | * @return javax.swing.JButton
|
534 | 1671 | jmorell | |
535 | 6989 | jaume | */
|
536 | 1671 | jmorell | private javax.swing.JButton getJButton() {
|
537 | if (jButton == null) { |
||
538 | jButton = new javax.swing.JButton();
|
||
539 | 3035 | fjp | jButton.setBounds(314, 54, 111, 29); |
540 | 1671 | jmorell | jButton.setText(PluginServices.getText(this,"fuente")+"..."); |
541 | 6989 | jaume | jButton.addActionListener(new java.awt.event.ActionListener() {
|
542 | 1671 | jmorell | |
543 | 6989 | jaume | public void actionPerformed(java.awt.event.ActionEvent e) { |
544 | 2438 | caballero | //JButton origen = (JButton) e.getSource();
|
545 | 1671 | jmorell | Font newFont;
|
546 | 6989 | jaume | |
547 | newFont = FontChooser.showDialog("Choose Font", labelFont);
|
||
548 | |||
549 | 1671 | jmorell | if (newFont == null) { |
550 | return;
|
||
551 | } |
||
552 | 6989 | jaume | |
553 | 1671 | jmorell | labelFont = newFont; |
554 | updateControls(); |
||
555 | |||
556 | |||
557 | } |
||
558 | }); |
||
559 | |||
560 | } |
||
561 | return jButton;
|
||
562 | } |
||
563 | |||
564 | /**
|
||
565 | |||
566 | 6989 | jaume | * This method initializes jLabel4
|
567 | 1671 | jmorell | |
568 | 6989 | jaume | *
|
569 | 1671 | jmorell | |
570 | 6989 | jaume | * @return javax.swing.JLabel
|
571 | 1671 | jmorell | |
572 | 6989 | jaume | */
|
573 | 1671 | jmorell | private javax.swing.JLabel getJLabel4() {
|
574 | if (jLabel4 == null) { |
||
575 | jLabel4 = new javax.swing.JLabel();
|
||
576 | 3035 | fjp | jLabel4.setBounds(311, 88, 133, 23); |
577 | 1671 | jmorell | jLabel4.setText(PluginServices.getText(this,"color_texto")); |
578 | } |
||
579 | return jLabel4;
|
||
580 | } |
||
581 | /* (non-Javadoc)
|
||
582 | * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
|
||
583 | */
|
||
584 | public Legend getLegend() {
|
||
585 | 2584 | caballero | updateValuesFromControls(m_Renderer); |
586 | 1671 | jmorell | return m_Renderer;
|
587 | } |
||
588 | 3035 | fjp | /**
|
589 | 6989 | jaume | * This method initializes jComboBox1
|
590 | *
|
||
591 | * @return javax.swing.JComboBox
|
||
592 | */
|
||
593 | 3035 | fjp | private JComboBox getJComboBoxRotationField() { |
594 | if (jComboBoxRotationField == null) { |
||
595 | jComboBoxRotationField = new JComboBox(); |
||
596 | jComboBoxRotationField.setBounds(175, 111, 110, 19); |
||
597 | } |
||
598 | return jComboBoxRotationField;
|
||
599 | } |
||
600 | /**
|
||
601 | 6989 | jaume | * This method initializes jCheckBox1
|
602 | *
|
||
603 | * @return javax.swing.JCheckBox
|
||
604 | */
|
||
605 | 3035 | fjp | private JCheckBox getJCheckBoxTextOnly() { |
606 | if (jCheckBoxTextOnly == null) { |
||
607 | jCheckBoxTextOnly = new JCheckBox(); |
||
608 | jCheckBoxTextOnly.setBounds(315, 171, 133, 22); |
||
609 | 6991 | jaume | jCheckBoxTextOnly.setText(PluginServices.getText(this, "draw_text_only")); |
610 | 3035 | fjp | } |
611 | return jCheckBoxTextOnly;
|
||
612 | } |
||
613 | 1671 | jmorell | |
614 | } // @jve:visual-info decl-index=0 visual-constraint="10,10" |