use of org.geotoolkit.se.xml.v110.GraphicType in project geotoolkit by Geomatys.
the class GTtoSE110Transformer method visit.
/**
* transform a GT graphic in jaxb graphic
*/
@Override
public GraphicType visit(final Graphic graphic, final Object data) {
final GraphicType gt = se_factory.createGraphicType();
gt.setAnchorPoint(visit(graphic.getAnchorPoint(), null));
for (final GraphicalSymbol gs : graphic.graphicalSymbols()) {
if (gs instanceof Mark) {
final Mark mark = (Mark) gs;
gt.getExternalGraphicOrMark().add(visit(mark, null));
} else if (gs instanceof ExternalMark) {
final ExternalMark ext = (ExternalMark) gs;
gt.getExternalGraphicOrMark().add(visit(ext, null));
} else if (gs instanceof ExternalGraphic) {
final ExternalGraphic ext = (ExternalGraphic) gs;
gt.getExternalGraphicOrMark().add(visit(ext, null));
}
}
gt.setDisplacement(visit(graphic.getDisplacement(), null));
gt.setOpacity(visitExpression(graphic.getOpacity()));
gt.setRotation(visitExpression(graphic.getRotation()));
gt.setSize(visitExpression(graphic.getSize()));
return gt;
}
use of org.geotoolkit.se.xml.v110.GraphicType in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visit.
/**
* Transform a SLD v1.1 graphic in GT graphic.
*/
public Graphic visit(final GraphicType graphic) {
if (graphic == null)
return null;
final List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
for (final Object obj : graphic.getExternalGraphicOrMark()) {
if (obj instanceof MarkType) {
symbols.add(visit((MarkType) obj));
} else if (obj instanceof ExternalGraphicType) {
symbols.add(visit((ExternalGraphicType) obj));
}
}
final Expression opacity = visitExpression(graphic.getOpacity());
final Expression size = visitExpression(graphic.getSize());
final Expression rotation = visitExpression(graphic.getRotation());
final AnchorPoint anchor = visit(graphic.getAnchorPoint());
final Displacement disp = visit(graphic.getDisplacement());
return styleFactory.graphic(symbols, opacity, size, rotation, anchor, disp);
}
Aggregations