当前位置: 首页>>代码示例>>Java>>正文


Java Rule.setTitle方法代码示例

本文整理汇总了Java中org.geotools.styling.Rule.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Rule.setTitle方法的具体用法?Java Rule.setTitle怎么用?Java Rule.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geotools.styling.Rule的用法示例。


在下文中一共展示了Rule.setTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testReplacment

import org.geotools.styling.Rule; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.data.SelectedSymbol#removeRule(org.geotools.styling.Rule)}.
 */
@Test
public void testReplacment() {
    SelectedSymbol.destroyInstance();
    SelectedSymbol instance = SelectedSymbol.getInstance();

    Rule rule = DefaultSymbols.createNewRule();
    FeatureTypeStyle fts = DefaultSymbols.createNewFeatureTypeStyle();
    Style style = DefaultSymbols.createNewStyle();
    NamedLayer namedLayer = DefaultSymbols.createNewNamedLayer();
    StyledLayerDescriptor sld = DefaultSymbols.createNewSLD();
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();

    instance.createNewSLD(sld);

    instance.setSld(sld);

    instance.addNewStyledLayer(namedLayer);
    instance.setStyledLayer(namedLayer);
    instance.addNewStyle(style);
    instance.setStyle(style);
    instance.addNewFeatureTypeStyle(fts);
    instance.setFeatureTypeStyle(fts);
    instance.addNewRule(rule);
    instance.setRule(rule);
    instance.addSymbolizerToRule(polygonSymbolizer);
    instance.addNewRule(DefaultSymbols.createNewRule());
    instance.setSymbolizer(polygonSymbolizer);

    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    DummySLDTreeUpdated dummyTreeUpdated = new DummySLDTreeUpdated();

    instance.setTreeUpdateListener(dummyTreeUpdated);
    instance.replaceSymbolizer(lineSymbolizer);

    assertEquals(lineSymbolizer, instance.getSymbolizer());

    assertEquals(dummyTreeUpdated.objectOld, polygonSymbolizer);
    assertEquals(dummyTreeUpdated.objectNew, lineSymbolizer);

    Rule newRule = DefaultSymbols.createNewRule();
    newRule.setTitle("Replacement rule");

    instance.replaceRule(newRule);

    assertEquals(newRule, instance.getRule());
    assertNull(instance.getSymbolizer());

    FeatureTypeStyle newFts = DefaultSymbols.createNewFeatureTypeStyle();
    newFts.setName("Replacement fts");
    instance.replaceFeatureTypeStyle(newFts);

    assertEquals(newFts, instance.getFeatureTypeStyle());
    assertNull(instance.getRule());

    Style newStyle = DefaultSymbols.createNewStyle();
    newStyle.setName("Replacement style");
    instance.replaceStyle(newStyle);

    assertEquals(newStyle, instance.getStyle());
    assertNull(instance.getRule());

    NamedLayer newNamedLayer = DefaultSymbols.createNewNamedLayer();
    newNamedLayer.setName("Replacement named layer");
    instance.replaceStyledLayer(newNamedLayer);

    assertEquals(newNamedLayer, instance.getStyledLayer());
    assertNull(instance.getStyle());
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:73,代码来源:SelectedSymbolTest.java


注:本文中的org.geotools.styling.Rule.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。