Hi mailinglist,
sorry for my second post today, but it seems, that i can not solve my problem,
without a hint of the pros :-)
Here it is:
I am building a custom class from DuplicatingStlyeVisitor:
public class CustomStyleVisitor extends DuplicatingStyleVisitor {
public CustomStyleVisitor( Expression exp ) {
this.exp = exp;
}
public void visit(TextSymbolizer text) {
Fill fill = update(text.getFill());
Font[] font = text.getFonts();
Halo halo = text.getHalo();
Expression label = exp;
LabelPlacement placement = text.getLabelPlacement();
String geometryPropertyName =
text.getGeometryPropertyName();
TextSymbolizer copy = sf.createTextSymbolizer( fill,
font, halo, label, placement, geometryPropertyName );
pages.push(copy);
}
Fill update( Fill fill ) {
Expression color = ff.literal("#000000");
if( ff.less( exp, ff.literal(1.0) ).evaluate( null ) )
// does not work :-(((((((
color = ff.literal("#00FF00");
Expression opacity = fill.getOpacity();
return sf.createFill( color, opacity );
}
}
And this is how i am using this visitor:
.
.
.
CustomStyleVisitor osv = new CustomStyleVisitor( ff.property("num_val") );
areaStyle.accept(osv);
areaStyle = (Style)osv.getCopy();
.
.
.
What i want to do is, drawing the labels of the feature, depending on their
property 'num_val'.
If it is smaller than 1, the labels should be drawn green, else black.
The problem seems to be, that i can't not evaluate the lesser-relation of the
filterfactory, without the referring feature of the expression.
Is there a way around that? Am i overseeing something?
Sincerely,
Julian
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users