本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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
}
示例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));
}