--- trunk/src/skrueger/AttributeMetaData.java 2009/07/29 09:33:33 244
+++ branches/1.0-gt2-2.6/src/skrueger/AttributeMetadata.java 2009/11/13 18:16:38 518
@@ -2,7 +2,7 @@
* Copyright (c) 2009 Martin O. J. Schmitz.
*
* This file is part of the SCHMITZM library - a collection of utility
- * classes based on Java 1.6, focussing (not only) on Java Swing
+ * classes based on Java 1.6, focusing (not only) on Java Swing
* and the Geotools library.
*
* The SCHMITZM project is hosted at:
@@ -29,66 +29,221 @@
******************************************************************************/
package skrueger;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.log4j.Logger;
+import org.geotools.feature.NameImpl;
+import org.opengis.feature.type.AttributeDescriptor;
+import org.opengis.feature.type.Name;
+import skrueger.geotools.Copyable;
import skrueger.geotools.StyledLayerInterface;
+import skrueger.i8n.I8NUtil;
import skrueger.i8n.Translation;
/**
- * This class holds meta information about an attribute/column. This
- * information is used by {@link StyledLayerInterface}.
- *
+ * This class holds meta information about an attribute/column. This information
+ * is used by {@link StyledLayerInterface} and many others.
+ *
* @author Stefan Alfons Krüger
*/
-public class AttributeMetaData {
+public class AttributeMetadata implements Copyable,
+ Comparable {
static private final Logger LOGGER = Logger
- .getLogger(AttributeMetaData.class);
+ .getLogger(AttributeMetadata.class);
+
+ // public class WeightComparator implements Comparator
+ // {
+ //
+ // @Override
+ // public int compare(AttributeDescriptor o1, AttributeDescriptor o2) {
+ // // TODO Auto-generated method stub
+ // return 0;
+ // }
+ //
+ // };
+
+ /** Translation of the attribute's title **/
protected Translation title = new Translation();
+
+ /** Translation of the attribute's description **/
protected Translation desc = new Translation();
- protected boolean visible = false;
+
+ /** Is the attribute visible to the user or ignored where possible **/
+ protected boolean visible = true;
+
+ /**
+ * The unit append to all visualizations of values of this attribute (is not
+ * null)
+ **/
protected String unit = "";
- protected int colIdx;
+
+ /** The Name of the attribute **/
+ private Name name;
+
+ public int getWeight() {
+ return weight;
+ }
+
+ public void setWeight(int weight) {
+ this.weight = weight;
+ }
+
+ public List