use of org.geotoolkit.se.xml.v110.SymbolizerType in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visitRule.
/**
* Trasnform SLD v1.1 rule in GT Rule.
*/
public MutableRule visitRule(final org.geotoolkit.se.xml.v110.RuleType rt) throws FactoryException {
final MutableRule rule = styleFactory.rule();
rule.setName(rt.getName());
rule.setDescription(visitDescription(rt.getDescription()));
rule.setElseFilter(rt.getElseFilter() != null);
rule.setFilter(visitFilter(rt.getFilter()));
rule.setLegendGraphic(visitLegend(rt.getLegendGraphic()));
rule.setMaxScaleDenominator((rt.getMaxScaleDenominator() == null) ? Double.MAX_VALUE : rt.getMaxScaleDenominator());
rule.setMinScaleDenominator((rt.getMinScaleDenominator() == null) ? 0 : rt.getMinScaleDenominator());
if (rt.getSymbolizer() == null || rt.getSymbolizer().isEmpty()) {
} else {
for (final JAXBElement<?> jax : rt.getSymbolizer()) {
final Object st = jax.getValue();
if (st == null) {
continue;
} else if (st instanceof SymbolizerType) {
rule.symbolizers().add(visit((SymbolizerType) st));
} else if (st instanceof Symbolizer) {
rule.symbolizers().add((Symbolizer) st);
}
}
}
return rule;
}
use of org.geotoolkit.se.xml.v110.SymbolizerType in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visitRanges.
// Sub elements -------------------------------------------------------------
public Map<Expression, List<Symbolizer>> visitRanges(final List<JAXBElement<RangeType>> types) {
final Map<Expression, List<Symbolizer>> ranges = new LinkedHashMap<Expression, List<Symbolizer>>();
for (final JAXBElement<RangeType> type : types) {
final RangeType rt = type.getValue();
final Expression exp = visitExpression(rt.getThreshold());
final List<Symbolizer> symbols = new ArrayList<Symbolizer>();
for (final JAXBElement<? extends SymbolizerType> jst : rt.getSymbolizer()) {
final SymbolizerType st = jst.getValue();
if (st == null)
continue;
symbols.add(visit(st));
}
ranges.put(exp, symbols);
}
return ranges;
}
use of org.geotoolkit.se.xml.v110.SymbolizerType in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visitSymbolizers.
// Symbolizers---------------------------------------------------------------
/**
* Transform a SLD v1.1 symbolizers in GT Symbolizers.
*/
public Collection<? extends Symbolizer> visitSymbolizers(final List<JAXBElement<? extends SymbolizerType>> objs) {
if (objs == null || objs.isEmpty()) {
return Collections.emptyList();
}
final Collection<Symbolizer> rs = new ArrayList<Symbolizer>();
for (JAXBElement<? extends SymbolizerType> jax : objs) {
final SymbolizerType st = jax.getValue();
if (st == null)
continue;
rs.add(visit(st));
}
return rs;
}
Aggregations