本文整理汇总了Java中org.geotools.styling.StyleBuilder.createStroke方法的典型用法代码示例。如果您正苦于以下问题:Java StyleBuilder.createStroke方法的具体用法?Java StyleBuilder.createStroke怎么用?Java StyleBuilder.createStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.styling.StyleBuilder
的用法示例。
在下文中一共展示了StyleBuilder.createStroke方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStroke
import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
* TODO summary sentence for setStroke ...
*
* @param line
* @param mode
* @param defaultColor
*/
public void setStroke(final Stroke aLine, final Mode mode, final Color defaultColor) {
listen(false);
try {
boolean enabled = true;
Stroke line = aLine;
if ( line == null ) {
final StyleBuilder builder = new StyleBuilder();
line = builder.createStroke(defaultColor);
enabled = false;
}
this.enabled = enabled && mode != Mode.NONE && line != null;
this.color = SLD.color(line);
this.width = SLD.width(line);
this.opacity = SLD.opacity(line);
// Stroke is used in line, point and polygon
this.on.setEnabled(mode != Mode.NONE);
this.chooser.setColor(this.color);
String text = MessageFormat.format("{0,number,#0}", this.width); //$NON-NLS-1$
this.size.setText(text);
this.size.select(this.size.indexOf(text));
text = MessageFormat.format("{0,number,#0%}", this.opacity); //$NON-NLS-1$
this.percent.setText(text);
this.percent.select(this.percent.indexOf(text));
this.on.setSelection(this.enabled);
this.chooser.setEnabled(this.enabled);
this.size.setEnabled(this.enabled);
this.percent.setEnabled(this.enabled);
} finally {
listen(true); // listen to user now
}
}
示例2: getStroke
import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
/**
* TODO summary sentence for getStroke ...
* @param build
*
* @return Stroke defined by this model
*/
public Stroke getStroke(final StyleBuilder build) {
if ( !this.enabled )
return null;
if ( !Double.isNaN(this.opacity) ) { return build.createStroke(this.color, this.width, this.opacity); }
if ( !Double.isNaN(this.width) ) { return build.createStroke(this.color, this.width); }
return build.createStroke(this.color);
}
示例3: createPolygonSymbolizer
import org.geotools.styling.StyleBuilder; //导入方法依赖的package包/类
private static PolygonSymbolizer createPolygonSymbolizer(
StyleBuilder styleBuilder, Color color) {
Fill fill = styleBuilder.createFill(color);
Stroke stroke = styleBuilder.createStroke(color, 1d);
return styleBuilder.createPolygonSymbolizer(stroke, fill);
}