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

Contents of /trunk/src/skrueger/AttributeMetadataImpl.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 224 - (show annotations)
Tue Jul 14 15:57:19 2009 UTC (15 years, 7 months ago) by alfonx
Original Path: trunk/src/skrueger/AttributeMetaData.java
File size: 2410 byte(s)
* big biG BIG refactoring: StyledMap[Interface,Util,Style] never dealt with Maps (=Orchestrations of layers), but always only with single Layers. Now it has been refactored to StyledLayer[Interface,Util,Style]. 
* Some variable names and methodNames have been corrected also, but many will still be missing.
* New JARs committed
1 package skrueger;
2
3 import org.apache.log4j.Logger;
4
5 import skrueger.geotools.StyledLayerInterface;
6 import skrueger.i8n.Translation;
7
8 /**
9 * This class holds meta information about an attribute/column. This
10 * information is used by {@link StyledLayerInterface}.
11 *
12 * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>
13 */
14 public class AttributeMetaData {
15 static private final Logger LOGGER = Logger
16 .getLogger(AttributeMetaData.class);
17 protected Translation title = new Translation();
18 protected Translation desc = new Translation();
19 protected boolean visible = false;
20 protected String unit = "";
21 protected int colIdx;
22
23 /**
24 * Creates an {@link AttributeMetaData} object with the following information
25 * @param colIdx The column index of this attribute in the underlying table/dbf/etc...
26 * @param visible Shall this attribute be displayed or hidden from the user?
27 * @param title {@link Translation} for Name
28 * @param desc {@link Translation} for an attribute description
29 * @param unit {@link String} of the unit that the information is in
30 */
31 public AttributeMetaData(final int colIdx, final Boolean visible,
32 final Translation title, final Translation desc, final String unit) {
33
34 this.colIdx = colIdx;
35 this.title = title;
36 this.desc = desc;
37 if (colIdx == 0){
38 // The first attribut is THE_GEOM and shall never be visible!
39 this.visible = false;
40 }else
41 this.visible = visible;
42 this.unit = unit;
43 }
44
45 /**
46 * Creates a new visible {@link AttributeMetaData} with default (no) values.
47 */
48 public AttributeMetaData(final Integer col, final String defaultName) {
49 this(col, true, new Translation(defaultName), new Translation(), "");
50 }
51
52 public Boolean isVisible() {
53 return visible;
54 }
55
56 public void setVisible(final Boolean visible) {
57 this.visible = visible;
58 }
59
60 /** @return the index of this attribute in the underlying table/dbf **/
61 public int getColIdx() {
62 return colIdx;
63 }
64
65 public Translation getTitle() {
66 return title;
67 }
68
69 public void setTitle(final Translation title) {
70 this.title = title;
71 }
72
73 public Translation getDesc() {
74 return desc;
75 }
76
77 public void setDesc(final Translation desc) {
78 this.desc = desc;
79 }
80
81 public String getUnit() {
82 return unit;
83 }
84
85 public void setUnit(final String unit) {
86 this.unit = unit;
87 }
88 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26