Examples of AttributeDescriptor


Examples of org.opengis.feature.type.AttributeDescriptor

     * (non-Javadoc) Method declared on AttributeField.
     */
    protected void doLoadDefault() {
        if (textField != null) {
            SimpleFeatureType schema = getFeature().getFeatureType();
            AttributeDescriptor descriptor = schema.getDescriptor(getAttributeName());
            Object value = descriptor.getDefaultValue();
            Integer thenumber = Converters.convert(value, Integer.class);
            textField.setText("" + thenumber); //$NON-NLS-1$
        }
        valueChanged();
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

     * (non-Javadoc) Method declared on AttributeField.
     */
    protected void doStore() {

        SimpleFeatureType schema = getFeature().getFeatureType();
        AttributeDescriptor descriptor = schema.getDescriptor(getAttributeName());
        Object value = Converters.convert(textField, descriptor.getType().getBinding());
        getFeature().setAttribute(getAttributeName(), value);

    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

           
        };
    }

    protected Geometry createBounds( IIssue issue ) {
        AttributeDescriptor att=mapper.getSchema().getDescriptor(mapper.getBounds());
        if( MultiPolygon.class.isAssignableFrom(att.getType().getBinding()) )
            return toMultiPolygon(issue.getBounds());

        return toPolygon(issue.getBounds());
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

    protected Polygon toPolygon(ReferencedEnvelope env2){
        ReferencedEnvelope env=env2;
        if( env==null )
            env=new ReferencedEnvelope(-180,180,-90,90,DefaultGeographicCRS.WGS84);

        AttributeDescriptor att=mapper.getSchema().getDescriptor(mapper.getBounds());
        CoordinateReferenceSystem crs=null;
       
        if( att instanceof GeometryDescriptor )
            crs=((GeometryDescriptor)att).getCoordinateReferenceSystem();
       
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

        this.schema=schema;
        ArrayList<AttributeDescriptor> notMapped = new ArrayList<AttributeDescriptor>();
        if( schema.getGeometryDescriptor()!=null )
        bounds=schema.getGeometryDescriptor().getName().getLocalPart();
        for( int i=0; i<schema.getAttributeCount();i++ ){
            AttributeDescriptor att = schema.getDescriptor(i);
            if( att==schema.getGeometryDescriptor() )
                continue;
            if( bounds==null && att.getType().getBinding().isAssignableFrom(MultiPolygon.class) ){
                bounds=att.getName().getLocalPart();
                continue;
            }
            if( isExtensionID(att) && extensionId==null ){
                extensionId=att.getName().getLocalPart();
                continue;
            }
            if( isViewMemento(att) && viewMemento==null){
                viewMemento=att.getName().getLocalPart();
                continue;
            }
            if( isMemento(att) && memento==null){
                memento=att.getName().getLocalPart();
                continue;
            }
            if( isGroupId(att) && groupId==null){
                groupId=att.getName().getLocalPart();
                continue;
            }
            if( isId(att) && id==null){
                id=att.getName().getLocalPart();
                continue;
            }
            if( isResolution(att) && resolution==null){
                resolution=att.getName().getLocalPart();
                continue;
            }
            if( isPriority(att) && priority==null){
                priority=att.getName().getLocalPart();
                continue;
            }
            if( isDescription(att) && description==null){
                description=att.getName().getLocalPart();
                continue;
            }
            notMapped.add(att);
        }
       
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

        public Image getColumnImage( Object element, int columnIndex ) {
            return null;
        }

        public String getColumnText( Object element, int columnIndex ) {
            AttributeDescriptor attribute = (AttributeDescriptor) element;
            switch( columnIndex ) {
            case 0: // Attribute Name element
                return attribute.getLocalName();
            case 1: // Attribute Type element
                return attribute.getType().getBinding().getSimpleName();
            case 2: // Attribute Type element
      if (attribute instanceof GeometryDescriptor) {
                    CoordinateReferenceSystem crs = ((GeometryDescriptor)attribute).getCoordinateReferenceSystem();
                    if(crs!=null){
                        return crs.getName().toString();
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

                return false;
            return true;
        }

        public Object getValue( Object element, String property ) {
            AttributeDescriptor editElement = (AttributeDescriptor) element;
            switch( Integer.parseInt(property) ) {
            case NAME_COLUMN:
                return editElement.getName().toString();

            case TYPE_COLUMN:
                for( int i = 0; i < legalTypes.size(); i++ ) {
                    if (legalTypes.get(i).getType() == editElement.getType().getBinding())
                        return i;
                }
                return -1;
            case OTHER_COLUMN:
                return ((GeometryDescriptor)element).getCoordinateReferenceSystem();
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

        public void modify( Object element, String property, Object value ) {
            if( element==null || property==null || value==null ){
                return;
            }
           
            AttributeDescriptor editElement = (AttributeDescriptor) ((TreeItem) element).getData();
            SimpleFeatureType ft = (SimpleFeatureType) viewer.getInput();
            AttributeDescriptor newAttr = createNewAttributeType(editElement, property, value );
           
            if (newAttr == null)
                return;
            int index = 0;
            for( ; index < ft.getAttributeCount(); index++ ) {
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

        ICellModifier cellModifier = testingGetViewer.getCellModifier();

        cellModifier.modify(testingGetViewer.getTree().getItem(0), "0", "the_new_name"); //$NON-NLS-1$//$NON-NLS-2$

        AttributeDescriptor attributeType = getAttributeDescriptor(0);
        assertEquals("the_new_name", attributeType.getName()); //$NON-NLS-1$

        for( int i = 0; i < FeatureTypeEditor.testingGetTYPES().size(); i++ ) {
            cellModifier.modify(testingGetViewer.getTree().getItem(0), "1", i); //$NON-NLS-1$.
            attributeType = getAttributeDescriptor(0);
            assertEquals(FeatureTypeEditor.testingGetTYPES().get(i).getType(), attributeType
                    .getType());
        }
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

  private AttributeDescriptor getAttributeDescriptor(int index) {
        TreeViewer testingGetViewer = editor.testingGetViewer();
    SimpleFeatureTypeBuilder newFeatureTypeBuilder = (SimpleFeatureTypeBuilder) testingGetViewer.getInput();
        SimpleFeatureType type = newFeatureTypeBuilder.buildFeatureType();
        AttributeDescriptor attributeType = type.getDescriptor(index);
    return attributeType;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.