Search in sources :

Example 16 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project sldeditor by robward-scisys.

the class IsGreaterThanEqualTo method createFilter.

/**
 * Creates the filter.
 *
 * @param parameterList the parameter list
 * @return the filter
 */
@Override
public Filter createFilter(List<Expression> parameterList) {
    IsGreaterThanOrEqualToImpl filter = null;
    if ((parameterList == null) || (parameterList.size() < 2) || (parameterList.size() > 3)) {
        filter = new IsGreaterThanOrEqualToExtended();
    } else {
        LiteralExpressionImpl matchCase = (LiteralExpressionImpl) parameterList.get(2);
        filter = new IsGreaterThanOrEqualToExtended(parameterList.get(0), parameterList.get(1), (Boolean) matchCase.getValue());
    }
    return filter;
}
Also used : LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) IsGreaterThanOrEqualToImpl(org.geotools.filter.IsGreaterThanOrEqualToImpl)

Example 17 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project sldeditor by robward-scisys.

the class IsNotEqualTo method createFilter.

/**
 * Creates the filter.
 *
 * @param parameterList the parameter list
 * @return the filter
 */
@Override
public Filter createFilter(List<Expression> parameterList) {
    IsNotEqualToImpl filter = null;
    if ((parameterList == null) || (parameterList.size() != 3)) {
        filter = new IsNotEqualToExtended();
    } else {
        LiteralExpressionImpl matchCase = (LiteralExpressionImpl) parameterList.get(2);
        filter = new IsNotEqualToExtended(parameterList.get(0), parameterList.get(1), (Boolean) matchCase.getValue());
    }
    return filter;
}
Also used : LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) IsNotEqualToImpl(org.geotools.filter.IsNotEqualToImpl)

Example 18 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project sldeditor by robward-scisys.

the class IsLessThanEqualTo method createFilter.

/**
 * Creates the filter.
 *
 * @param parameterList the parameter list
 * @return the filter
 */
@Override
public Filter createFilter(List<Expression> parameterList) {
    IsLessThenOrEqualToImpl filter = null;
    if ((parameterList == null) || (parameterList.size() < 2) || (parameterList.size() > 3)) {
        filter = new IsLessThanOrEqualToExtended();
    } else {
        LiteralExpressionImpl matchCase = (LiteralExpressionImpl) parameterList.get(2);
        filter = new IsLessThanOrEqualToExtended(parameterList.get(0), parameterList.get(1), (Boolean) matchCase.getValue());
    }
    return filter;
}
Also used : LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) IsLessThenOrEqualToImpl(org.geotools.filter.IsLessThenOrEqualToImpl)

Example 19 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project sldeditor by robward-scisys.

the class IsEqualTo method createFilter.

/**
 * Creates the filter.
 *
 * @param parameterList the parameter list
 * @return the filter
 */
@Override
public Filter createFilter(List<Expression> parameterList) {
    IsEqualsToImpl filter = null;
    if ((parameterList == null) || (parameterList.size() != 3)) {
        filter = new IsEqualToExtended();
    } else {
        LiteralExpressionImpl matchCase = (LiteralExpressionImpl) parameterList.get(2);
        filter = new IsEqualToExtended(parameterList.get(0), parameterList.get(1), (Boolean) matchCase.getValue());
    }
    return filter;
}
Also used : LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) IsEqualsToImpl(org.geotools.filter.IsEqualsToImpl)

Example 20 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project sldeditor by robward-scisys.

the class StrokeDetails method getStrokeDashArray.

/**
 * Gets the stroke dash array.
 *
 * @param stroke the stroke
 * @return the stroke dash array
 */
private List<Float> getStrokeDashArray(Stroke stroke) {
    List<Expression> expressionList = stroke.dashArray();
    List<Float> valueList = new ArrayList<>();
    if (expressionList != null) {
        for (Expression expression : expressionList) {
            if (expression instanceof LiteralExpressionImpl) {
                LiteralExpressionImpl lExpression = (LiteralExpressionImpl) expression;
                Float objValue = null;
                if (lExpression.getValue() instanceof Float) {
                    objValue = (Float) lExpression.getValue();
                } else if (lExpression.getValue() instanceof Double) {
                    objValue = ((Double) lExpression.getValue()).floatValue();
                }
                valueList.add(objValue);
            } else if (expression instanceof ConstantExpression) {
                ConstantExpression cExpression = (ConstantExpression) expression;
                Float objValue = (Float) cExpression.getValue();
                valueList.add(objValue);
            }
        }
    }
    return valueList;
}
Also used : ConstantExpression(org.geotools.filter.ConstantExpression) Expression(org.opengis.filter.expression.Expression) LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) ConstantExpression(org.geotools.filter.ConstantExpression) ArrayList(java.util.ArrayList)

Aggregations

LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)58 Expression (org.opengis.filter.expression.Expression)33 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)20 AttributeType (ddf.catalog.data.AttributeType)7 MathExpressionImpl (org.geotools.filter.MathExpressionImpl)7 FunctionExpressionImpl (org.geotools.filter.FunctionExpressionImpl)6 MarkImpl (org.geotools.styling.MarkImpl)6 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)5 ArrayList (java.util.ArrayList)4 Date (java.util.Date)4 ConstantExpression (org.geotools.filter.ConstantExpression)4 IsEqualsToImpl (org.geotools.filter.IsEqualsToImpl)4 Literal (org.opengis.filter.expression.Literal)4 XMLFieldLiteralString (com.sldeditor.common.xml.ui.XMLFieldLiteralString)3 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)3 Color (java.awt.Color)3 Geometry (org.locationtech.jts.geom.Geometry)3 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)2 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)2 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)2