Package org.geotools.styling

Examples of org.geotools.styling.Description


    }

    @Test
    public void description() {
        DescriptionBuilder b = new DescriptionBuilder();
        Description d = b.build();
        assertNull(d.getTitle());
        assertNull(d.getAbstract());

        assertNull(b.unset().build());

        b = new DescriptionBuilder();
        b.description("here be dragons");
        d = b.build();

        assertEquals("here be dragons", d.getAbstract().toString());
        assertNull(b.build().getAbstract());

        b = new DescriptionBuilder();
        b.description("here be dragons");
        d = b.build();

        assertEquals("here be dragons", d.getAbstract().toString());
    }
View Full Code Here


    public Description build() {
        if (unset) {
            return null;
        }
        Description descript = sf.description(title, description);
        if (parent == null) {
            reset();
        }
        return descript;
    }
View Full Code Here

    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {

        FeatureTypeStyle fts = (FeatureTypeStyle) super.parse(instance, node, value);
       
        if (node.hasChild("Description")) {
            Description d = (Description) node.getChildValue("Description");
            fts.getDescription().setTitle(d.getTitle());
            fts.getDescription().setAbstract(d.getAbstract());
        }
       
        //TODO: version
        if (node.hasChild("version")) {
        }
View Full Code Here

     */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {

        StyledLayerDescriptor sld =  (StyledLayerDescriptor) super.parse(instance, node, value);
        if (node.hasChild("Description")) {
            Description desc = (Description) node.getChildValue("Description");
            if (desc.getAbstract() != null) {
                sld.setAbstract(desc.getAbstract().toString());
            }
            if (desc.getTitle() != null) {
                sld.setTitle(desc.getTitle().toString());
            }
        }
        return sld;
    }
View Full Code Here

     */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        NamedStyle style = (NamedStyle) super.parse(instance, node, value);
       
        if (node.hasChild("Description")) {
            Description desc = (Description) node.getChildValue("Description");
            style.getDescription().setAbstract(desc.getAbstract());
            style.getDescription().setTitle(desc.getTitle());
        }
       
        return style;
    }
View Full Code Here

     */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        Style style = (Style) super.parse(instance, node, value);
       
        if (node.hasChild("Description")) {
            Description desc = (Description) node.getChildValue("Description");
            style.getDescription().setAbstract(desc.getAbstract());
            style.getDescription().setTitle(desc.getTitle());
        }
       
        //TODO: OnlineResource
        return style;
    }
View Full Code Here

                    Rule rule = rules[i];

                    // What's the label on this rule? We prefer to use
                    // the 'title' if it's available, but fall-back to 'name'
                    final Description description = rule.getDescription();
                    if (description != null && description.getTitle() != null) {
                        final InternationalString title = description.getTitle();
                        labels[i] = title.toString();
                    } else if (rule.getName() == null) {
                        labels[i] = rule.getName();
                    } else {
                        labels[i] = "";
View Full Code Here

    }

    private void handleStyle(StyleInfo styleInfo) {
      start("w3ds:Style");
      try {
        Description styleDescription = styleInfo.getStyle()
            .getDescription();
        InternationalString title = styleDescription.getTitle();
        if (title != null) {
          element("ows:Title", title.toString());
        }
        InternationalString abstractTxt = styleDescription
            .getAbstract();
        if (abstractTxt != null) {
          element("ows:Abstract", abstractTxt.toString());
        }
      } catch (IOException e) {
View Full Code Here

    }

    private void handleDefaultStyle(StyleInfo styleInfo) {
      start("w3ds:Style");
      try {
        Description styleDescription = styleInfo.getStyle()
            .getDescription();
        InternationalString title = styleDescription.getTitle();
        if (title != null) {
          element("ows:Title", title.toString());
        }
        InternationalString abstractTxt = styleDescription
            .getAbstract();
        if (abstractTxt != null) {
          element("ows:Abstract", abstractTxt.toString());
        }
      } catch (IOException e) {
View Full Code Here

                    Rule rule = rules[i];

                    // What's the label on this rule? We prefer to use
                    // the 'title' if it's available, but fall-back to 'name'
                    final Description description = rule.getDescription();
                    Locale locale = req.getLocale();
                   
                    if (description != null && description.getTitle() != null) {
                        final InternationalString title = description.getTitle();
                        if(locale != null) {
                          labels[i] = title.toString(locale);
                        } else {
                        labels[i] = title.toString();
                        }
View Full Code Here

TOP

Related Classes of org.geotools.styling.Description

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.