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

Diff of /branches/2.1/src/skrueger/AttributeMetadataInterface.java

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

revision 224 by alfonx, Tue Jul 14 15:57:19 2009 UTC revision 769 by alfonx, Sun Mar 21 11:02:34 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.StyledLayerInterface;  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 StyledLayerInterface}.  public interface AttributeMetadata extends Copyable<AttributeMetadata>,
11   *                  Comparable<AttributeMetadata> {
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           * @return a translatable description for this attribute
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 Translation getDesc();
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           * Set a translatable description for this attribute.
30           */           */
31          public AttributeMetaData(final int colIdx, final Boolean visible,          public void setDesc(Translation desc);
32                          final Translation title, final Translation desc, final String unit) {  
33                    /**
34                  this.colIdx = colIdx;           * The local name. E.g. the name of the DBF column as a {@link String}.
35                  this.title = title;           */
36                  this.desc = desc;          public String getLocalName();
37                  if (colIdx == 0){  
38                          // The first attribut is THE_GEOM and shall never be visible!          /**
39                          this.visible = false;           * A short form for #setName(new NameImpl(localName))
40                  }else           */
41                          this.visible = visible;          public void setLocalName(String localName);
42                  this.unit = unit;  
43          }          /**
44             * The fully qualified {@link Name} of the attribute, e.g.
45          /**           * <code>org.bla.plo:blub</code>. The second part equals the
46           * Creates a new visible {@link AttributeMetaData} with default (no) values.             * {@link #getLocalName()} value. The first may be <code>null</code> or
47           */           * represent the layer name.
48          public AttributeMetaData(final Integer col, final String defaultName) {           */
49                  this(col, true, new Translation(defaultName), new Translation(), "");          public Name getName();
50          }  
51            /**
52          public Boolean isVisible() {           * set the fully qualified {@link Name} of this attribute.
53                  return visible;           */
54          }          public void setName(Name name);
55    
56          public void setVisible(final Boolean visible) {          /**
57                  this.visible = visible;           * A list og objects that represent NODATA-values for this attribute. The
58          }           * objects are supporsed to be correctly casted already. That means that the
59             * NODATA objects listed here have must have the same type as the values of
60          /** @return the index of this attribute in the underlying table/dbf **/           * this object.
61          public int getColIdx() {           */
62                  return colIdx;          public HashSet<Object> getNodataValues();
63          }  
64            /**
65          public Translation getTitle() {           * Takes any value object and checks it against the NODATA values. If the
66                  return title;           * value equals a NODATA value, <code>null</code> is returned. Otherwise the
67          }           * same object is returned.
68             *
69          public void setTitle(final Translation title) {           * Note: This method is called often.
70                  this.title = title;           */
71          }          public Object fiterNodata(Object value);
72    
73          public Translation getDesc() {          /**
74                  return desc;           * @return a non-translatable unit {@link String} for this attribute values.
75          }           */
76            public String getUnit();
77          public void setDesc(final Translation desc) {  
78                  this.desc = desc;          /**
79          }           * Set a unit {@link String} for this attribute values.
80             */
81          public String getUnit() {          public void setUnit(String unit);
82                  return unit;  
83          }          /**
84             * @return A value defining the position of this attribute whenever the
85          public void setUnit(final String unit) {           *         attributes are listed to an end-user. The higher the weight, the
86                  this.unit = unit;           *         lower the position. (heavy goes down, light goes up)
87          }           */
88  }          public double getWeight();
89    
90            /**
91             * set a value defining the position of this attribute whenever the
92             * attributes are listed to an end-user. The higher the weight, the lower
93             * the position. (heavy goes down, light goes up)
94             */
95            public void setWeight(double weight);
96    
97            /**
98             * @return <code>false</code> if this attribute should not be selectable or
99             *         shown to the end-user.
100             */
101            public boolean isVisible();
102    
103            /**
104             * Set <code>false</code> if this attribute should not be shown to the
105             * end-user.
106             */
107            public void setVisible(boolean visible);
108    
109            String getNoDataValuesFormatted();
110    
111    }

Legend:
Removed from v.224  
changed lines
  Added in v.769

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26