    001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/tools/shape/ShapeView.java $
    002    /*----------------------------------------
    003
    004     This file is part of deegree.
    005     Copyright (C) 2001-2008 by:
    006     EXSE, Department of Geography, University of Bonn
    007     http://www.giub.uni-bonn.de/deegree/
    008     lat/lon GmbH
    009     http://www.lat-lon.de
    010
    011     This library is free software; you can redistribute it and/or
    012     modify it under the terms of the GNU Lesser General Public
    013     License as published by the Free Software Foundation; either
    014     version 2.1 of the License, or (at your option) any later version.
    015
    016     This library is distributed in the hope that it will be useful,
    017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    019     Lesser General Public License for more details.
    020
    021     You should have received a copy of the GNU Lesser General Public
    022     License along with this library; if not, write to the Free Software
    023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    024
    025     Application to index a shape file, using the R-tree algorithm.
    026     Copyright (C) May 2003 by IDgis BV, The Netherlands - www.idgis.nl
    027     ----------------------------------------*/
    028
    029    package org.deegree.tools.shape;
    030
    031    import java.io.File;
    032
    033    import javax.swing.filechooser.FileView;
    034
    035    /**
    036     *
    037     *
    038     *
    039     * @version $Revision: 12519 $
    040     * @author last edited by: $Author: aschmitz $
    041     *
    042     * @version 1.0. $Revision: 12519 $, $Date: 2008-06-25 11:37:30 +0200 (Mi, 25. Jun 2008) $
    043     *
    044     * @since 2.0
    045     */
    046    class ShapeView extends FileView {
    047
    048        /**
    049         * @param f
    050         * @return filename without extension
    051         */
    052        public String getName( File f ) {
    053            String name = f.getName();
    054
    055            if ( f.isDirectory() )
    056                return null;
    057
    058            return name.substring( 0, name.length() - 4 );
    059        }
    060    }