• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AttributeExpressionImpl类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.geotools.filter.AttributeExpressionImpl的典型用法代码示例。如果您正苦于以下问题:Java AttributeExpressionImpl类的具体用法?Java AttributeExpressionImpl怎么用?Java AttributeExpressionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AttributeExpressionImpl类属于org.geotools.filter包,在下文中一共展示了AttributeExpressionImpl类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setAttribute

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Sets the attribute.
 *
 * @param expression the new attribute
 */
public void setAttribute(Expression expression) {
    String propertyName = null;

    if (expression instanceof PropertyExistsFunction) {
        Expression e = ((PropertyExistsFunction) expression).getParameters().get(0);
        Object value = ((LiteralExpressionImpl) e).getValue();
        propertyName = ((AttributeExpressionImpl) value).getPropertyName();
    } else if (expression instanceof AttributeExpressionImpl) {
        propertyName = ((AttributeExpressionImpl) expression).getPropertyName();
    } else if (expression instanceof LiteralExpressionImpl) {
        propertyName = AttributeUtils
                .extract((String) ((LiteralExpressionImpl) expression).getValue());
    }

    if (propertyName != null) {
        oldValueObj = propertyName;

        attributeComboBox.setSelectedItem(propertyName);
    } else {
        oldValueObj = propertyName;
        attributeComboBox.setSelectedIndex(-1);
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:29,
代码来源:DataSourceAttributePanel.java

示例2: populate

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Populate.
 *
 * @param expression the expression
 */
public void populate(Expression expression) {
    if (expression != null) {
        populateAttributeComboxBox(expression);

        if ((expression == null) || (expression instanceof NilExpression)
                || (expression instanceof ConstantExpression)
                || (expression instanceof LiteralExpressionImpl)) {
            valuePanel.populateExpression(expression);
        } else if (expression instanceof AttributeExpressionImpl) {
            setAttribute(expression);
        } else {
            expressionPanel.populateExpression(expression);
        }
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:21,
代码来源:AttributeSelection.java

示例3: populateAttributeComboxBox

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Populate.
 *
 * @param expression the expression
 */
public void populateAttributeComboxBox(Expression expression) {

    String panelName;

    // Clear out any old values
    expressionPanel.populateExpression(null);
    dataSourceAttributePanel.setAttribute(null);

    if (expression == null) {
        panelName = ValueSubPanel.getPanelName();
    } else if (expression instanceof NilExpression) {
        panelName = ValueSubPanel.getPanelName();
    } else if (expression instanceof ConstantExpression) {
        panelName = ValueSubPanel.getPanelName();
    } else if (expression instanceof LiteralExpressionImpl) {
        panelName = ValueSubPanel.getPanelName();
    } else if (expression instanceof AttributeExpressionImpl) {
        panelName = DataSourceAttributePanel.getPanelName();
    } else {
        panelName = ExpressionSubPanel.getPanelName();
    }

    oldValueObj = panelName;
    attributeChooserComboBox.setSelectedItem(panelName);
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:31,
代码来源:AttributeSelection.java

示例4: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof LiteralExpressionImpl) {
        value = ((Expression) aValue).toString();
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    } else {
        if (aValue instanceof String) {
            value = ((String) aValue);
        }
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:18,
代码来源:EnumValues.java

示例5: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Integer) {
        this.value = (Integer) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Integer.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:17,
代码来源:IntegerValues.java

示例6: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        if (literal.getValue() != null) {
            value = literal.toString();
        }
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    } else {
        if (aValue instanceof String) {
            value = ((String) aValue);
        }
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:21,
代码来源:CoordinateReferenceSystemValues.java

示例7: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Double) {
        this.value = (Double) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Double.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:17,
代码来源:DoubleValues.java

示例8: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof String) {
        this.value = (String) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, String.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    } else {
        this.value = aValue.toString();
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:19,
代码来源:StringValues.java

示例9: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Boolean) {
        this.value = (Boolean) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Boolean.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:17,
代码来源:BooleanValues.java

示例10: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Number) {
        this.value = (Number) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Number.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:17,
代码来源:NumberValues.java

示例11: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Float) {
        this.value = (Float) aValue;
    } else if (aValue instanceof Double) {
        this.value = ((Double) aValue).floatValue();
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Float.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:19,
代码来源:FloatValues.java

示例12: setValue

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Long) {
        this.value = (Long) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Long.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:17,
代码来源:LongValues.java

示例13: testAttributeUpdated

点赞 3

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigBase#attributeUpdated(java.lang.String)}.
 */
@Test
public void testAttributeUpdated() {
    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);

    String attributeName = "test attribute";
    assertFalse(listener.hasBeenCalled());
    field.attributeUpdated(attributeName);
    assertTrue(listener.hasBeenCalled());

    assertEquals(ExpressionTypeEnum.E_ATTRIBUTE, field.getExpressionType());
    Expression expression = field.getExpression();
    assertTrue(expression instanceof AttributeExpressionImpl);
    assertTrue(attributeName.compareTo(expression.toString()) == 0);
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:25,
代码来源:FieldConfigBaseTest.java

示例14: attributeUpdated

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Attribute updated.
 *
 * @param attributeName the attribute name
 */
@Override
public void attributeUpdated(String attributeName) {
    expressionType = ExpressionTypeEnum.E_ATTRIBUTE;

    NameImpl name = new NameImpl(attributeName);
    setCachedExpression(new AttributeExpressionImpl(name));

    setValueFieldState();
    fireDataChanged();
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:16,
代码来源:FieldConfigBase.java

示例15: populateExpression

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Populate expression.
 *
 * @param objValue the obj value
 */
/*
 * (non-Javadoc)
 * 
 * @see com.sldeditor.ui.detail.config.FieldConfigBase#populateExpression(java.lang.Object)
 */
@Override
public void populateExpression(Object objValue) {
    String propertyName = null;

    if (objValue instanceof PropertyExistsFunction) {
        Expression e = ((PropertyExistsFunction) objValue).getParameters().get(0);
        Object value = ((LiteralExpressionImpl) e).getValue();
        propertyName = ((AttributeExpressionImpl) value).getPropertyName();
    } else if (objValue instanceof AttributeExpressionImpl) {
        propertyName = ((AttributeExpressionImpl) objValue).getPropertyName();
    } else if (objValue instanceof LiteralExpressionImpl) {
        propertyName = AttributeUtils
                .extract((String) ((LiteralExpressionImpl) objValue).getValue());
    }

    if (propertyName != null) {
        oldValueObj = propertyName;

        attributeComboBox.setSelectedItem(propertyName);
    } else {
        oldValueObj = propertyName;
        attributeComboBox.setSelectedIndex(-1);
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:35,
代码来源:FieldConfigGeometryField.java

示例16: addExpression

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Adds the expression.
 *
 * @param node the node
 * @return the expression
 */
private Expression addExpression(ExpressionNode node) {
    Expression expression = node.getExpression();

    if (expression instanceof LiteralExpressionImpl) {
        return expression;
    } else if (expression instanceof AttributeExpressionImpl) {
        return expression;
    } else if (expression instanceof FunctionExpressionImpl) {
        FunctionExpressionImpl functionExpression = (FunctionExpressionImpl) expression;

        List<Expression> parameterlist = new ArrayList<Expression>();
        for (int childIndex = 0; childIndex < node.getChildCount(); childIndex++) {
            ExpressionNode childNode = (ExpressionNode) node.getChildAt(childIndex);

            parameterlist.add(addExpression(childNode));
        }

        functionExpression.setParameters(parameterlist);

        return functionExpression;
    } else if (expression instanceof MathExpressionImpl) {
        MathExpressionImpl mathExpression = (MathExpressionImpl) expression;
        ExpressionNode leftChildNode = (ExpressionNode) node.getChildAt(0);
        mathExpression.setExpression1(addExpression(leftChildNode));
        ExpressionNode rightChildNode = (ExpressionNode) node.getChildAt(1);
        mathExpression.setExpression2(addExpression(rightChildNode));

        return mathExpression;
    }
    return null;
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:38,
代码来源:FilterPanelv2.java

示例17: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Geometry) {
        this.value = (Geometry) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:GeometryValues.java

示例18: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof FeatureCollection) {
        this.value = (FeatureCollection) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:FeatureCollectionValues.java

示例19: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Envelope) {
        this.value = (Envelope) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:ReferencedEnvelopeValues.java

示例20: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Range) {
        this.value = (Range) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:JAIExtRangeValues.java

示例21: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Date) {
        this.value = (Date) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:DateValues.java

示例22: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof KernelJAI) {
        this.value = (KernelJAI) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:KernelJAIValues.java

示例23: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Unit) {
        this.value = (Unit) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:UnitValues.java

示例24: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Style) {
        this.value = (Style) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:StyleValues.java

示例25: setValue

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Filter) {
        this.value = (Filter) aValue;
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof LiteralExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:15,
代码来源:FilterValues.java

示例26: updateSymbol

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Update symbol.
 */
private void updateSymbol() {
    if (!Controller.getInstance().isPopulating()) {
        ValueComboBoxData windSpeedUnits = fieldConfigVisitor
                .getComboBox(FieldIdEnum.WINDBARB_WINDSPEED_UNITS);
        Expression windSpeedExpression = fieldConfigVisitor
                .getExpression(FieldIdEnum.WINDBARB_WINDSPEED);
        boolean inNorthernHemisphere = fieldConfigVisitor
                .getBoolean(FieldIdEnum.WINDBARB_NORTHERN_HEMISPHERE);
        Object windSpeed = null;

        if (windSpeedExpression == null) {
            windSpeed = Integer.valueOf(0);
        } else if (windSpeedExpression instanceof LiteralExpressionImpl) {
            LiteralExpressionImpl literalExpression = 
                    (LiteralExpressionImpl) windSpeedExpression;
            windSpeed = literalExpression.getValue();
        } else if (windSpeedExpression instanceof ConstantExpression) {
            ConstantExpression constantExpression = (ConstantExpression) windSpeedExpression;

            windSpeed = constantExpression.getValue();
        } else if (windSpeedExpression instanceof AttributeExpressionImpl) {
            AttributeExpressionImpl attributeExpression = 
                    (AttributeExpressionImpl) windSpeedExpression;

            windSpeed = String.format("<ogc:PropertyName>%s</ogc:PropertyName>",
                    attributeExpression.getPropertyName());
            ;
        } else {
            ConsoleManager.getInstance().error(this,
                    Localisation.getField(WindBarbDetails.class, "WindBarb.windspeedError1")
                            + windSpeedExpression.getClass().getName());
        }
        String url = String.format("windbarbs://default(%s)[%s]", windSpeed,
                windSpeedUnits.getKey());

        if (!inNorthernHemisphere) {
            url = url + HEMISPHERE_S;
        }
        windBarbsExpression = getFilterFactory().literal(url);

        if (parentObj != null) {
            parentObj.windBarbValueUpdated();
        }
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:49,
代码来源:WindBarbDetails.java

示例27: setDisplayString

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Sets the display string.
 */
private void setDisplayString() {
    StringBuilder sb = new StringBuilder();

    if (name != null) {
        sb.append(name);
        sb.append(" : ");
    }

    if (expression == null) {
        if (expressionType == ExpressionTypeEnum.LITERAL) {
            sb.append(Localisation.getString(ExpressionPanelv2.class,
                    "ExpressionPanelv2.literalNotSet"));
        } else if (expressionType == ExpressionTypeEnum.PROPERTY) {
            sb.append(Localisation.getString(ExpressionPanelv2.class,
                    "ExpressionPanelv2.propertyNotSet"));
        } else {
            sb.append(Localisation.getString(ExpressionPanelv2.class,
                    "ExpressionPanelv2.expressionNotSet"));
        }
    }

    if (expression instanceof LiteralExpressionImpl) {
        sb.append(Localisation.getField(ExpressionPanelv2.class, "ExpressionPanelv2.literal")
                + " ");
        sb.append(expression.toString());
    } else if (expression instanceof AttributeExpressionImpl) {
        sb.append(String.format("%s : [%s]",
                Localisation.getString(ExpressionPanelv2.class, "ExpressionPanelv2.attribute"),
                expression.toString()));
    } else if (expression instanceof FunctionExpressionImpl) {
        sb.append(expression.toString());
    } else if (expression instanceof FunctionImpl) {
        sb.append(expression.toString());
    } else if (expression instanceof MathExpressionImpl) {
        if (mathExpressionMap.isEmpty()) {
            mathExpressionMap.put(AddImpl.class, "+");
            mathExpressionMap.put(SubtractImpl.class, "-");
            mathExpressionMap.put(DivideImpl.class, "/");
            mathExpressionMap.put(MultiplyImpl.class, "*");
        }

        String str = mathExpressionMap.get(expression.getClass());
        sb.append(str);
    }

    displayString = sb.toString();
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:51,
代码来源:ExpressionNode.java

示例28: displayExpression

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Display expression.
 *
 * @param node the node
 */
private void displayExpression(ExpressionNode node) {

    if (panelLiteral.getComponentCount() == 2) {
        panelLiteral.remove(1);
    }

    if (node == null) {
        return;
    }

    fieldConfig = PanelField.getField(ExpressionPanelv2.class, "ExpressionSubPanel.value",
            node.getType());

    if (fieldConfig != null) {
        fieldConfig.createUI();
        fieldConfig.addDataChangedListener(new UpdateSymbolInterface() {
            @Override
            public void dataChanged(FieldIdEnum changedField) {
                buttonGroup.setSelected(rdbtnLiteral.getModel(), true);
                updateButtonState(true);
            }
        });
        panelLiteral.add(fieldConfig.getPanel());

        // Reset the fields
        dataSourceAttributePanel.setAttribute(null);
        functionPanel.setFunction(null);

        dataSourceAttributePanel.setDataType(node.getType());

        Expression expression = node.getExpression();

        if (expression instanceof AttributeExpressionImpl) {
            dataSourceAttributePanel.setAttribute(expression);
            buttonGroup.setSelected(rdbtnAttribute.getModel(), true);
        } else if (expression instanceof EnvFunction) {
            envVarField.setEnvironmentVariable(expression);
            buttonGroup.setSelected(rdbtnEnvVar.getModel(), true);
        } else if (expression instanceof FunctionExpressionImpl) {
            functionPanel.setFunction(expression);
            buttonGroup.setSelected(rdbtnFunction.getModel(), true);
        } else {
            fieldConfig.populate(expression);
            buttonGroup.setSelected(rdbtnLiteral.getModel(), true);
        }
    }
    Dimension boxSize = box.getPreferredSize();
    setPreferredSize(boxSize);
    revalidate();
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:56,
代码来源:ExpressionSubPanel.java

示例29: testPopulateExpressionExpression

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigBase#populate(org.opengis.filter.expression.Expression)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigBase#populate(org.opengis.filter.expression.Expression, org.opengis.filter.expression.Expression)}.
 */
@Test
public void testPopulateExpressionExpression() {
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(
            new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));

    AttributeSelection attributeSelectionPanel = AttributeSelection
            .createAttributes(String.class, field, false);
    field.testAttributeSelectionPanel(attributeSelectionPanel);

    TestUpdateSymbolInterface listener = new TestUpdateSymbolInterface();
    field.addDataChangedListener(listener);

    assertFalse(listener.hasBeenCalled());
    FilterFactory ff = CommonFactoryFinder.getFilterFactory();

    // Test function
    DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
    FunctionName functionName = functionFactory.getFunctionNames().get(0);

    Expression testExpression = ff.function(functionName.getFunctionName(), (Expression) null);
    field.populate(testExpression);
    // Updated because the attribute pulldown changed
    assertTrue(listener.hasBeenCalled());

    assertEquals(ExpressionTypeEnum.E_EXPRESSION, field.getExpressionType());
    Expression expression = field.getExpression();
    assertTrue(expression.toString().startsWith(functionName.getName()));

    // Attribute expression wrapped in a literal expression
    String testAttributeName = "test attribute";
    NameImpl name = new NameImpl(testAttributeName);
    AttributeExpressionImpl attributeExpression = new AttributeExpressionImpl(name);

    Expression literalExpression = ff.literal(attributeExpression);
    field.populate(literalExpression);
    assertEquals(ExpressionTypeEnum.E_ATTRIBUTE, field.getExpressionType());

    // Process Function
    // ProcessFunctionFactory factory = new ProcessFunctionFactory();
    // FunctionTableModel functionParameterTableModel = new FunctionTableModel();
    // ProcessFunction processFunction = functionParameterTableModel.getExpression(factory);
    // field.populate(processFunction);
    // assertEquals(ExpressionTypeEnum.E_VALUE, field.getExpressionType());
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:53,
代码来源:FieldConfigBaseTest.java

示例30: property

点赞 2

import org.geotools.filter.AttributeExpressionImpl; //导入依赖的package包/类
@Override
public PropertyName property(String name) {
	AttributeExpressionImpl expression = (AttributeExpressionImpl) super.property(name);
	expression.setLenient(false);
	return expression;
}
 

开发者ID:geomajas,
项目名称:geomajas-project-server,
代码行数:7,
代码来源:NonLenientFilterFactoryImpl.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)