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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations)
Tue Feb 24 22:43:52 2009 UTC (16 years ago) by mojays
File size: 2394 byte(s)
First Commit, corresponds to Revision 1008 of Wikisquare-SVN
includes:
- schmitzm.* (except schmitzm.test)
- org.geotools.* (all overridden classes)
- skrueger.geotools
- skrueger.i8n
- skrueger.swing
- appl.data.LateLoadable (dependency in SCHMITZM)
- appl.data.LoadingException (dependency in SCHMITZM)
- appl.util.RasterMetaData (dependency in SCHMITZM)

1 package skrueger;
2
3 import org.apache.log4j.Logger;
4
5 import skrueger.geotools.StyledMapInterface;
6 import skrueger.i8n.Translation;
7
8 /**
9 * This class holds meta information about an attribute/column. This
10 * information is used by {@link StyledMapInterface}.
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 {@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