use of org.opengis.filter.BinaryComparisonOperator in project polymap4-core by Polymap4.
the class NumberGradient2FilterEditor method initValues.
protected void initValues() {
annotation = (NumberRange) prop.info().getAnnotation(NumberRange.class);
df = NumberFormat.getInstance(Polymap.getSessionLocale());
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(0);
List<Mapped<Filter, N>> values = prop.get().values();
// defaults
if (values.isEmpty()) {
minimumValue = annotation.from();
maximumValue = annotation.to();
breakpoints = 10;
} else // from prop
{
And first = (And) values.get(0).key();
BinaryComparisonOperator lessThan = (BinaryComparisonOperator) first.getChildren().get(0);
propertyName = ((PropertyName) lessThan.getExpression1()).getPropertyName();
String value = (String) ((Literal) lessThan.getExpression2()).getValue();
lowerBound = Double.parseDouble(value);
And last = (And) values.get(values.size() - 1).key();
BinaryComparisonOperator greaterThan = (BinaryComparisonOperator) last.getChildren().get(0);
value = (String) ((Literal) greaterThan.getExpression2()).getValue();
upperBound = Double.parseDouble(value);
minimumValue = values.get(0).value().doubleValue();
maximumValue = values.get(values.size() - 1).value().doubleValue();
breakpoints = values.size() + 1;
}
}
use of org.opengis.filter.BinaryComparisonOperator in project polymap4-core by Polymap4.
the class AttributeLiteralFilterEditor method initValues.
protected void initValues() {
if (prop.get().filter() instanceof BinaryComparisonOperator) {
BinaryComparisonOperator filter = (BinaryComparisonOperator) prop.get().filter();
opType = filter.getClass();
propertyName = ((PropertyName) filter.getExpression1()).getPropertyName();
literal = ((Literal) filter.getExpression2()).getValue();
} else {
opType = PropertyIsEqualTo.class;
literal = "";
}
}
use of org.opengis.filter.BinaryComparisonOperator in project polymap4-core by Polymap4.
the class ColorGradient2FilterEditor method initValues.
protected void initValues() {
List<Mapped<Filter, java.awt.Color>> values = prop.get().values();
df = NumberFormat.getInstance(Polymap.getSessionLocale());
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(0);
// defaults
if (values.isEmpty()) {
minimumValue = Color.LIGHT_GRAY;
maximumValue = Color.BLACK;
breakpoints = 10;
} else // from prop
{
And first = (And) values.get(0).key();
BinaryComparisonOperator lessThan = (BinaryComparisonOperator) first.getChildren().get(0);
propertyName = ((PropertyName) lessThan.getExpression1()).getPropertyName();
String value = (String) ((Literal) lessThan.getExpression2()).getValue();
lowerBound = Double.parseDouble(value);
And last = (And) values.get(values.size() - 1).key();
BinaryComparisonOperator greaterThan = (BinaryComparisonOperator) last.getChildren().get(0);
value = (String) ((Literal) greaterThan.getExpression2()).getValue();
upperBound = Double.parseDouble(value);
// minimumValue = values.get( 0 ).value().doubleValue();
// maximumValue = values.get( values.size() - 1 ).value().doubleValue();
breakpoints = values.size() + 1;
}
}
Aggregations