Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Expression


        if (source.equals(fillEnableButton)) {
            boolean selected = fillEnableButton.getSelection();
            notifyListeners(String.valueOf(selected), false, STYLEEVENTTYPE.FILLENABLE);
        } else if (source.equals(fillColorButton)) {
            Color color = fillColorEditor.getColor();
            Expression colorExpr = ff.literal(color);
            String fillColor = colorExpr.evaluate(null, String.class);
            notifyListeners(fillColor, false, STYLEEVENTTYPE.FILLCOLOR);
        } else if (source.equals(fillOpacitySpinner) || source.equals(fillOpacityAttributecombo)) {
            boolean comboIsNone = comboIsNone(fillOpacityAttributecombo);
            if (comboIsNone) {
                int opacity = fillOpacitySpinner.getSelection();
View Full Code Here


                }
                notifyListeners(field, true, STYLEEVENTTYPE.BORDERWIDTH);
            }
        } else if (source.equals(borderColorButton)) {
            Color color = borderColorEditor.getColor();
            Expression colorExpr = ff.literal(color);
            String strokeColor = colorExpr.evaluate(null, String.class);
            notifyListeners(strokeColor, false, STYLEEVENTTYPE.BORDERCOLOR);
        } else if (source.equals(borderOpacitySpinner) || source.equals(borderOpacityAttributecombo)) {
            boolean comboIsNone = comboIsNone(borderOpacityAttributecombo);
            if (comboIsNone) {
                int opacity = borderOpacitySpinner.getSelection();
View Full Code Here

            yOffset = DEFAULT_OFFSET;
        }

        stroke = polygonSymbolizer.getStroke();
        if (stroke != null) {
            Expression color = stroke.getColor();
            strokeColor = expressionToString(color);
            Expression width = stroke.getWidth();
            strokeWidth = expressionToString(width);
            Expression opacity = stroke.getOpacity();
            strokeOpacity = expressionToString(opacity);

            if (strokeColor == null) {
                strokeColor = DEFAULT_COLOR;
                stroke.setColor(ff.literal(DEFAULT_COLOR));
            }
            if (strokeOpacity == null) {
                strokeOpacity = DEFAULT_OPACITY;
                stroke.setOpacity(ff.literal(DEFAULT_OPACITY));
            }
            if (strokeWidth == null) {
                strokeWidth = DEFAULT_WIDTH;
                stroke.setWidth(ff.literal(DEFAULT_WIDTH));
            }

            strokeGraphicStroke = stroke.getGraphicStroke();
            if (strokeGraphicStroke != null) {
                List<GraphicalSymbol> graphicalSymbolsList = strokeGraphicStroke.graphicalSymbols();
                if (graphicalSymbolsList.size() > 0) {
                    GraphicalSymbol graphicalSymbol = graphicalSymbolsList.get(0);
                    if (graphicalSymbol instanceof ExternalGraphic) {
                        strokeExternalGraphicStroke = (ExternalGraphic) graphicalSymbol;
                    }
                }
            }

            // dash
            float[] dashArray = stroke.getDashArray();
            if (dashArray != null) {
                dash = Utilities.getDashString(dashArray);
            } else {
                dash = ""; //$NON-NLS-1$
            }
            // dashoffset
            dashOffset = stroke.getDashOffset().evaluate(null, String.class);
            // line cap
            lineCap = stroke.getLineCap().evaluate(null, String.class);
            // line join
            lineJoin = stroke.getLineJoin().evaluate(null, String.class);

            hasStroke = true;
        } else {
            hasStroke = false;
        }

        fill = polygonSymbolizer.getFill();
        if (fill != null) {
            Expression color = fill.getColor();
            if (color != null) {
                fillColor = expressionToString(color);
            }
            Expression opacity = fill.getOpacity();
            fillOpacity = expressionToString(opacity);

            fillGraphicFill = fill.getGraphicFill();
            if (fillGraphicFill != null) {
                List<GraphicalSymbol> graphicalSymbolsList = fillGraphicFill.graphicalSymbols();
View Full Code Here

        final String labelExpression = (String) resource.getPersistentProperties().get(
                FEATURE_LABEL);
       
        if (labelExpression != null) {
            try {
                final Expression exp = ECQL.toExpression(labelExpression);
                final String featureLabel = (String) exp.evaluate(feature);
                if (featureLabel != null && featureLabel.trim().length() > 0) {
                    return featureLabel;   
                }
            } catch (CQLException e) {
                e.printStackTrace();
View Full Code Here

                    Color fromColor = coverageRule.getFromColor();
                    Color toColor = coverageRule.getToColor();
                    double[] values = coverageRule.getFromToValues();
                    double opacity = coverageRule.getOpacity();

                    Expression fromColorExpr = sB.colorExpression(new java.awt.Color(fromColor.getRed(), fromColor.getGreen(),
                            fromColor.getBlue(), 255));
                    Expression toColorExpr = sB.colorExpression(new java.awt.Color(toColor.getRed(), toColor.getGreen(), toColor
                            .getBlue(), 255));
                    Expression fromExpr = sB.literalExpression(values[0]);
                    Expression toExpr = sB.literalExpression(values[1]);
                    Expression opacityExpr = sB.literalExpression(opacity);

                    ColorMapEntry entry = sf.createColorMapEntry();
                    entry.setQuantity(fromExpr);
                    entry.setColor(fromColorExpr);
                    entry.setOpacity(opacityExpr);
View Full Code Here

     * @param entry
     * @return
     * @throws NumberFormatException
     */
    private static java.awt.Color getColor( ColorMapEntry entry ) throws NumberFormatException {
        final Expression color = entry.getColor();
        final String colorString = (String) color.evaluate(null, String.class);
        return java.awt.Color.decode(colorString);
    }
View Full Code Here

     * @throws IllegalArgumentException
     * @throws MissingResourceException
     */
    private static double getOpacity( ColorMapEntry entry ) throws IllegalArgumentException, MissingResourceException {

        Expression opacity = entry.getOpacity();
        Double opacityValue = null;
        if (opacity != null)
            opacityValue = (Double) opacity.evaluate(null, Double.class);
        else
            return 1.0;
        if ((opacityValue.doubleValue() - 1) > 0 || opacityValue.doubleValue() < 0) {
            throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, Messages.CoverageStyleEditorPage_4, opacityValue));
        }
View Full Code Here

    /**
     * @param entry
     * @return
     */
    private static double getQuantity( ColorMapEntry entry ) {
        Expression quantity = entry.getQuantity();
        Double quantityString = (Double) quantity.evaluate(null, Double.class);
        double q = quantityString.doubleValue();
        return q;
    }
View Full Code Here

     * @param value Assumed to be {@link Express}
     * @return score between 0-100 indicating suitability
     */
    public int score(Object input, Object value) {
        ExpressionInput expressionInput = safeCast(input, ExpressionInput.class);
        Expression expression = safeCast(value, Expression.class);

        return score(expressionInput, expression);
    }
View Full Code Here

     * Gets the expression viewer's expression
     *
     * @return expression
     */
    private String getExpression() {
        final Expression expression = exViewer.getExpression();
        if (expression != null) {
            return ECQL.toCQL(exViewer.getExpression());   
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.expression.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.