/[schmitzm]/trunk/src/skrueger/geotools/StyledLayerUtil.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/StyledLayerUtil.java

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

revision 770 by alfonx, Sun Mar 21 11:36:11 2010 UTC revision 772 by alfonx, Sun Mar 21 14:05:26 2010 UTC
# Line 92  import schmitzm.io.IOUtil; Line 92  import schmitzm.io.IOUtil;
92  import schmitzm.lang.LangUtil;  import schmitzm.lang.LangUtil;
93  import schmitzm.swing.JPanel;  import schmitzm.swing.JPanel;
94  import schmitzm.swing.SwingUtil;  import schmitzm.swing.SwingUtil;
95  import skrueger.AttributeMetadata;  import skrueger.AttributeMetadataInterface;
96  import skrueger.AttributeMetadataImpl;  import skrueger.AttributeMetadataImpl;
97  import skrueger.RasterLegendData;  import skrueger.RasterLegendData;
98  import skrueger.i8n.Translation;  import skrueger.i8n.Translation;
# Line 254  public class StyledLayerUtil { Line 254  public class StyledLayerUtil {
254           *            TODO replace with           *            TODO replace with
255           *            {@link AttributeMetadataMap#sortedValuesVisibleOnly()}           *            {@link AttributeMetadataMap#sortedValuesVisibleOnly()}
256           */           */
257          public static AttributeMetadataMap<? extends AttributeMetadata > getVisibleAttributeMetaData(          public static AttributeMetadataMap<? extends AttributeMetadataInterface > getVisibleAttributeMetaData(
258                          final AttributeMetadataMap<? extends AttributeMetadata> amdMap,                          final AttributeMetadataMap<? extends AttributeMetadataInterface> amdMap,
259                          final boolean visible) {                          final boolean visible) {
260    
261                  final AttributeMetadataMap<AttributeMetadata> filteredMap = (AttributeMetadataMap<AttributeMetadata>) amdMap.clone();                  final AttributeMetadataMap<AttributeMetadataInterface> filteredMap = (AttributeMetadataMap<AttributeMetadataInterface>) amdMap.clone();
262                  if (filteredMap.size() > 0 ) {                  if (filteredMap.size() > 0 ) {
263                          filteredMap.clear(); // Just in case the close copies the contents                          filteredMap.clear(); // Just in case the close copies the contents
264                  }                  }
265                                    
266                  for (final AttributeMetadata amd : amdMap.values())                  for (final AttributeMetadataInterface amd : amdMap.values())
267                          if (amd.isVisible() == visible)                          if (amd.isVisible() == visible)
268                                  filteredMap.put(amd.getName(), amd);                                  filteredMap.put(amd.getName(), amd);
269    
# Line 358  public class StyledLayerUtil { Line 358  public class StyledLayerUtil {
358           *            classes. (SK, 3.2.2010)           *            classes. (SK, 3.2.2010)
359           */           */
360          public static Element createAttributeMetaDataElement(          public static Element createAttributeMetaDataElement(
361                          final AttributeMetadata amd) {                          final AttributeMetadataInterface amd) {
362                  final Element element = new Element(ELEM_NAME_ATTRIBUTE, AMLURI);                  final Element element = new Element(ELEM_NAME_ATTRIBUTE, AMLURI);
363                  element.setAttribute("namespace", String.valueOf(amd.getName()                  element.setAttribute("namespace", String.valueOf(amd.getName()
364                                  .getNamespaceURI()));                                  .getNamespaceURI()));
# Line 380  public class StyledLayerUtil { Line 380  public class StyledLayerUtil {
380           *            map of attribute meta data           *            map of attribute meta data
381           */           */
382          public static Element createAttributeMetaDataMapElement(          public static Element createAttributeMetaDataMapElement(
383                          final AttributeMetadataMap<? extends AttributeMetadata> amdMap) {                          final AttributeMetadataMap<? extends AttributeMetadataInterface> amdMap) {
384                  final Element element = new Element(ELEM_NAME_AMD, AMLURI);                  final Element element = new Element(ELEM_NAME_AMD, AMLURI);
385                  for (final AttributeMetadata amd : amdMap.values())                  for (final AttributeMetadataInterface amd : amdMap.values())
386                          element.addContent(createAttributeMetaDataElement(amd));                          element.addContent(createAttributeMetaDataElement(amd));
387                  return element;                  return element;
388          }          }
# Line 1260  public class StyledLayerUtil { Line 1260  public class StyledLayerUtil {
1260                  // 1. Check.. all attributes in the atm should be in the schema as well.                  // 1. Check.. all attributes in the atm should be in the schema as well.
1261                  // maybe correct some upperCase/loweCase stuff                  // maybe correct some upperCase/loweCase stuff
1262    
1263                  for (AttributeMetadata atm : attributeMetaDataMap.values()) {                  for (AttributeMetadataInterface atm : attributeMetaDataMap.values()) {
1264    
1265                          AttributeDescriptor foundDescr = schema                          AttributeDescriptor foundDescr = schema
1266                                          .getDescriptor(atm.getName());                                          .getDescriptor(atm.getName());
# Line 1306  public class StyledLayerUtil { Line 1306  public class StyledLayerUtil {
1306           * @param schema           * @param schema
1307           */           */
1308          public static void addEmptyStringToAllTextualAttributes(          public static void addEmptyStringToAllTextualAttributes(
1309                          AttributeMetadataMap<? extends AttributeMetadata> attributeMetaDataMap,                          AttributeMetadataMap<? extends AttributeMetadataInterface> attributeMetaDataMap,
1310                          SimpleFeatureType schema) {                          SimpleFeatureType schema) {
1311    
1312                  for (Name name : attributeMetaDataMap.keySet()) {                  for (Name name : attributeMetaDataMap.keySet()) {
# Line 1319  public class StyledLayerUtil { Line 1319  public class StyledLayerUtil {
1319    
1320          /**          /**
1321           * @return a nicely formatted String containing all NODATA values of any           * @return a nicely formatted String containing all NODATA values of any
1322           *         {@link AttributeMetadata} object. Strings are quoted so that any           *         {@link AttributeMetadataInterface} object. Strings are quoted so that any
1323           *         empty {@link String} can be seen.           *         empty {@link String} can be seen.
1324           */           */
1325          public static String formatNoDataValues(Set<Object> nodataValuesList) {          public static String formatNoDataValues(Set<Object> nodataValuesList) {

Legend:
Removed from v.770  
changed lines
  Added in v.772

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26