use of org.opengis.style.AnchorPoint in project geotoolkit by Geomatys.
the class DefaultStyleVisitor method visit.
@Override
public Object visit(final PointPlacement pointPlacement, Object data) {
final AnchorPoint ap = pointPlacement.getAnchorPoint();
if (ap != null) {
data = ap.accept(this, data);
}
final Displacement disp = pointPlacement.getDisplacement();
if (disp != null) {
data = disp.accept(this, data);
}
final Expression rot = pointPlacement.getRotation();
if (rot != null) {
visit(rot, data);
}
return data;
}
use of org.opengis.style.AnchorPoint in project geotoolkit by Geomatys.
the class ListingPropertyVisitor method visit.
@Override
public Object visit(final Graphic graphic, Object data) {
final AnchorPoint ac = graphic.getAnchorPoint();
if (ac != null) {
data = ac.accept(this, data);
}
final Displacement disp = graphic.getDisplacement();
if (disp != null) {
data = disp.accept(this, data);
}
final Expression opa = graphic.getOpacity();
if (opa != null) {
visit(opa, (Collection<String>) data);
}
final Expression rot = graphic.getRotation();
if (rot != null) {
visit(rot, (Collection<String>) data);
}
final Expression size = graphic.getSize();
if (size != null) {
visit(size, (Collection<String>) data);
}
final List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
if (symbols != null) {
for (GraphicalSymbol gs : symbols) {
if (gs instanceof Mark) {
data = ((Mark) gs).accept(this, data);
} else if (gs instanceof ExternalGraphic) {
data = ((ExternalGraphic) gs).accept(this, data);
}
}
}
return data;
}
use of org.opengis.style.AnchorPoint in project geotoolkit by Geomatys.
the class SE100toGTTransformer method visit.
/**
* Transform a SLD v1.0 pointplacement in GT point placement.
*/
private PointPlacement visit(final org.geotoolkit.sld.xml.v100.PointPlacement pointPlacement) {
if (pointPlacement == null)
return null;
final AnchorPoint anchor = visit(pointPlacement.getAnchorPoint());
final Displacement disp = visit(pointPlacement.getDisplacement());
final Expression rotation = visitExpression(pointPlacement.getRotation());
return styleFactory.pointPlacement(anchor, disp, rotation);
}
use of org.opengis.style.AnchorPoint in project geotoolkit by Geomatys.
the class SE100toGTTransformer method visit.
/**
* Transform a SLD v1.0 graphic in GT graphic.
*/
private Graphic visit(final org.geotoolkit.sld.xml.v100.Graphic graphic) {
if (graphic == null)
return null;
final List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
for (final Object obj : graphic.getExternalGraphicOrMark()) {
if (obj instanceof org.geotoolkit.sld.xml.v100.Mark) {
symbols.add(visit((org.geotoolkit.sld.xml.v100.Mark) obj));
} else if (obj instanceof org.geotoolkit.sld.xml.v100.ExternalGraphic) {
symbols.add(visit((org.geotoolkit.sld.xml.v100.ExternalGraphic) obj));
}
}
final Expression opacity = visitExpression(graphic.getOpacity());
final Expression size = visitExpression(graphic.getSize());
final Expression rotation = visitExpression(graphic.getRotation());
final AnchorPoint anchor = StyleConstants.DEFAULT_ANCHOR_POINT;
final Displacement disp = StyleConstants.DEFAULT_DISPLACEMENT;
return styleFactory.graphic(symbols, opacity, size, rotation, anchor, disp);
}
use of org.opengis.style.AnchorPoint in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visit.
/**
* Transform a SLD v1.1 pointplacement in GT point placement.
*/
public PointPlacement visit(final PointPlacementType pointPlacement) {
if (pointPlacement == null)
return null;
final AnchorPoint anchor = visit(pointPlacement.getAnchorPoint());
final Displacement disp = visit(pointPlacement.getDisplacement());
final Expression rotation = visitExpression(pointPlacement.getRotation());
return styleFactory.pointPlacement(anchor, disp, rotation);
}
Aggregations