org.geotools.styling.Rule.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中org.geotools.styling.Rule.getDescription方法的一些代码示例,展示了Rule.getDescription的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.getDescription方法的具体详情如下:
包路径:org.geotools.styling.Rule
类名称:Rule
方法名:getDescription

Rule.getDescription介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

assertEquals(
    "raster",
    fts.rules().get(0).getDescription().getTitle().toString());
assertEquals(
    "orange polygon",
    fts.rules().get(1).getDescription().getTitle().toString());
assertEquals(
    "orange line",
    fts.rules().get(2).getDescription().getTitle().toString());
assertEquals(
    "orange point",
    fts.rules().get(3).getDescription().getTitle().toString());

代码示例来源:origin: geotools/geotools

rule.setName(getFirstChildValue(child));
} else if (childName.equalsIgnoreCase("Title")) {
  rule.getDescription().setTitle(parseInternationalString(child));
} else if (childName.equalsIgnoreCase("Abstract")) {
  rule.getDescription().setAbstract(parseInternationalString(child));
} else if (childName.equalsIgnoreCase("MinScaleDenominator")) {
  rule.setMinScaleDenominator(Double.parseDouble(getFirstChildValue(child)));

代码示例来源:origin: geotools/geotools

public void visit(Rule rule) {
  start("Rule");
  if (rule.getName() != null) element("Name", rule.getName());
  if (rule.getDescription() != null && rule.getDescription().getTitle() != null)
    element("Title", rule.getDescription().getTitle());
  if (rule.getDescription() != null && rule.getDescription().getAbstract() != null)
    element("Abstract", rule.getDescription().getAbstract());

代码示例来源:origin: geotools/geotools

rule.getDescription().setTitle((InternationalString) node.getChildValue("Title"));
rule.getDescription().setAbstract((InternationalString) node.getChildValue("Abstract"));

代码示例来源:origin: geotools/geotools

Description descCopy = rule.getDescription();
descCopy = copy(descCopy);

代码示例来源:origin: org.geoserver/gs-wms

@Override
  public void visit(Rule rule) {
    super.visit(rule);
    Rule copy = (Rule) pages.peek();
    Description description =
        new DescriptionImpl(
            new SimpleInternationalString(targetLabel),
            copy.getDescription() != null
                ? copy.getDescription().getAbstract()
                : null);
    copy.setDescription(description);
  }
}

代码示例来源:origin: org.geotools/gt-main

rule.setName(getFirstChildValue(child));
} else if (childName.equalsIgnoreCase("Title")) {
  rule.getDescription().setTitle(parseInternationalString(child));
} else if (childName.equalsIgnoreCase("Abstract")) {
  rule.getDescription().setAbstract(parseInternationalString(child));
} else if (childName.equalsIgnoreCase("MinScaleDenominator")) {
  rule.setMinScaleDenominator(Double

代码示例来源:origin: org.geoserver/gs-wms

Description descCopy = rule.getDescription();
descCopy = copy(descCopy);

代码示例来源:origin: org.geotools/gt-main

public void visit(Rule rule) {
  start("Rule");
  if (rule.getName() != null) element("Name", rule.getName());
  if (rule.getDescription() != null
      && rule.getDescription().getTitle() != null)
    element("Title", rule.getDescription().getTitle());
  if (rule.getDescription() != null
      && rule.getDescription().getAbstract() != null)
    element("Abstract", rule.getDescription().getAbstract());

代码示例来源:origin: org.geoserver/gs-wms

static String getRuleLabel(Rule rule, GetLegendGraphicRequest req) {
    // 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();

    String label = "";
    if (description != null && description.getTitle() != null) {
      final InternationalString title = description.getTitle();
      if (req.getLocale() != null) {
        label = title.toString(req.getLocale());
      } else {
        label = title.toString();
      }
    } else if (rule.getName() != null) {
      label = rule.getName();
    }
    return label;
  }
}

代码示例来源:origin: robward-scisys/sldeditor

Description descCopy = rule.getDescription();
descCopy = copy(descCopy);

代码示例来源:origin: org.geotools.xsd/gt-xsd-sld

rule.getDescription().setTitle(
    (InternationalString) node.getChildValue("Title"));
rule.getDescription().setAbstract(
    (InternationalString) node.getChildValue("Abstract"));

代码示例来源:origin: org.geotools/gt-main

Description descCopy = rule.getDescription();
descCopy = copy(descCopy);

代码示例来源:origin: org.geoserver.community/gs-ysld

@Override
  public Void answer() throws Throwable {
    Object[] args = getCurrentArguments();
    InputStream is = (InputStream) args[1];
    StyledLayerDescriptor sld = handler.parse(is, null, null, null);
    assertEquals(1, sld.getStyledLayers().length);
    NamedLayer nl = (NamedLayer) sld.getStyledLayers()[0];
    assertEquals(1, nl.getStyles().length);
    Style style = nl.getStyles()[0];
    assertEquals(1, style.featureTypeStyles().size());
    FeatureTypeStyle fts = style.featureTypeStyles().get(0);
    assertEquals(4, fts.rules().size());
    assertEquals("raster", fts.rules().get(0).getDescription().getTitle().toString());
    assertEquals("orange polygon",
        fts.rules().get(1).getDescription().getTitle().toString());
    assertEquals("orange line",
        fts.rules().get(2).getDescription().getTitle().toString());
    assertEquals("orange point",
        fts.rules().get(3).getDescription().getTitle().toString());
    for (org.geotools.styling.Rule r : fts.rules()) {
      assertEquals(1, r.getSymbolizers().length);
    }
    return null;
  }
});

相关文章