Package org.geotools.styling

Examples of org.geotools.styling.UserLayerImpl


         * @param hints
         * @throws OperationNotSupportedException
         */
        public Object getValue( Element element, ElementValue[] value, Attributes attrs1, Map hints )
                throws OperationNotSupportedException, SAXException {
                UserLayer sld = new UserLayerImpl();
           
                for (int i = 0; i < value.length; i++) {
                    if ((value[i] == null) || value[i].getElement() == null) {
                        continue;
                    }
   
                    Element e = value[i].getElement();
                    if(elems[NAME].getName().equals(e.getName()))
                        sld.setName((String)value[i].getValue());
   
                    if(elems[REMOTEOWS].getName().equals(e.getName()))
                        sld.setRemoteOWS((RemoteOWS)value[i].getValue());
                   
                    if(elems[LAYERFEATURECONSTRAINTS].getName().equals(e.getName()))
                        sld.setLayerFeatureConstraints((FeatureTypeConstraint[])value[i].getValue());
                   
                    if(elems[USERSTYLE].getName().equals(e.getName()))
                        sld.addUserStyle((Style)value[i].getValue());
                }
               
                return sld;
        }
View Full Code Here


    else
      return null;
  }

  private StyledLayer parseUserLayer(Node root) {
    UserLayer layer = new UserLayerImpl();
    // LineSymbolizer symbol = factory.createLineSymbolizer();

    NodeList children = root.getChildNodes();
    final int length = children.getLength();
    for (int i = 0; i < length; i++) {
      Node child = children.item(i);
      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) {
        continue;
      }
      String childName = child.getLocalName();
      if (childName == null) {
        childName = child.getNodeName();
      }

      if (childName.equalsIgnoreCase("InlineFeature")) {
        parseInlineFeature(child, layer);
      } else if (childName.equalsIgnoreCase("UserStyle")) {
        Style user = parseStyle(child);
        layer.addUserStyle(user);
      } else if (childName.equalsIgnoreCase("Name")) {
        String layerName = getFirstChildValue(child);
        layer.setName(layerName);
        if (LOGGER.isLoggable(Level.INFO))
          LOGGER.info("layer name: " + layer.getName());
      } else if (childName.equalsIgnoreCase("RemoteOWS")) {
        RemoteOWS remoteOws = parseRemoteOWS(child);
        layer.setRemoteOWS(remoteOws);
      } else if (childName.equalsIgnoreCase("LayerFeatureConstraints")) {
        layer.setLayerFeatureConstraints(parseLayerFeatureConstraints(child));
      }

    }

    return layer;
View Full Code Here

TOP

Related Classes of org.geotools.styling.UserLayerImpl

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.