svn-gvsig-desktop / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / propertiespanel / PropertiesPanel.java @ 11563
History | View | Annotate | Download (2.93 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.gui.beans.propertiespanel; |
20 |
|
21 |
import java.awt.BorderLayout; |
22 |
import java.util.ArrayList; |
23 |
|
24 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
25 |
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel; |
26 |
/**
|
27 |
* Panel para crear un cuadro de propiedades de configuracion standard.
|
28 |
*
|
29 |
* @version 19/04/2007
|
30 |
* @author Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
31 |
*
|
32 |
*/
|
33 |
public class PropertiesPanel extends DefaultButtonsPanel { |
34 |
private static final long serialVersionUID = 372118344763661890L; |
35 |
PropertiesComponent propertiesComponent = null;
|
36 |
|
37 |
/**
|
38 |
* Constructor de la calse
|
39 |
*/
|
40 |
public PropertiesPanel() {
|
41 |
super(ButtonsPanel.BUTTONS_ACCEPTCANCELAPPLY);
|
42 |
initialize(); |
43 |
} |
44 |
|
45 |
/**
|
46 |
* Creaci?n de la ventana con sus componentes
|
47 |
*/
|
48 |
private void initialize() { |
49 |
this.setLayout(new BorderLayout(0, 0)); |
50 |
propertiesComponent = new PropertiesComponent();
|
51 |
this.add(propertiesComponent, BorderLayout.CENTER); |
52 |
} |
53 |
|
54 |
/**
|
55 |
* A?ade una clave/valor al panel de propiedades.<br>
|
56 |
* <br>
|
57 |
* El componente seleccionado dependera del instanceof del valor y las
|
58 |
* opciones extras que se pongan. Por ejemplo: para el instanceof de un String
|
59 |
* siempre se usara un JTextField, en cambio, para un Integer, se podran usar
|
60 |
* 3 tipos, el JSlider, JComboBox y JSpinner. Estos tipos se especifican en el
|
61 |
* array extras, poniendolo siempre en la posicion 0. En la posici?n 1 y 2 de
|
62 |
* un JSlider se puede especificar el m?nimo y el m?ximo del Slider.
|
63 |
*
|
64 |
* @param textLabel
|
65 |
* @param key
|
66 |
* @param value
|
67 |
* @param extras
|
68 |
*/
|
69 |
public void addValue(String textLabel, String key, Object value, Object[] extras) { |
70 |
propertiesComponent.addValue(textLabel, key, value, extras); |
71 |
} |
72 |
|
73 |
/**
|
74 |
* Obtener todos los valores de la ventana, esto ser? un
|
75 |
* <code><b>ArrayList</b></code> que contendr? elementos de tipo
|
76 |
* <code><b>PropertyStruct</b></code>, pudiendo tener el valor antes de
|
77 |
* ser modificado y el nuevo valor.
|
78 |
*
|
79 |
* @see <code>PropertyStruct</code>
|
80 |
*
|
81 |
* @return ArrayList de elementos de tipo <code>PropertyStruct</code>
|
82 |
*/
|
83 |
public ArrayList getValues() { |
84 |
return propertiesComponent.getValues();
|
85 |
} |
86 |
} |