svn-gvsig-desktop / trunk / libraries / libRaster / src / org / gvsig / raster / grid / filter / RegistrableFilterListener.java @ 18393
History | View | Annotate | Download (2.38 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.raster.grid.filter; |
20 |
|
21 |
import java.util.ArrayList; |
22 |
import java.util.EventObject; |
23 |
import java.util.Iterator; |
24 |
|
25 |
import javax.swing.JPanel; |
26 |
|
27 |
import org.gvsig.raster.dataset.Params; |
28 |
|
29 |
/**
|
30 |
* Clase de la que deben heredar todos los paneles para filtros
|
31 |
* definidos por el usuario. Tiene los m?todos para el registro de listeners
|
32 |
*
|
33 |
* 28/09/2007
|
34 |
* @author Nacho Brodin nachobrodin@gmail.com
|
35 |
*/
|
36 |
public class RegistrableFilterListener extends JPanel { |
37 |
private static final long serialVersionUID = 5528469123516861351L; |
38 |
private ArrayList actionCommandListeners = new ArrayList(); |
39 |
protected Params params = null; |
40 |
|
41 |
/**
|
42 |
* Borrar el disparador de eventos de los botones.
|
43 |
* @param listener
|
44 |
*/
|
45 |
public void removeStateChangedListener(FilterUIListener listener) { |
46 |
actionCommandListeners.remove(listener); |
47 |
} |
48 |
|
49 |
|
50 |
/**
|
51 |
*
|
52 |
* Ejecuci?n del m?todo actionValuesCompleted en todos los filtros registrados
|
53 |
*/
|
54 |
protected void callStateChanged() { |
55 |
Iterator acIterator = actionCommandListeners.iterator();
|
56 |
while (acIterator.hasNext()) {
|
57 |
FilterUIListener listener = (FilterUIListener) acIterator.next(); |
58 |
listener.actionValuesCompleted(new EventObject(this)); |
59 |
} |
60 |
} |
61 |
|
62 |
/**
|
63 |
* A?adir el listener para los paneles definidos por el usuario
|
64 |
* @param listener
|
65 |
*/
|
66 |
public void addFilterUIListener(FilterUIListener listener) { |
67 |
if (!actionCommandListeners.contains(listener))
|
68 |
actionCommandListeners.add(listener); |
69 |
} |
70 |
|
71 |
/**
|
72 |
* Obtiene los par?metros cargados por el panel
|
73 |
* @return
|
74 |
*/
|
75 |
public Params getParams() {
|
76 |
return params;
|
77 |
} |
78 |
} |