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

Annotation of /branches/1.0-gt2-2.6/src/skrueger/geotools/labelsearch/SearchResultTableModel.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations)
Sat Jun 20 12:48:24 2009 UTC (15 years, 8 months ago) by alfonx
Original Path: trunk/src/skrueger/geotools/labelsearch/SearchResultTableModel.java
File MIME type: text/plain
File size: 1563 byte(s)
* Organized Imports
* Fixed a BuG in AS, PolygonSymbolEditGUI (Had to be Float instead of Double)
* Renamed DesignLayerPanel to DesginMapLegend etc...
* Bugfixed ManageLayerSytlesForMapDialog to trigger a preview of the new legend.
1 alfonx 139 package skrueger.geotools.labelsearch;
2    
3     import java.util.List;
4    
5     import javax.swing.table.TableModel;
6    
7     import schmitzm.swing.table.AbstractTableModel;
8    
9     /**
10     * A {@link TableModel} which presents a {@link List} of {@link SearchResult}s.
11     * by the time of writing, {@link SearchResult}'s only concrete class is
12     * {@link SearchResultFeature}, but others might follow that reference to a Map or a DpEntry.<br/>
13     * The three columns of this {@link TableModel} are: result number, full name,
14     * name of layer containing the result
15     *
16     * @author Stefan A. Krueger
17     *
18     */
19     public class SearchResultTableModel extends AbstractTableModel implements
20     TableModel {
21    
22     private final List<SearchResult> searchResultsList;
23    
24     public SearchResultTableModel(List<SearchResult> searchResultsList) {
25     this.searchResultsList = searchResultsList;
26     }
27    
28     @Override
29     /*
30     * The three columns of this {@link TableModel} are: full
31     * name, name of layer containing the result
32     */
33     public int getColumnCount() {
34     return 2;
35     }
36    
37     @Override
38     public int getRowCount() {
39     return searchResultsList.size();
40     }
41    
42     @Override
43     public Object getValueAt(int row, int column) {
44     // if (column == 0) {
45     // return row + 1;
46     // } else
47     if (column == 0) {
48     return searchResultsList.get(row).getTitle();
49    
50     } else if (column == 1) {
51     return searchResultsList.get(row).getInTitle();
52    
53     } else return null;
54     }
55    
56     @Override
57     public String[] createColumnNames() {
58     return new String[] {LabelSearch.R("SearchMapDialog.Results.Column.Name"), LabelSearch.R("SearchMapDialog.Results.Column.Layer")};
59     }
60    
61     }

Properties

Name Value
svn:eol-style native
svn:keywords Id
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26