/[schmitzm]/branches/2.3.x/src/skrueger/AttributeMetadataInterface.java
ViewVC logotype

Diff of /branches/2.3.x/src/skrueger/AttributeMetadataInterface.java

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

trunk/src/skrueger/AttributeMetaData.java revision 2 by mojays, Tue Feb 24 22:43:52 2009 UTC branches/2.3.x/src/skrueger/AttributeMetadataInterface.java revision 1240 by alfonx, Fri Nov 5 13:02:30 2010 UTC
# Line 1  Line 1 
1  package skrueger;  package skrueger;
2    
3  import org.apache.log4j.Logger;  import java.util.HashSet;
4    
5  import skrueger.geotools.StyledMapInterface;  import org.opengis.feature.type.Name;
6  import skrueger.i8n.Translation;  
7    import skrueger.geotools.Copyable;
8  /**  import skrueger.i8n.Translation;
9   * This class holds meta information about an attribute/column. This  
10   * information is used by {@link StyledMapInterface}.  public interface AttributeMetadataInterface extends Copyable<AttributeMetadataInterface>,
11   *                  Comparable<AttributeMetadataInterface> {
12   * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>  
13   */          /**
14  public class AttributeMetaData {           * @return a translatable title for this attribute..
15          static private final Logger LOGGER = Logger           */
16                          .getLogger(AttributeMetaData.class);          public Translation getTitle();
17          protected Translation title = new Translation();  
18          protected Translation desc = new Translation();          /**
19          protected boolean visible = false;           * Set a translatable title for this attribute..
20          protected String unit = "";           */
21          protected int colIdx;          public void setTitle(Translation title);
22            
23          /**          /**
24           * Creates an {@link AttributeMetaData} object with the following information           * Set an untranslated title for this attribute or pass a {@link Translation} encryped as a {@link String}
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?          public void setTitle(String title);
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           * @return a translatable description for this attribute
30           */           */
31          public AttributeMetaData(final int colIdx, final Boolean visible,          public Translation getDesc();
32                          final Translation title, final Translation desc, final String unit) {  
33                    /**
34                  this.colIdx = colIdx;           * Set a translatable description for this attribute.
35                  this.title = title;           */
36                  this.desc = desc;          public void setDesc(Translation desc);
37                  if (colIdx == 0){  
38                          // The first attribut is THE_GEOM and shall never be visible!          /**
39                          this.visible = false;           * Set an untranslated description for this attribute or pass a {@link Translation} encryped as a {@link String}  
40                  }else           */
41                          this.visible = visible;          public void setDesc(String desc);
42                  this.unit = unit;  
43          }  
44            /**
45          /**           * The local name. E.g. the name of the DBF column as a {@link String}.
46           * Creates a {@link AttributeMetaData} with default (no) values.           */
47           */          public String getLocalName();
48          public AttributeMetaData(final Integer col, final String defaultName) {  
49                  this(col, true, new Translation(defaultName), new Translation(""), "");          /**
50          }           * A short form for #setName(new NameImpl(localName))
51             */
52          public Boolean isVisible() {          public void setLocalName(String localName);
53                  return visible;  
54          }          /**
55             * The fully qualified {@link Name} of the attribute, e.g.
56          public void setVisible(final Boolean visible) {           * <code>org.bla.plo:blub</code>. The second part equals the
57                  this.visible = visible;           * {@link #getLocalName()} value. The first may be <code>null</code> or
58          }           * represent the layer name.
59             */
60          /** @return the index of this attribute in the underlying table/dbf **/          public Name getName();
61          public int getColIdx() {  
62                  return colIdx;          /**
63          }           * set the fully qualified {@link Name} of this attribute.
64             */
65          public Translation getTitle() {          public void setName(Name name);
66                  return title;  
67          }          /**
68             * A list og objects that represent NODATA-values for this attribute. The
69          public void setTitle(final Translation title) {           * objects are supporsed to be correctly casted already. That means that the
70                  this.title = title;           * NODATA objects listed here have must have the same type as the values of
71          }           * this object.
72             */
73          public Translation getDesc() {          public HashSet<Object> getNodataValues();
74                  return desc;  
75          }          /**
76             * Takes any value object and checks it against the NODATA values. If the
77          public void setDesc(final Translation desc) {           * value equals a NODATA value, <code>null</code> is returned. Otherwise the
78                  this.desc = desc;           * same object is returned.
79          }           *
80             * Note: This method is called often.
81          public String getUnit() {           */
82                  return unit;          public Object fiterNodata(Object value);
83          }  
84            /**
85          public void setUnit(final String unit) {           * @return a non-translatable unit {@link String} for this attribute values.
86                  this.unit = unit;           */
87          }          public String getUnit();
88  }  
89            /**
90             * Set a unit {@link String} for this attribute values.
91             */
92            public void setUnit(String unit);
93    
94            /**
95             * @return A value defining the position of this attribute whenever the
96             *         attributes are listed to an end-user. The higher the weight, the
97             *         lower the position. (heavy goes down, light goes up)
98             */
99            public double getWeight();
100    
101            /**
102             * set a value defining the position of this attribute whenever the
103             * attributes are listed to an end-user. The higher the weight, the lower
104             * the position. (heavy goes down, light goes up)
105             */
106            public void setWeight(double weight);
107    
108            /**
109             * @return <code>false</code> if this attribute should not be selectable or
110             *         shown to the end-user.
111             */
112            public boolean isVisible();
113    
114            /**
115             * Set <code>false</code> if this attribute should not be shown to the
116             * end-user.
117             */
118            public void setVisible(boolean visible);
119    
120            String getNoDataValuesFormatted();
121    
122    }

Legend:
Removed from v.2  
changed lines
  Added in v.1240

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26