use of com.sldeditor.filter.v2.function.logic.Not 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);
}
use of com.sldeditor.filter.v2.function.logic.Not 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);
}
use of com.sldeditor.filter.v2.function.logic.Not in project sldeditor by robward-scisys.
the class SLDEditorFileHandler method extractEnvironmentVariables.
/**
* Extract environment variables.
*
* @param document the document
* @param envvarElement the environment variable element
* @return the list
*/
private List<EnvVar> extractEnvironmentVariables(Document document, String elementName) {
List<EnvVar> list = new ArrayList<EnvVar>();
NodeList nodeList = document.getElementsByTagName(elementName);
for (int index = 0; index < nodeList.getLength(); index++) {
Element element = (Element) nodeList.item(index);
Class<?> type = null;
try {
type = Class.forName(element.getAttribute(ENVVAR_TYPE_ATTRIBUTE));
} catch (ClassNotFoundException e) {
ConsoleManager.getInstance().exception(this, e);
}
// Assume not predefined, will get sorted out later
EnvVar envVar = new EnvVar(element.getAttribute(ENVVAR_NAME_ATTRIBUTE), type, false);
if (element.hasAttribute(ENVVAR_VALUE_ATTRIBUTE)) {
envVar.setValue(element.getAttribute(ENVVAR_VALUE_ATTRIBUTE));
}
list.add(envVar);
}
return list;
}
use of com.sldeditor.filter.v2.function.logic.Not in project sldeditor by robward-scisys.
the class FilterManager method getFilterConfigList.
/**
* Gets the filter config list.
*
* @return the filter config list
*/
@Override
public List<FilterConfigInterface> getFilterConfigList() {
List<FilterConfigInterface> filterConfigList = new ArrayList<FilterConfigInterface>();
// Logic filters
filterConfigList.add(new And());
filterConfigList.add(new Or());
filterConfigList.add(new Not());
filterConfigList.add(new IsEqualTo());
filterConfigList.add(new IsNotEqualTo());
filterConfigList.add(new IsLessThan());
filterConfigList.add(new IsLessThanEqualTo());
filterConfigList.add(new IsGreaterThan());
filterConfigList.add(new IsGreaterThanEqualTo());
filterConfigList.add(new IsBetween());
filterConfigList.add(new IsNull());
filterConfigList.add(new IsLike());
// Temporal
filterConfigList.add(new After());
filterConfigList.add(new Before());
filterConfigList.add(new During());
filterConfigList.add(new TEquals());
filterConfigList.add(new TOverlaps());
filterConfigList.add(new TContains());
// Geometry
filterConfigList.add(new BBox());
filterConfigList.add(new Beyond());
filterConfigList.add(new Contains());
filterConfigList.add(new Crosses());
filterConfigList.add(new Disjoint());
filterConfigList.add(new DWithin());
filterConfigList.add(new Equals());
filterConfigList.add(new Intersects());
filterConfigList.add(new Overlaps());
filterConfigList.add(new Touches());
filterConfigList.add(new Within());
return filterConfigList;
}
use of com.sldeditor.filter.v2.function.logic.Not in project sldeditor by robward-scisys.
the class DurationTest method testDurationString.
/**
* Test method for
* {@link com.sldeditor.filter.v2.function.temporal.Duration#Duration(java.lang.String)}.
*/
@Test
public void testDurationString() {
test("P10D", 0, 0, 10, 0, 0, 0, null);
test("P1Y2M3D", 1, 2, 3, 0, 0, 0, null);
test("P1Y2M", 1, 2, 0, 0, 0, 0, null);
test("P1Y2M3D4H5M6S", 1, 2, 3, 4, 5, 6, null);
test("P1Y6S", 1, 0, 0, 0, 0, 6, null);
test("P1Y0H6M", 1, 0, 0, 0, 6, 0, null);
test("P1Y6H", 1, 0, 0, 6, 0, 0, null);
test("T1H6M", 0, 0, 0, 1, 6, 0, null);
// This is not valid
test("P1M6M", 0, 1, 0, 0, 0, 0, "P1M");
test("T10H", 0, 0, 0, 10, 0, 0, null);
String dateString = "20-09-2016T17:42:27Z";
Duration duration = new Duration(dateString);
assertTrue(duration.isDate());
String actual = duration.getString();
assertTrue(dateString, dateString.compareTo(actual) == 0);
}
Aggregations