root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / propertiespanel / JPanelProperty.java @ 13136
History | View | Annotate | Download (2.13 KB)
1 | 12012 | bsanchez | /* 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.util.ArrayList; |
||
22 | import java.util.EventObject; |
||
23 | import java.util.Iterator; |
||
24 | |||
25 | import javax.swing.JPanel; |
||
26 | /**
|
||
27 | * Clase base que sirve para meter JPanels dentro de un PropertiesComponent
|
||
28 | *
|
||
29 | * @version 06/06/2007
|
||
30 | 12368 | bsanchez | * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
31 | 12012 | bsanchez | */
|
32 | public class JPanelProperty extends JPanel { |
||
33 | private static final long serialVersionUID = 3024638614874519828L; |
||
34 | 12121 | bsanchez | private ArrayList actionCommandListeners = new ArrayList(); |
35 | 12012 | bsanchez | |
36 | /**
|
||
37 | * A?adir el disparador de cuando se pulsa un bot?n.
|
||
38 | * @param listener
|
||
39 | */
|
||
40 | public void addStateChangedListener(PropertiesComponentListener listener) { |
||
41 | if (!actionCommandListeners.contains(listener))
|
||
42 | actionCommandListeners.add(listener); |
||
43 | } |
||
44 | |||
45 | /**
|
||
46 | * Borrar el disparador de eventos de los botones.
|
||
47 | * @param listener
|
||
48 | */
|
||
49 | public void removeStateChangedListener(PropertiesComponentListener listener) { |
||
50 | actionCommandListeners.remove(listener); |
||
51 | } |
||
52 | |||
53 | /**
|
||
54 | * Metodo que se invoca para informar de que ha cambiado un estado
|
||
55 | */
|
||
56 | protected void callStateChanged() { |
||
57 | Iterator acIterator = actionCommandListeners.iterator();
|
||
58 | while (acIterator.hasNext()) {
|
||
59 | PropertiesComponentListener listener = (PropertiesComponentListener) acIterator.next(); |
||
60 | listener.actionChangeProperties(new EventObject(this)); |
||
61 | } |
||
62 | } |
||
63 | } |