本文整理了Java中org.geotools.styling.Mark.setFill()
方法的一些代码示例,展示了Mark.setFill()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mark.setFill()
方法的具体详情如下:
包路径:org.geotools.styling.Mark
类名称:Mark
方法名:setFill
[英]This parameter defines which fill style to use when rendering the Mark.
[中]此参数定义渲染标记时要使用的填充样式。
代码示例来源:origin: geotools/geotools
@Override
protected void fill(Fill fill) {
mark.setFill(fill);
}
});
代码示例来源:origin: geoserver/geoserver
} else {
Mark mark = styleFactory.createMark();
mark.setFill(styleFactory.createFill(filterFactory.literal(color)));
代码示例来源:origin: geotools/geotools
protected MarkParser(Factory factory) {
super(factory);
mark = factory.style.createMark();
mark.setStroke(null);
mark.setFill(null);
}
代码示例来源:origin: geotools/geotools
public Mark createMark(
Expression wellKnownName,
Stroke stroke,
Fill fill,
Expression size,
Expression rotation) {
Mark mark = new MarkImpl(filterFactory, null);
if (wellKnownName == null) {
throw new IllegalArgumentException("WellKnownName can not be null in mark");
}
mark.setWellKnownName(wellKnownName);
mark.setStroke(stroke);
mark.setFill(fill);
return mark;
}
代码示例来源:origin: geotools/geotools
/**
* create a mark with the supplied fill and stroke
*
* @param wellKnownName an Expression representing the well known name of the mark
* @param fill the fill to use
* @param stroke the stroke to use
* @return the mark created
*/
public Mark createMark(Expression wellKnownName, Fill fill, Stroke stroke) {
Mark mark = sf.createMark();
mark.setWellKnownName(wellKnownName);
mark.setStroke(stroke);
mark.setFill(fill);
return mark;
}
代码示例来源:origin: geotools/geotools
mark.setFill(null);
mark.setStroke(null);
mark.setStroke(parseStroke(child));
} else if (childName.equalsIgnoreCase(fillSt)) {
mark.setFill(parseFill(child));
} else if (childName.equalsIgnoreCase("WellKnownName")) {
if (LOGGER.isLoggable(Level.FINEST))
代码示例来源:origin: geotools/geotools
/**
* create a mark with the supplied fill and stroke
*
* @param wellKnownName the well known name of the mark
* @param fill the fill to use
* @param stroke the stroke to use
* @return the mark created
*/
public Mark createMark(String wellKnownName, Fill fill, Stroke stroke) {
Mark mark = sf.createMark();
mark.setWellKnownName(literalExpression(wellKnownName));
mark.setStroke(stroke);
mark.setFill(fill);
return mark;
}
代码示例来源:origin: geotools/geotools
public void visit(Mark mark) {
Mark copy = null;
copy = sf.createMark();
copy.setFill(copy(mark.getFill()));
copy.setStroke(copy(mark.getStroke()));
copy.setWellKnownName(copy(mark.getWellKnownName()));
copy.setExternalMark(copy(mark.getExternalMark()));
if (STRICT && !copy.equals(mark)) {
throw new IllegalStateException("Was unable to duplicate provided Mark:" + mark);
}
pages.push(copy);
}
代码示例来源:origin: geotools/geotools
/**
* create a mark of the supplied color and a default outline (black)
*
* @param wellKnownName the well known name of the mark
* @param fillColor the color of the mark
* @return the created mark
*/
public Mark createMark(String wellKnownName, Color fillColor) {
Mark mark = sf.createMark();
mark.setWellKnownName(literalExpression(wellKnownName));
mark.setFill(createFill(fillColor, 1.0));
mark.setStroke(null);
return mark;
}
代码示例来源:origin: geotools/geotools
mark.setFill(fill);
代码示例来源:origin: geotools/geotools
public static Symbolizer[] getSymbolizers(
Class<? extends Geometry> type, Color baseColor, boolean useTransparency) {
StyleBuilder builder = new StyleBuilder();
Symbolizer[] syms = new Symbolizer[1];
if (LineString.class.isAssignableFrom(type) || MultiLineString.class.isAssignableFrom(type))
syms[0] = builder.createLineSymbolizer(baseColor, 2);
if (Point.class.isAssignableFrom(type) || MultiPoint.class.isAssignableFrom(type)) {
PointSymbolizer point = builder.createPointSymbolizer(builder.createGraphic());
// set graphic size to 10 by default
point.getGraphic()
.setSize(
(Expression)
CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints())
.literal(10));
// danger assumes a Mark!
point.getGraphic().getMarks()[0].setFill(builder.createFill(baseColor));
syms[0] = point;
}
if (Polygon.class.isAssignableFrom(type) || MultiPolygon.class.isAssignableFrom(type)) {
syms[0] =
builder.createPolygonSymbolizer(
builder.createStroke(baseColor, 2),
builder.createFill(baseColor, useTransparency ? .6 : 1.0));
}
return syms;
}
代码示例来源:origin: geotools/geotools
/**
* create the named mark with the colors etc supplied
*
* @param wellKnownName the well known name of the mark
* @param fillColor the color of the mark
* @param borderColor the outline color of the mark
* @param borderWidth the width of the outline
* @return the mark created
*/
public Mark createMark(
String wellKnownName, Color fillColor, Color borderColor, double borderWidth) {
Mark mark = sf.createMark();
mark.setWellKnownName(literalExpression(wellKnownName));
mark.setStroke(createStroke(borderColor, borderWidth));
mark.setFill(createFill(fillColor));
return mark;
}
代码示例来源:origin: org.geotools/gt-ysld
@Override
protected void fill(Fill fill) {
mark.setFill(fill);
}
});
代码示例来源:origin: geotools/geotools
/**
* getValue ...
*
* @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element,
* org.geotools.xml.schema.ElementValue[], org.xml.sax.Attributes, java.util.Map)
* @param element
* @param value
* @param attrs1
* @param hints
* @throws OperationNotSupportedException
*/
public Object getValue(
Element element, ElementValue[] value, Attributes attrs1, Map hints) {
Mark symbol = StyleFactoryFinder.createStyleFactory().getDefaultMark();
for (int i = 0; i < value.length; i++) {
if ((value[i] == null) || value[i].getElement() == null) {
continue;
}
Element e = value[i].getElement();
if (elems[WELLKNOWNNAME].getName().equals(e.getName()))
symbol.setWellKnownName((Expression) value[i].getValue());
if (elems[FILL].getName().equals(e.getName()))
symbol.setFill((Fill) value[i].getValue());
if (elems[STROKE].getName().equals(e.getName()))
symbol.setStroke((Stroke) value[i].getValue());
}
return symbol;
}
}
代码示例来源:origin: geotools/geotools
@Test
public void testScientificNotationCase() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Mark m1 = CommonFactoryFinder.getStyleFactory().getCircleMark();
m1.setFill(
CommonFactoryFinder.getStyleFactory()
.createFill(
CommonFactoryFinder.getFilterFactory2().literal("#112233"),
CommonFactoryFinder.getFilterFactory2()
.literal(Double.MIN_NORMAL)));
p.getGraphic().graphicalSymbols().add(m1);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.seq("symbols")
.map(0)
.map("mark");
assertThat(
kvpLine(out.toString(), "fill-opacity"),
equalTo(Double.toString(Double.MIN_NORMAL).toUpperCase()));
}
代码示例来源:origin: geotools/geotools
@Test
public void testColourCase() throws Exception {
PointSymbolizer p = CommonFactoryFinder.getStyleFactory().createPointSymbolizer();
Mark m1 = CommonFactoryFinder.getStyleFactory().getCircleMark();
m1.setFill(
CommonFactoryFinder.getStyleFactory()
.createFill(
CommonFactoryFinder.getFilterFactory2().literal("#abcdef"),
CommonFactoryFinder.getFilterFactory2()
.literal(Double.MIN_NORMAL)));
p.getGraphic().graphicalSymbols().add(m1);
StringWriter out = new StringWriter();
Ysld.encode(sld(p), out);
System.out.append(out.toString());
YamlMap obj = new YamlMap(YamlUtil.getSafeYaml().load(out.toString()));
YamlMap result =
obj.seq("feature-styles")
.map(0)
.seq("rules")
.map(0)
.seq("symbolizers")
.map(0)
.map("point")
.seq("symbols")
.map(0)
.map("mark");
assertThat(kvpLine(out.toString(), "fill-color"), equalTo("'#ABCDEF'"));
}
代码示例来源:origin: geotools/geotools
m1.setFill(
CommonFactoryFinder.getStyleFactory()
.createFill(CommonFactoryFinder.getFilterFactory2().literal("#112233")));
代码示例来源:origin: org.geotools/gt-main
public Mark createMark(Expression wellKnownName, Stroke stroke, Fill fill,
Expression size, Expression rotation) {
Mark mark = new MarkImpl(filterFactory, null);
if (wellKnownName == null) {
throw new IllegalArgumentException(
"WellKnownName can not be null in mark");
}
mark.setWellKnownName(wellKnownName);
mark.setStroke(stroke);
mark.setFill(fill);
return mark;
}
代码示例来源:origin: geotools/geotools
/** Test of createPointStyle method, of class org.geotools.renderer.style.SLDStyleFactory. */
public void testCreateCompletePointStyle() {
PointSymbolizer symb;
Mark myMark;
// full symbolizer
symb = sf.createPointSymbolizer();
myMark = sf.createMark();
myMark.setFill(sf.createFill(ff.literal("#ffff00")));
symb.getGraphic().setSize(ff.literal(10));
symb.getGraphic().addMark(myMark);
symb.getGraphic().setOpacity(ff.literal(1));
symb.getGraphic().setRotation(ff.literal(0));
sld.createPointStyle(null, symb, range);
}
代码示例来源:origin: org.geotools/gt-main
public void visit(Mark mark) {
Mark copy = null;
copy = sf.createMark();
copy.setFill(copy( mark.getFill() ));
copy.setStroke(copy( mark.getStroke() ));
copy.setWellKnownName(copy( mark.getWellKnownName() ));
if( STRICT && !copy.equals( mark )){
throw new IllegalStateException("Was unable to duplicate provided Mark:"+mark );
}
pages.push(copy);
}
内容来源于网络,如有侵权,请联系作者删除!