svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / com / iver / cit / gvsig / addlayer / fileopen / vectorial / VectorialFileFilter.java @ 24920
History | View | Annotate | Download (1.8 KB)
1 | 13541 | bsanchez | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2005 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 com.iver.cit.gvsig.addlayer.fileopen.vectorial; |
||
20 | |||
21 | import java.io.File; |
||
22 | |||
23 | import javax.swing.filechooser.FileFilter; |
||
24 | |||
25 | 24793 | jmvivo | import org.gvsig.fmap.dal.DataStoreParameters; |
26 | 24881 | jmvivo | import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter; |
27 | 20994 | jmvivo | |
28 | 13541 | bsanchez | /**
|
29 | * Clase para definir que ficheros aceptara la extension vectorial, es necesario
|
||
30 | * para el JFileChooser
|
||
31 | 21743 | vcaballero | *
|
32 | 13541 | bsanchez | * @version 05/09/2007
|
33 | * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
||
34 | */
|
||
35 | public class VectorialFileFilter extends FileFilter { |
||
36 | 24793 | jmvivo | public FilesystemFileFilter filter = null; |
37 | 13541 | bsanchez | |
38 | 24793 | jmvivo | public VectorialFileFilter(FilesystemFileFilter params) {
|
39 | this.filter = params;
|
||
40 | 13541 | bsanchez | } |
41 | |||
42 | /**
|
||
43 | * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
|
||
44 | */
|
||
45 | public boolean accept(File f) { |
||
46 | 22185 | jmvivo | if (f.isDirectory()) {
|
47 | 13541 | bsanchez | return true; |
48 | 22185 | jmvivo | } |
49 | 24793 | jmvivo | return filter.accept(f);
|
50 | 13541 | bsanchez | |
51 | } |
||
52 | |||
53 | /**
|
||
54 | * @see javax.swing.filechooser.FileFilter#getDescription()
|
||
55 | */
|
||
56 | public String getDescription() { |
||
57 | 24793 | jmvivo | return ((DataStoreParameters) filter).getDescription();
|
58 | 13541 | bsanchez | } |
59 | } |