Package org.opengis.feature.type

Examples of org.opengis.feature.type.AttributeDescriptor


     * @param type attribute descriptor
     */
    private Object toDefaultValue( PropertyDescriptor descriptor ) {
        Object value = null;
        if( descriptor instanceof AttributeDescriptor ){
            AttributeDescriptor attributeDescriptor = (AttributeDescriptor) descriptor;
            value = attributeDescriptor.getDefaultValue();
            if( value != null ){
                return value;
            }
        }
        Class< ? > type = descriptor.getType().getBinding();
View Full Code Here


            SimpleFeature f = (SimpleFeature) element;           
            if (columnIndex == 0) return f.getID();
            if( owningFeatureTableControl.features==null )
                return ""; //$NON-NLS-1$
            String attName = owningFeatureTableControl.getViewer().getTable().getColumn(columnIndex).getText();
            AttributeDescriptor at = f.getFeatureType().getDescriptor(attName);
            if (Geometry.class.isAssignableFrom(at.getType().getBinding())) { //was at.isGeometry()
                Object att = f.getAttribute(attName);
                if( att==null )
                    return ""; //$NON-NLS-1$
                String s =
                    att.getClass().getName();
View Full Code Here

   */
  public String getAttributeName(int attIndex) {

    assert attIndex < getAttributeCount();

    AttributeDescriptor attributeType = featureType.getDescriptor(attIndex);

    return attributeType.getLocalName();
  }
View Full Code Here

     * (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

     * (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

           
        };
    }

    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

    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

        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

        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

                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

TOP

Related Classes of org.opengis.feature.type.AttributeDescriptor

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.