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


Java StyleBuilder.createExternalGraphic方法代码示例

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


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

示例1: testAccept

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigFilename field = new FieldConfigFilename(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertTrue(field.accept(externalGraphic));

    Mark marker = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:FieldConfigFilenameTest.java

示例2: testAccept

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigTTF field = new FieldConfigTTF(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker1));

    Mark marker2 = styleBuilder.createMark("ttf://Arial");
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FieldConfigTTFTest.java

示例3: testAccept

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigWKT field = new FieldConfigWKT(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("star");
    assertFalse(field.accept(marker1));

    //CHECKSTYLE:OFF
    Mark marker2 = styleBuilder.createMark(
            "wkt://MULTILINESTRING((-0.25 -0.25, -0.125 -0.25), (0.125 -0.25, 0.25 -0.25), (-0.25 0.25, -0.125 0.25), (0.125 0.25, 0.25 0.25))");
    //CHECKSTYLE:ON
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:FieldConfigWKTTest.java

示例4: testAccept

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigWindBarbs field = new FieldConfigWindBarbs(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker1));

    Mark marker2 = styleBuilder.createMark("windbarbs://default(15)[kts]");
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FieldConfigWindBarbsTest.java

示例5: featureTypeStyleExample

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
private void featureTypeStyleExample() {
    // featureTypeStyleExample start
    StyleBuilder styleBuilder = new StyleBuilder();
    Style style = styleBuilder.createStyle();
    
    PointSymbolizer pointSymbolizer = styleBuilder.createPointSymbolizer();
    
    Graphic graphic = styleBuilder.createGraphic();
    ExternalGraphic external = styleBuilder.createExternalGraphic("file:///C:/images/house.gif",
            "image/gif");
    graphic.graphicalSymbols().add(external);
    graphic.graphicalSymbols().add(styleBuilder.createMark("circle"));
    
    pointSymbolizer.setGraphic(graphic);
    
    Rule rule = styleBuilder.createRule(pointSymbolizer);
    FeatureTypeStyle featureTypeStyle = styleBuilder.createFeatureTypeStyle("Feature", rule);
    style.featureTypeStyles().add(featureTypeStyle);
    
    // featureTypeStyleExample end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:22,代码来源:StyleExamples.java

示例6: testAccept

import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker));

    List<ValueComboBoxData> dataList = new ArrayList<ValueComboBoxData>();

    dataList.add(new ValueComboBoxData("star", "Star", this.getClass()));
    dataList.add(new ValueComboBoxData("square", "Square", this.getClass()));
    dataList.add(new ValueComboBoxData("triangle", "Triangle", this.getClass()));

    List<ValueComboBoxDataGroup> groupList = new ArrayList<ValueComboBoxDataGroup>();
    groupList.add(new ValueComboBoxDataGroup(dataList));

    field.populateSymbolList(String.class, groupList);
    field.populateSymbolList(PointFillDetails.class, groupList);
    assertTrue(field.accept(marker));
    field.populateSymbolList(PointFillDetails.class, groupList);
    assertTrue(field.accept(marker));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:37,代码来源:FieldConfigMarkerTest.java


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