svn-gvsig-desktop / trunk / extensions / extGPE-gvSIG / src / org / gvsig / fmap / drivers / gpe / addlayer / GPEFileOpen.java @ 27067
History | View | Annotate | Download (2.07 KB)
1 | 27067 | jpiera | package org.gvsig.fmap.drivers.gpe.addlayer; |
---|---|---|---|
2 | |||
3 | import java.io.File; |
||
4 | import java.util.ArrayList; |
||
5 | |||
6 | import javax.swing.JFileChooser; |
||
7 | import javax.swing.filechooser.FileFilter; |
||
8 | |||
9 | import org.gvsig.gpe.GPERegister; |
||
10 | import org.gvsig.gpe.parser.GPEParser; |
||
11 | |||
12 | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
||
13 | *
|
||
14 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
15 | *
|
||
16 | * This program is free software; you can redistribute it and/or
|
||
17 | * modify it under the terms of the GNU General Public License
|
||
18 | * as published by the Free Software Foundation; either version 2
|
||
19 | * of the License, or (at your option) any later version.
|
||
20 | *
|
||
21 | * This program is distributed in the hope that it will be useful,
|
||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
24 | * GNU General Public License for more details.
|
||
25 | *
|
||
26 | * You should have received a copy of the GNU General Public License
|
||
27 | * along with this program; if not, write to the Free Software
|
||
28 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
29 | *
|
||
30 | * For more information, contact:
|
||
31 | *
|
||
32 | * Generalitat Valenciana
|
||
33 | * Conselleria d'Infraestructures i Transport
|
||
34 | * Av. Blasco Ib??ez, 50
|
||
35 | * 46010 VALENCIA
|
||
36 | * SPAIN
|
||
37 | *
|
||
38 | * +34 963862235
|
||
39 | * gvsig@gva.es
|
||
40 | * www.gvsig.gva.es
|
||
41 | *
|
||
42 | * or
|
||
43 | *
|
||
44 | * IVER T.I. S.A
|
||
45 | * Salamanca 50
|
||
46 | * 46005 Valencia
|
||
47 | * Spain
|
||
48 | *
|
||
49 | * +34 963163400
|
||
50 | * dac@iver.es
|
||
51 | */
|
||
52 | /* CVS MESSAGES:
|
||
53 | *
|
||
54 | * $Id$
|
||
55 | * $Log$
|
||
56 | *
|
||
57 | */
|
||
58 | /**
|
||
59 | * @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
||
60 | */
|
||
61 | public class GPEFileOpen extends JFileChooser{ |
||
62 | private ArrayList arrayFileFilter; |
||
63 | |||
64 | public GPEFileOpen(){
|
||
65 | arrayFileFilter = new ArrayList(); |
||
66 | GPEParser[] parsers = GPERegister.getAllParsers();
|
||
67 | for (int i=0 ; i<parsers.length ; i++){ |
||
68 | arrayFileFilter.add(new GPEParserFileFilter(parsers[i]));
|
||
69 | } |
||
70 | } |
||
71 | |||
72 | /* (non-Javadoc)
|
||
73 | * @see javax.swing.JFileChooser#accept(java.io.File)
|
||
74 | */
|
||
75 | public boolean accept(File f) { |
||
76 | if (f.isDirectory()){
|
||
77 | return true; |
||
78 | } |
||
79 | FileFilter filter = super.getFileFilter(); |
||
80 | return (filter.accept(f));
|
||
81 | } |
||
82 | } |