svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / propertiespanel / JPanelProperty.java @ 40561
History | View | Annotate | Download (3.07 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
25 |
*
|
26 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
27 |
*
|
28 |
* This program is free software; you can redistribute it and/or
|
29 |
* modify it under the terms of the GNU General Public License
|
30 |
* as published by the Free Software Foundation; either version 2
|
31 |
* of the License, or (at your option) any later version.
|
32 |
*
|
33 |
* This program is distributed in the hope that it will be useful,
|
34 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
35 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
36 |
* GNU General Public License for more details.
|
37 |
*
|
38 |
* You should have received a copy of the GNU General Public License
|
39 |
* along with this program; if not, write to the Free Software
|
40 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
41 |
*/
|
42 |
package org.gvsig.gui.beans.propertiespanel; |
43 |
|
44 |
import java.util.ArrayList; |
45 |
import java.util.EventObject; |
46 |
import java.util.Iterator; |
47 |
|
48 |
import javax.swing.JPanel; |
49 |
/**
|
50 |
* Clase base que sirve para meter JPanels dentro de un PropertiesComponent
|
51 |
*
|
52 |
* @version 06/06/2007
|
53 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
54 |
*/
|
55 |
public class JPanelProperty extends JPanel { |
56 |
private static final long serialVersionUID = 3024638614874519828L; |
57 |
private ArrayList actionCommandListeners = new ArrayList(); |
58 |
|
59 |
/**
|
60 |
* A?adir el disparador de cuando se pulsa un bot?n.
|
61 |
* @param listener
|
62 |
*/
|
63 |
public void addStateChangedListener(PropertiesComponentListener listener) { |
64 |
if (!actionCommandListeners.contains(listener))
|
65 |
actionCommandListeners.add(listener); |
66 |
} |
67 |
|
68 |
/**
|
69 |
* Borrar el disparador de eventos de los botones.
|
70 |
* @param listener
|
71 |
*/
|
72 |
public void removeStateChangedListener(PropertiesComponentListener listener) { |
73 |
actionCommandListeners.remove(listener); |
74 |
} |
75 |
|
76 |
/**
|
77 |
* Metodo que se invoca para informar de que ha cambiado un estado
|
78 |
*/
|
79 |
protected void callStateChanged() { |
80 |
Iterator acIterator = actionCommandListeners.iterator();
|
81 |
while (acIterator.hasNext()) {
|
82 |
PropertiesComponentListener listener = (PropertiesComponentListener) acIterator.next(); |
83 |
listener.actionChangeProperties(new EventObject(this)); |
84 |
} |
85 |
} |
86 |
} |