Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Expression


    @Test
    public void testBackendRemovedIssue() throws Exception{
      FeatureStore<SimpleFeatureType, SimpleFeature> fs = (FeatureStore<SimpleFeatureType, SimpleFeature>) store
        .getFeatureSource(featureType.getName().getLocalPart());
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Expression expr2 = factory.literal("1");
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);
        fs.removeFeatures(filter);
        list.refresh();
        for( IIssue issue : list ) {
            System.out.println(issue.getId());
View Full Code Here


        IIssue issue = list.get(0);
        issue.setDescription(newDescription);
        ((IRemoteIssuesList)list).save(issue);
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());

        Expression expr2 = factory.literal(issue.getId());
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);

        SimpleFeature next = store.getFeatureSource(featureType.getName().getLocalPart()).getFeatures(filter).features().next();
        assertEquals(newDescription, next.getAttribute(IssuesListTestHelper.DESCRIPTION_ATTR));
    }
View Full Code Here

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

       
        transform = createTransformProcessDefinitionList();
       
        for( Definition definition : transform ){
            String name = definition.name;
            Expression expression = definition.expression;

            // FIXME : sometimes expression returns null.  I think the real bug is with AttributeExpression
            Class<?> binding = definition.binding;
            if( binding == null ){
                Object value = expression.evaluate(sample);
                if( value == null){
                    ifexpression instanceof PropertyName){
                        String path = ((PropertyName)expression).getPropertyName();
                        AttributeType attributeType = sample.getFeatureType().getType(path);
                        if( attributeType == null ){
View Full Code Here

        String cql = "#"+Integer.toHexString(c.getRGB() & 0x00ffffff);
        colorText.setText(cql);
        colorText.setEnabled(true);
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Expression expression = ff.literal(cql);

        return expression;
    }
View Full Code Here

                    if (colorText == null || colorText.isDisposed()) {
                        return; // must of been disposed while we are in the queue
                    }
                    try {
                        listen(false); // don't listen while updating controls
                        Expression expr = getExpression();

                        if (expr instanceof Literal) {
                            Literal literal = (Literal) expr;
                            Color color = literal.evaluate(null, Color.class);
                            if (color != null) {
View Full Code Here

        refreshExpression();
    }
   
    public void refreshExpression() {
        Expression expr = getExpression();
        if (expr instanceof PropertyName) {
            PropertyName property = (PropertyName) expr;
            String name = property.getPropertyName();
            refreshControls(null, name, null);
            feedback();
View Full Code Here

          newValues[7]=issue.getResolution();
          newValues[8]=viewMemento;
         
          FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools
        .getDefaultHints());
    Expression expr1 = factory.property(getAttributeMapper().getId());
    Expression expr2 = factory.literal(issue.getId());
    PropertyIsEqualTo filter = factory.equals(expr1, expr2);
    getFeatureStore().modifyFeatures(attributeType, newValues, filter);
  }
View Full Code Here


    public void removeIssues( Collection< ? extends IIssue> changed ) throws IOException {
        FilterFactory factory=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());

    Expression expr1 = factory.property(getAttributeMapper().getId());
   
    Filter filter = null;
   
        for( IIssue issue : changed ) {
            String id=issue.getId();
            Expression expr2 = factory.literal(id);
            PropertyIsEqualTo tmp = factory.equals(expr1, expr2);
           
            if( filter==null )
                filter=tmp;
            else
View Full Code Here

    private void setStylingElements( TextSymbolizer symbolizer ) {
       
        Color fontFill = SLDs.textFontFill(symbolizer);
        FontData[] tempFD = SLDs.textFont(symbolizer);
        Expression label = SLDs.textLabel(symbolizer);
        if (fontFill == null) {
            fontFill = SymbolizerContent.DEFAULT_FONT_COLOR;
        }
        labelFont.setColorValue(
                new RGB(fontFill.getRed(), fontFill.getGreen(), fontFill.getBlue()));
        if (tempFD == null) {
            tempFD = new FontData[1];
            tempFD[0] = new FontData(SymbolizerContent.DEFAULT_FONT_FACE,
                                    SymbolizerContent.DEFAULT_FONT_SIZE,
                                    SymbolizerContent.DEFAULT_FONT_STYLE);
        }
        labelFont.setFontList(tempFD);
       
        // Need to get all available labels
        //check if this layer has a feature
        Layer currLayer = getLayer();
        List<AttributeDescriptor> attributeList = null;
        AttributeDescriptor defaultGeom = null;
        if (currLayer.hasResource(FeatureSource.class)) {
            SimpleFeatureType ft = currLayer.getSchema();
            attributeList = ft.getAttributeDescriptors();
            defaultGeom=ft.getGeometryDescriptor();
        }
        labelCombo.removeAll();
        if (attributeList != null) {
            for( int i = 0; i < attributeList.size(); i++ ) {
                AttributeDescriptor attributeDescriptor = attributeList.get(i);
        if( attributeDescriptor != defaultGeom )
                    labelCombo.add(attributeDescriptor.getName().getLocalPart());
                if( label != null && attributeDescriptor != null &&
                        attributeDescriptor.getName().equals(label.toString()) ) {
                    //Set the correct initial label
                    labelCombo.select(i);
                } else if( i == 0 ) {
                    labelCombo.select(i);
                }
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.