本文整理汇总了Java中org.opengis.filter.capability.FunctionName类的典型用法代码示例。如果您正苦于以下问题:Java FunctionName类的具体用法?Java FunctionName怎么用?Java FunctionName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FunctionName类属于org.opengis.filter.capability包,在下文中一共展示了FunctionName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: accept
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
@Override
public boolean accept(FunctionName functionName) {
if (functionName != null) {
// Check return type
if (allowedGeometryTypeList.contains(functionName.getReturn().getType())) {
return false;
}
// Check all parameters
for (Parameter<?> parameter : functionName.getArguments()) {
if (allowedGeometryTypeList.contains(parameter.getType())) {
return false;
}
}
// Check to see if function name is on the banned list
if (disallowedFunctionNameList.contains(functionName.getName())) {
return false;
}
}
return true;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:FunctionNameFilterRaster.java
示例2: createExpression
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Creates the expression.
*
* @param functionName the function name
* @param argumentList the argument list
* @return the expression
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.filter.v2.function.FunctionNameInterface#createExpression(org.opengis.filter.capability.FunctionName, java.util.List)
*/
@Override
public Expression createExpression(FunctionName functionName, List<Expression> argumentList) {
if (functionName == null) {
return null;
}
Literal fallback = null;
Function function = functionFactory.function(functionName.getFunctionName(), argumentList,
fallback);
return function;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FunctionManager.java
示例3: setDataType
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Sets the field data types.
*
* @param fieldType the new data type
* @param isRasterSymbol the is raster symbol
*/
public void setDataType(Class<?> fieldType, boolean isRasterSymbol) {
functionNameMap.clear();
List<FunctionNameFilterInterface> functionNameFilterList =
new ArrayList<FunctionNameFilterInterface>();
if (isRasterSymbol) {
functionNameFilterList.add(new FunctionNameFilterRaster());
} else {
functionNameFilterList.add(new FunctionNameFilterAll());
}
List<FunctionName> functionNameList = functionNameMgr.getFunctionNameList(fieldType,
functionNameFilterList);
for (FunctionName functionName : functionNameList) {
String functionNameString = functionName.getName();
functionNameMap.put(functionNameString, functionName);
}
populateFunctionComboBox();
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:30,代码来源:FunctionField.java
示例4: setFunction
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Sets the function.
*
* @param expression the new attribute
*/
public void setFunction(Expression expression) {
if (expression == null) {
functionComboBox.setSelectedIndex(-1);
} else {
if (expression instanceof FunctionExpressionImpl) {
FunctionExpressionImpl functionExpression = (FunctionExpressionImpl) expression;
FunctionName function = functionExpression.getFunctionName();
String functionName = function.getName();
oldValueObj = functionName;
functionComboBox.setSelectedItem(functionName);
} else {
ConsoleManager.getInstance().error(this, Localisation.getString(FunctionField.class,
"DataSourceAttributePanel.error1"));
}
}
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FunctionField.java
示例5: displayBuiltInProcessFunction
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Display built in process function.
*
* @param selectedValue the selected value
* @return true, if successful
*/
private boolean displayBuiltInProcessFunction(String selectedValue) {
String functionNameString;
// Strip off the prefix
functionNameString = SelectedProcessFunction.extractLocalFunctionName(selectedValue);
for (FunctionName name : factory.getFunctionNames()) {
if (name.getName().compareToIgnoreCase(functionNameString) == 0) {
functionList.setSelectedValue(functionNameString, true);
functionParameterTableModel.populate(name, existingProcessFunction);
return true;
}
}
return false;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:RenderTransformationDialog.java
示例6: testFunctionUpdated
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigBase#functionUpdated(org.opengis.filter.expression.Expression)}.
*/
@Test
public void testFunctionUpdated() {
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(
new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
TestUpdateSymbolInterface listener = new TestUpdateSymbolInterface();
field.addDataChangedListener(listener);
assertFalse(listener.hasBeenCalled());
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
FunctionName functionName = functionFactory.getFunctionNames().get(0);
Expression testExpression = ff.function(functionName.getFunctionName(), (Expression) null);
field.functionUpdated(testExpression);
assertTrue(listener.hasBeenCalled());
assertEquals(ExpressionTypeEnum.E_FUNCTION, field.getExpressionType());
Expression expression = field.getExpression();
assertTrue(expression.toString().startsWith(functionName.getName()));
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:29,代码来源:FieldConfigBaseTest.java
示例7: testGetFunctionType
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.filter.v2.function.FunctionManager#getFunctionType(java.lang.String)}.
*/
@Test
public void testGetFunctionType() {
Class<?> returnType = FunctionManager.getInstance().getFunctionType(null);
assertNull(returnType);
List<FunctionNameFilterInterface> functionNameFilterList =
new ArrayList<FunctionNameFilterInterface>();
FunctionNameFilterAll allFilter = new FunctionNameFilterAll();
allFilter.accept(null);
functionNameFilterList.add(allFilter);
List<FunctionName> functionNameList = FunctionManager.getInstance()
.getFunctionNameList(null, null);
for (FunctionName functionName : functionNameList) {
returnType = FunctionManager.getInstance().getFunctionType(functionName.getName());
assertEquals(functionName.getName(), functionName.getReturn().getType(), returnType);
}
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:FunctionManagerTest.java
示例8: testCreateExpression
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.filter.v2.function.FilterManager#createExpression(org.opengis.filter.capability.FunctionName)}.
*/
@Test
public void testCreateExpression() {
DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
List<FunctionName> functionNameList = functionFactory.getFunctionNames();
FunctionName functionName = null;
Expression expression = FilterManager.getInstance().createExpression(functionName);
assertNull(expression);
functionName = functionNameList.get(0);
expression = FilterManager.getInstance().createExpression(functionName);
assertNotNull(expression);
FunctionExpression funcExpression = (FunctionExpression) expression;
assertTrue(functionName.getName().compareTo(funcExpression.getName()) == 0);
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:FilterManagerTest.java
示例9: checkFieldType
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Check field type.
*
* @param fieldIndex the field index
* @param fieldList the field list
* @param functionName the function name
* @param argList the arg list
*/
private void checkFieldType(int fieldIndex, List<FieldConfigBase> fieldList,
FunctionName functionName, List<String> argList) {
int adjustedIndex = (fieldIndex >= functionName.getArgumentNames().size())
? functionName.getArgumentNames().size() - 1 : fieldIndex;
String label = functionName.getArgumentNames().get(adjustedIndex);
String debugMessage = String.format("%s/%d %s", functionName.getName(), fieldIndex, label);
FieldConfigPopulate field = fieldList.get(fieldIndex);
assertNotNull(debugMessage, field);
Parameter<?> parameterType = functionName.getArguments().get(adjustedIndex);
Class<?> actual = typeMap.get(parameterType.getType());
assertEquals(debugMessage, field.getClass(), actual);
assertTrue(debugMessage, field.getLabel().compareTo(label) == 0);
argList.add(parameterType.getType().getSimpleName());
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:26,代码来源:FilterManagerTest.java
示例10: testSetBuiltInProcessFunction
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.rendertransformation.SelectedProcessFunction#setBuiltInProcessFunction(org.opengis.filter.capability.FunctionName, org.geotools.process.function.ProcessFunction)}.
*/
@Test
public void testSetBuiltInProcessFunction() {
SelectedProcessFunction obj = new SelectedProcessFunction();
assertTrue(obj.isBuiltInSelected());
assertTrue(obj.extractParameters().isEmpty());
assertNull(obj.getFunctionName());
assertEquals(0, obj.getRowCount());
ProcessFunctionFactory processFunctionFactory = new ProcessFunctionFactory();
List<FunctionName> functionNameList = processFunctionFactory.getFunctionNames();
FunctionName functionName = functionNameList.get(0);
obj.setBuiltInProcessFunction(functionName, null);
assertTrue(obj.isBuiltInSelected());
assertTrue(obj.getFunctionName().getLocalPart().compareTo(functionName.getName()) == 0);
assertEquals(obj.getRowCount(), obj.extractParameters().size());
assertFalse(obj.extractParameters().isEmpty());
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SelectedProcessFunctionTest.java
示例11: testRenderTransformationDialog
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.rendertransformation.RenderTransformationDialog#RenderTransformationDialog(com.sldeditor.common.connection.GeoServerConnectionManagerInterface)}.
*/
@Test
public void testRenderTransformationDialog() {
TestRenderTransformationDialog testObj = new TestRenderTransformationDialog(null);
testObj.test_internal_showDialog(null);
ProcessFunction actualResult = testObj.getTransformationProcessFunction();
assertNull(actualResult);
ProcessFunctionFactory factory = new ProcessFunctionFactory();
FunctionName functionName = factory.getFunctionNames().get(0);
testObj.testDisplayFunction(functionName.getName());
actualResult = testObj.getTransformationProcessFunction();
assertNotNull(actualResult);
testObj.test_internal_showDialog(actualResult);
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:RenderTransformationDialogTest.java
示例12: createArrow
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Creates the arrow.
*
* @return the point symbolizer containing the arrow
*/
public static PointSymbolizer createArrow(boolean isSourceArrow) {
FunctionName angleFunction = null;
FunctionName locationFunction = null;
if (isSourceArrow) {
angleFunction = FilterFunction_startAngle.NAME;
locationFunction = FilterFunction_startPoint.NAME;
} else {
angleFunction = FilterFunction_endAngle.NAME;
locationFunction = FilterFunction_endPoint.NAME;
}
return createArrow(angleFunction, locationFunction, DEFAULT_ARROW_SYMBOL, isSourceArrow);
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:18,代码来源:DefaultSymbols.java
示例13: createExpression
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Creates the expression.
*
* @param functionName the function name
* @return the expression
*/
@Override
public Expression createExpression(FunctionName functionName) {
if (functionName == null) {
return null;
}
List<Expression> parameters = null;
Literal fallback = null;
Function function = functionFactory.function(functionName.getFunctionName(), parameters,
fallback);
return function;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:FilterManager.java
示例14: getFunctionNameList
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Gets the function name list for the given parameter type A
* expectedType of null returns all functions.
*
* @param expectedType the expected type, restrict functions with this return type
* @param functionNameFilterList the function name filter list
* @return the function name list
*/
@Override
public List<FunctionName> getFunctionNameList(Class<?> expectedType,
List<FunctionNameFilterInterface> functionNameFilterList) {
if (expectedType == null) {
return functionNameList;
}
if (functionNameFilterList == null) {
functionNameFilterList = new ArrayList<FunctionNameFilterInterface>();
functionNameFilterList.add(new FunctionNameFilterAll());
}
List<FunctionName> list = new ArrayList<FunctionName>();
List<Class<?>> allowedTypes = allowedTypeMap.get(expectedType);
if (allowedTypes != null) {
for (FunctionName functionName : functionNameList) {
Class<?> returnType = functionName.getReturn().getType();
if (allowedTypes.contains(returnType)
&& matchesFilter(functionName, functionNameFilterList)) {
list.add(functionName);
}
}
}
return list;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:36,代码来源:FunctionManager.java
示例15: matchesFilter
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Checks to see if FunctionName matches filter.
*
* @param functionName the function name
* @param functionNameFilterList the function name filter list
* @return true, if successful
*/
private boolean matchesFilter(FunctionName functionName,
List<FunctionNameFilterInterface> functionNameFilterList) {
for (FunctionNameFilterInterface filter : functionNameFilterList) {
if (filter.accept(functionName)) {
return true;
}
}
return false;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:FunctionManager.java
示例16: getFunctionType
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Gets the function type.
*
* @param functionName the function name
* @return the function type
*/
@Override
public Class<?> getFunctionType(String functionName) {
FunctionName function = getFunction(functionName);
if (function == null) {
return null;
}
return function.getReturn().getType();
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:FunctionManager.java
示例17: getFunction
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Gets the function type.
*
* @param functionName the function name
* @return the function type
*/
@Override
public FunctionName getFunction(String functionName) {
FunctionName function = functionNameMap.get(functionName);
if (function == null) {
return null;
}
return function;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:FunctionManager.java
示例18: setBuiltInProcessFunction
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Sets the built in process function.
*
* @param builtInProcessFunction the builtInProcessFunction to set
* @param existingProcessFunction the existing process function
*/
public void setBuiltInProcessFunction(FunctionName builtInProcessFunction,
ProcessFunction existingProcessFunction) {
this.builtInProcessFunction = builtInProcessFunction;
this.selectedProcessFunctionData = existingProcessFunction;
this.selectedCustomFunction = null;
this.builtInSelected = true;
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:14,代码来源:SelectedProcessFunction.java
示例19: testGetFunctionNameList
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.filter.v2.function.FunctionManager#getFunctionNameList(java.lang.Class)}.
*/
@Test
public void testGetFunctionNameList() {
DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
List<FunctionName> functionNameList = functionFactory.getFunctionNames();
//CHECKSTYLE:OFF
Class<?>[] allowedNumberTypes = { Number.class, Double.class, Float.class, Integer.class,
Long.class, Object.class };
//CHECKSTYLE:ON
List<Class<?>> allowedNumberTypesList = Arrays.asList(allowedNumberTypes);
int count = 0;
for (FunctionName functionName : functionNameList) {
Class<?> type = functionName.getReturn().getType();
if (allowedNumberTypesList.contains(type)) {
count++;
}
}
List<FunctionNameFilterInterface> functionNameFilterList =
new ArrayList<FunctionNameFilterInterface>();
functionNameFilterList.add(new FunctionNameFilterAll());
List<FunctionName> actualList = FunctionManager.getInstance()
.getFunctionNameList(Number.class, functionNameFilterList);
assertEquals(count, actualList.size());
// Try with null
actualList = FunctionManager.getInstance().getFunctionNameList(null, null);
assertEquals(functionNameList.size(), actualList.size());
// Try with non-matching class
actualList = FunctionManager.getInstance().getFunctionNameList(FunctionManagerTest.class,
functionNameFilterList);
assertTrue(actualList.isEmpty());
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:41,代码来源:FunctionManagerTest.java
示例20: testCreateExpression
import org.opengis.filter.capability.FunctionName; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.filter.v2.function.FunctionManager#createExpression(org.opengis.filter.capability.FunctionName)}.
*/
@Test
public void testCreateExpression() {
DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
List<FunctionName> functionNameList = functionFactory.getFunctionNames();
FunctionName functionName = null;
Expression expression = FunctionManager.getInstance().createExpression(functionName);
assertNull(expression);
functionName = functionNameList.get(0);
expression = FunctionManager.getInstance().createExpression(functionName);
assertNotNull(expression);
FunctionExpression funcExpression = (FunctionExpression) expression;
assertTrue(functionName.getName().compareTo(funcExpression.getName()) == 0);
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:19,代码来源:FunctionManagerTest.java
注:本文中的org.opengis.filter.capability.FunctionName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论