use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method dashedLine.
public static MutableStyle dashedLine() throws URISyntaxException {
// general informations
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.POINT;
final Expression offset = LITERAL_ONE_FLOAT;
// the visual element
final Expression color = SF.literal(Color.BLUE);
final Expression width = FF.literal(2);
final Expression opacity = LITERAL_ONE_FLOAT;
final Expression linecap = STROKE_CAP_BUTT;
final Expression linejoin = STROKE_JOIN_ROUND;
final float[] dashes = new float[] { 8, 4, 2, 2, 2, 2, 2, 4 };
final Expression dashOffset = LITERAL_ZERO_FLOAT;
final Stroke stroke = SF.stroke(color, opacity, width, linejoin, linecap, dashes, dashOffset);
final LineSymbolizer symbolizer = SF.lineSymbolizer(name, geometry, desc, unit, stroke, offset);
final MutableStyle style = SF.style(symbolizer);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method colorLine.
public static MutableStyle colorLine() {
// general informations
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.POINT;
final Expression offset = LITERAL_ZERO_FLOAT;
// the visual element
final Expression color = SF.literal(Color.BLUE);
final Expression width = FF.literal(4);
final Expression opacity = LITERAL_ONE_FLOAT;
final Stroke stroke = SF.stroke(color, width, opacity);
final LineSymbolizer symbolizer = SF.lineSymbolizer(name, geometry, desc, unit, stroke, offset);
final MutableStyle style = SF.style(symbolizer);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method uomLine.
public static MutableStyle uomLine() throws URISyntaxException {
// general informations
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.METRE;
final Expression offset = LITERAL_ZERO_FLOAT;
// the visual element
final Expression color = SF.literal(Color.BLUE);
final Expression width = FF.literal(400);
final Expression opacity = LITERAL_ONE_FLOAT;
final Stroke stroke = SF.stroke(color, width, opacity);
final LineSymbolizer symbolizer = SF.lineSymbolizer(name, geometry, desc, unit, stroke, offset);
final MutableStyle style = SF.style(symbolizer);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method imagePoint.
public static MutableStyle imagePoint() throws URISyntaxException {
// general informations
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.POINT;
// the visual element
final Expression size = FF.literal(12);
final Expression opacity = LITERAL_ONE_FLOAT;
final Expression rotation = LITERAL_ONE_FLOAT;
final AnchorPoint anchor = DEFAULT_ANCHOR_POINT;
final Displacement disp = DEFAULT_DISPLACEMENT;
final List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
final GraphicalSymbol external = SF.externalGraphic(SF.onlineResource(Styles.class.getResource("/data/fish.png").toURI()), "image/png", null);
symbols.add(external);
final Graphic graphic = SF.graphic(symbols, opacity, size, rotation, anchor, disp);
final PointSymbolizer symbolizer = SF.pointSymbolizer(name, geometry, desc, unit, graphic);
final MutableStyle style = SF.style(symbolizer);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method customRaster.
public static MutableStyle customRaster() {
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.POINT;
final Expression opacity = LITERAL_ONE_FLOAT;
final ChannelSelection channels = null;
final OverlapBehavior overlap = null;
final ColorMap colormap = null;
final ContrastEnhancement enhance = null;
final ShadedRelief relief = null;
final Symbolizer outline = null;
final RasterSymbolizer symbol = SF.rasterSymbolizer(name, (String) null, desc, unit, opacity, channels, overlap, colormap, enhance, relief, outline);
final MutableStyle style = SF.style(symbol);
return style;
}
Aggregations