/[schmitzm]/branches/1.0-gt2-2.6/src/skrueger/geotools/selection/TableSelectionSynchronizer.java
ViewVC logotype

Diff of /branches/1.0-gt2-2.6/src/skrueger/geotools/selection/TableSelectionSynchronizer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/skrueger/geotools/selection/TableSelectionSynchronizer.java revision 111 by alfonx, Tue May 12 23:33:14 2009 UTC branches/1.0-gt2-2.6/src/skrueger/geotools/selection/TableSelectionSynchronizer.java revision 322 by alfonx, Wed Aug 26 14:12:17 2009 UTC
# Line 1  Line 1 
1    /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3     *
4     * This file is part of the SCHMITZM library - a collection of utility
5     * classes based on Java 1.6, focusing (not only) on Java Swing
6     * and the Geotools library.
7     *
8     * The SCHMITZM project is hosted at:
9     * http://wald.intevation.org/projects/schmitzm/
10     *
11     * This program is free software; you can redistribute it and/or
12     * modify it under the terms of the GNU Lesser General Public License
13     * as published by the Free Software Foundation; either version 3
14     * of the License, or (at your option) any later version.
15     *
16     * This program is distributed in the hope that it will be useful,
17     * but WITHOUT ANY WARRANTY; without even the implied warranty of
18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     * GNU General Public License for more details.
20     *
21     * You should have received a copy of the GNU Lesser General Public License (license.txt)
22     * along with this program; if not, write to the Free Software
23     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24     * or try this link: http://www.gnu.org/licenses/lgpl.html
25     *
26     * Contributors:
27     *     Martin O. J. Schmitz - initial API and implementation
28     *     Stefan A. Krüger - additional utility classes
29     ******************************************************************************/
30  /**  /**
31   Copyright 2008 Stefan Alfons Krüger   Copyright 2008 Stefan Alfons Krüger
32    
# Line 23  import javax.swing.event.ListSelectionEv Line 52  import javax.swing.event.ListSelectionEv
52  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
53  import javax.swing.table.TableModel;  import javax.swing.table.TableModel;
54    
55  import org.geotools.feature.Feature;  import org.opengis.feature.simple.SimpleFeature;
56    
57  import schmitzm.geotools.gui.FeatureCollectionTableModel;  import schmitzm.geotools.gui.FeatureCollectionTableModel;
58  import schmitzm.swing.table.PipedTableModel;  import schmitzm.swing.table.PipedTableModel;
 import schmitzm.swing.table.SelectionTableModel;  
 import skrueger.geotools.selection.StyledFeatureLayerSelectionModel;  
 import skrueger.geotools.selection.StyledLayerSelectionEvent;  
 import skrueger.geotools.selection.StyledLayerSelectionModel;  
59    
60  /**  /**
61   * This class keeps the selection of a (feature) {@link JTable} synchronized   * This class keeps the selection of a (feature) {@link JTable} synchronized
# Line 167  public class TableSelectionSynchronizer Line 192  public class TableSelectionSynchronizer
192                                                    
193                          for (int i = evt.getFirstIndex(); i <= evt.getLastIndex(); i++) {                          for (int i = evt.getFirstIndex(); i <= evt.getLastIndex(); i++) {
194                                  int featureIndex = featureTable.convertRowIndexToModel(i);                                  int featureIndex = featureTable.convertRowIndexToModel(i);
195                                  Feature changedFeature = featureTableModel.getFeature(featureIndex);                                  SimpleFeature changedFeature = featureTableModel.getFeature(featureIndex);
196                                  if (featureTable.isRowSelected(i))                                  if (featureTable.isRowSelected(i))
197                                          layerSelModel.addSelection(changedFeature.getID());                                          layerSelModel.addSelection(changedFeature.getID());
198                                  else                                  else

Legend:
Removed from v.111  
changed lines
  Added in v.322

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26