Package org.geotools.styling

Examples of org.geotools.styling.NamedStyle


      } catch (javax.xml.parsers.ParserConfigurationException pce) {
        throw new RuntimeException(pce);
      }
    }

    NamedStyle style = factory.createNamedStyle();

    NodeList children = n.getChildNodes();
    final int length = children.getLength();
    if (LOGGER.isLoggable(Level.FINEST)) {
      LOGGER.finest("" + children.getLength() + " children to process");
    }

    for (int j = 0; j < length; j++) {
      Node child = children.item(j);

      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)
          || (child.getFirstChild() == null)) {
        continue;
      }
      if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("processing " + child.getLocalName());
      }
      String childName = child.getLocalName();
      if (childName == null) {
        childName = child.getNodeName();
      }
      if (childName.equalsIgnoreCase("Name")) {
        style.setName(getFirstChildValue(child));
      }
    }
    return style;
  }
View Full Code Here


    private Style getDefaultStyle (LayerInfo layer) throws IOException{
        if (layer.getResource() instanceof WMSLayerInfo) {
            // NamedStyle is a subclass of Style -> we use it as a way to convey
            // cascaded WMS layer styles
            NamedStyle namedStyle = CommonFactoryFinder.getStyleFactory(null)
                    .createNamedStyle();
            namedStyle.setName(null);
            return namedStyle;
        } else {
            StyleInfo defaultStyle = layer.getDefaultStyle();
            return defaultStyle.getStyle();
        }
View Full Code Here

TOP

Related Classes of org.geotools.styling.NamedStyle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.