/[schmitzm]/trunk/src/skrueger/AttributeMetadataInterface.java
ViewVC logotype

Annotation of /trunk/src/skrueger/AttributeMetadataInterface.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 304 - (hide annotations)
Wed Aug 19 12:03:12 2009 UTC (15 years, 6 months ago) by alfonx
Original Path: trunk/src/skrueger/AttributeMetaData.java
File size: 3738 byte(s)
* GP/Schmitzm: The org.geotools.JMapPane has been patched: 
The problem: Clicking into the map with the InfoCLick tool took very long. The algorithm has been modified to only check for hits in layers, that actually have any visible attributes. The AttributeMetaDataMap can therefore be given to the JMapPane (#setAttributeMetaDataFor(String ID, AttributeMetaDataMap amdMap). This feature is fully transparent: If no AttributeMetadata is supplied, all works as before.

* GP-Feature: The TransitionShapefileRenderer is in use again. It speeds up Shapefile rendering, but has been reported to make the GP hang. We include this feature in 1.1 again and will try to reproduce it.

* GP-Feature: Calculation of size now ignores CSV and SVN directories

1 alfonx 244 /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3     *
4     * This file is part of the SCHMITZM library - a collection of utility
5 alfonx 256 * classes based on Java 1.6, focusing (not only) on Java Swing
6 alfonx 244 * 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     package skrueger;
31    
32     import org.apache.log4j.Logger;
33    
34     import skrueger.geotools.StyledLayerInterface;
35     import skrueger.i8n.Translation;
36    
37     /**
38     * This class holds meta information about an attribute/column. This
39     * information is used by {@link StyledLayerInterface}.
40     *
41     * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>
42     */
43     public class AttributeMetaData {
44     static private final Logger LOGGER = Logger
45     .getLogger(AttributeMetaData.class);
46     protected Translation title = new Translation();
47     protected Translation desc = new Translation();
48     protected boolean visible = false;
49     protected String unit = "";
50     protected int colIdx;
51    
52     /**
53     * Creates an {@link AttributeMetaData} object with the following information
54     * @param colIdx The column index of this attribute in the underlying table/dbf/etc...
55     * @param visible Shall this attribute be displayed or hidden from the user?
56     * @param title {@link Translation} for Name
57     * @param desc {@link Translation} for an attribute description
58     * @param unit {@link String} of the unit that the information is in
59     */
60     public AttributeMetaData(final int colIdx, final Boolean visible,
61     final Translation title, final Translation desc, final String unit) {
62    
63     this.colIdx = colIdx;
64     this.title = title;
65     this.desc = desc;
66     if (colIdx == 0){
67 alfonx 304 // The first attribute is THE_GEOM and shall never be visible!
68 alfonx 244 this.visible = false;
69     }else
70     this.visible = visible;
71     this.unit = unit;
72     }
73    
74     /**
75     * Creates a new visible {@link AttributeMetaData} with default (no) values.
76     */
77     public AttributeMetaData(final Integer col, final String defaultName) {
78     this(col, true, new Translation(defaultName), new Translation(), "");
79     }
80    
81     public Boolean isVisible() {
82     return visible;
83     }
84    
85     public void setVisible(final Boolean visible) {
86     this.visible = visible;
87     }
88    
89     /** @return the index of this attribute in the underlying table/dbf **/
90     public int getColIdx() {
91     return colIdx;
92     }
93    
94     public Translation getTitle() {
95     return title;
96     }
97    
98     public void setTitle(final Translation title) {
99     this.title = title;
100     }
101    
102     public Translation getDesc() {
103     return desc;
104     }
105    
106     public void setDesc(final Translation desc) {
107     this.desc = desc;
108     }
109    
110     public String getUnit() {
111     return unit;
112     }
113    
114     public void setUnit(final String unit) {
115     this.unit = unit;
116     }
117     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26