Search in sources :

Example 1 with FidFilterImpl

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

the class ExpressionPanelv2 method addFilter.

/**
 * Adds the filter.
 *
 * @param node the node
 * @return the filter
 */
private Filter addFilter(FilterNode node) {
    Filter filter = node.getFilter();
    FilterConfigInterface filterConfig = node.getFilterConfig();
    if (filter instanceof LogicFilterImpl) {
        List<Filter> filterList = new ArrayList<Filter>();
        createFilterList(node, filterList);
        return filterConfig.createLogicFilter(filterList);
    }
    List<Expression> parameterFilter = new ArrayList<Expression>();
    if (filter instanceof FidFilterImpl) {
        createExpressionParameterList(node, 1, parameterFilter);
    } else if (filter instanceof BinaryTemporalOperator) {
        createExpressionParameterList(node, 2, parameterFilter);
    } else if (filter instanceof PropertyIsBetween) {
        createExpressionParameterList(node, 3, parameterFilter);
    } else if (filter instanceof PropertyIsNull) {
        createExpressionParameterList(node, 1, parameterFilter);
    } else if (filter instanceof PropertyIsLike) {
        createExpressionParameterList(node, 6, parameterFilter);
    } else if (filter instanceof BinarySpatialOperator) {
        createExpressionParameterList(node, 2, parameterFilter);
    } else if (filter instanceof BinaryComparisonAbstract) {
        if (filter instanceof Not) {
            createExpressionParameterList(node, 1, parameterFilter);
        } else if (filter instanceof PropertyIsGreaterThan) {
            createExpressionParameterList(node, 2, parameterFilter);
        } else {
            createExpressionParameterList(node, 3, parameterFilter);
        }
    } else {
        return filter;
    }
    return filterConfig.createFilter(parameterFilter);
}
Also used : PropertyIsLike(org.opengis.filter.PropertyIsLike) ArrayList(java.util.ArrayList) FilterConfigInterface(com.sldeditor.filter.v2.function.FilterConfigInterface) BinaryTemporalOperator(org.opengis.filter.temporal.BinaryTemporalOperator) Not(org.opengis.filter.Not) PropertyIsNull(org.opengis.filter.PropertyIsNull) Filter(org.opengis.filter.Filter) Expression(org.opengis.filter.expression.Expression) LogicFilterImpl(org.geotools.filter.LogicFilterImpl) FidFilterImpl(org.geotools.filter.FidFilterImpl) PropertyIsBetween(org.opengis.filter.PropertyIsBetween) BinaryComparisonAbstract(org.geotools.filter.BinaryComparisonAbstract) BinarySpatialOperator(org.opengis.filter.spatial.BinarySpatialOperator) PropertyIsGreaterThan(org.opengis.filter.PropertyIsGreaterThan)

Example 2 with FidFilterImpl

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

the class FilterPanelv2 method addFilter.

/**
 * Adds the filter.
 *
 * @param node the node
 * @return the filter
 */
private Filter addFilter(FilterNode node) {
    Filter filter = node.getFilter();
    FilterConfigInterface filterConfig = node.getFilterConfig();
    if (filter instanceof LogicFilterImpl) {
        List<Filter> filterList = new ArrayList<Filter>();
        createFilterList(node, filterList);
        return filterConfig.createLogicFilter(filterList);
    }
    List<Expression> parameterFilter = new ArrayList<Expression>();
    if (filter instanceof FidFilterImpl) {
        createExpressionParameterList(node, 1, parameterFilter);
    } else if (filter instanceof BinaryTemporalOperator) {
        createExpressionParameterList(node, 2, parameterFilter);
    } else if (filter instanceof PropertyIsBetween) {
        createExpressionParameterList(node, 3, parameterFilter);
    } else if (filter instanceof PropertyIsNull) {
        createExpressionParameterList(node, 1, parameterFilter);
    } else if (filter instanceof PropertyIsLike) {
        createExpressionParameterList(node, 6, parameterFilter);
    } else if (filter instanceof BinarySpatialOperator) {
        createExpressionParameterList(node, 2, parameterFilter);
    } else if (filter instanceof BinaryComparisonAbstract) {
        if (filter instanceof Not) {
            createExpressionParameterList(node, 1, parameterFilter);
        } else if (filter instanceof PropertyIsGreaterThan) {
            createExpressionParameterList(node, 2, parameterFilter);
        } else {
            createExpressionParameterList(node, 3, parameterFilter);
        }
    } else {
        return filter;
    }
    return filterConfig.createFilter(parameterFilter);
}
Also used : PropertyIsLike(org.opengis.filter.PropertyIsLike) ArrayList(java.util.ArrayList) FilterConfigInterface(com.sldeditor.filter.v2.function.FilterConfigInterface) BinaryTemporalOperator(org.opengis.filter.temporal.BinaryTemporalOperator) Not(org.opengis.filter.Not) PropertyIsNull(org.opengis.filter.PropertyIsNull) Filter(org.opengis.filter.Filter) Expression(org.opengis.filter.expression.Expression) LogicFilterImpl(org.geotools.filter.LogicFilterImpl) FidFilterImpl(org.geotools.filter.FidFilterImpl) PropertyIsBetween(org.opengis.filter.PropertyIsBetween) BinaryComparisonAbstract(org.geotools.filter.BinaryComparisonAbstract) BinarySpatialOperator(org.opengis.filter.spatial.BinarySpatialOperator) PropertyIsGreaterThan(org.opengis.filter.PropertyIsGreaterThan)

Aggregations

FilterConfigInterface (com.sldeditor.filter.v2.function.FilterConfigInterface)2 ArrayList (java.util.ArrayList)2 BinaryComparisonAbstract (org.geotools.filter.BinaryComparisonAbstract)2 FidFilterImpl (org.geotools.filter.FidFilterImpl)2 LogicFilterImpl (org.geotools.filter.LogicFilterImpl)2 Filter (org.opengis.filter.Filter)2 Not (org.opengis.filter.Not)2 PropertyIsBetween (org.opengis.filter.PropertyIsBetween)2 PropertyIsGreaterThan (org.opengis.filter.PropertyIsGreaterThan)2 PropertyIsLike (org.opengis.filter.PropertyIsLike)2 PropertyIsNull (org.opengis.filter.PropertyIsNull)2 Expression (org.opengis.filter.expression.Expression)2 BinarySpatialOperator (org.opengis.filter.spatial.BinarySpatialOperator)2 BinaryTemporalOperator (org.opengis.filter.temporal.BinaryTemporalOperator)2