use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method linedText.
public static MutableStyle linedText() {
// 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 label = FF.property("CNTRY_NAME");
final Font font = SF.font(FF.literal("Arial"), FONT_STYLE_ITALIC, FONT_WEIGHT_BOLD, FF.literal(14));
final LabelPlacement placement = SF.linePlacement(FF.literal(0));
final Halo halo = SF.halo(Color.WHITE, 1);
final Fill fill = SF.fill(Color.BLUE);
final TextSymbolizer symbol = SF.textSymbolizer(name, geometry, desc, unit, label, font, placement, halo, fill);
final MutableStyle style = SF.style(DEFAULT_POLYGON_SYMBOLIZER, symbol);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method defaultRaster.
// ////////////////////////////////////////////////////////////////////
// RASTER SYMBOLIZER /////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////
public static MutableStyle defaultRaster() {
final RasterSymbolizer symbol = DEFAULT_RASTER_SYMBOLIZER;
final MutableStyle style = SF.style(symbol);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method offsetPolygon.
public static MutableStyle offsetPolygon() {
// we produce a gradient border effect by combining several
// symbolizer progressivly smaller
final PolygonSymbolizer symbol1 = SF.polygonSymbolizer("mySymbol", (String) null, DEFAULT_DESCRIPTION, Units.POINT, null, SF.fill(new Color(255, 0, 0)), DEFAULT_DISPLACEMENT, FF.literal(0));
final PolygonSymbolizer symbol2 = SF.polygonSymbolizer("mySymbol", (String) null, DEFAULT_DESCRIPTION, Units.POINT, null, SF.fill(new Color(255, 70, 70)), DEFAULT_DISPLACEMENT, FF.literal(-10));
final PolygonSymbolizer symbol3 = SF.polygonSymbolizer("mySymbol", (String) null, DEFAULT_DESCRIPTION, Units.POINT, null, SF.fill(new Color(255, 140, 140)), DEFAULT_DISPLACEMENT, FF.literal(-20));
final PolygonSymbolizer symbol4 = SF.polygonSymbolizer("mySymbol", (String) null, DEFAULT_DESCRIPTION, Units.POINT, null, SF.fill(new Color(255, 210, 210)), DEFAULT_DISPLACEMENT, FF.literal(-30));
final MutableStyle style = SF.style(symbol1, symbol2, symbol3, symbol4);
return style;
}
use of org.geotoolkit.style.MutableStyle in project geotoolkit by Geomatys.
the class Styles method ttfPoint.
public static MutableStyle ttfPoint() 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(32);
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 Stroke stroke = SF.stroke(Color.BLACK, 1);
final Fill fill = SF.fill(Color.RED);
final ExternalMark external = SF.externalMark(SF.onlineResource(IconBuilder.FONTAWESOME.toURI()), "ttf", FontAwesomeIcons.ICON_DICE.codePointAt(0));
final Mark mark = SF.mark(external, fill, stroke);
symbols.add(mark);
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 markPoint.
public static MutableStyle markPoint() {
// 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 Stroke stroke = SF.stroke(Color.BLACK, 2);
final Fill fill = SF.fill(Color.RED);
final Mark mark = SF.mark(MARK_CIRCLE, fill, stroke);
symbols.add(mark);
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;
}
Aggregations