Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.AdaptableFeature


        Class geomType = type.getGeometryDescriptor().getType().getBinding();
        Geometry geom = GeometryBuilder.create().safeCreateGeometry(geomType, coordinates);
        newFeature.setDefaultGeometry(geom);
        fid = newFeature.getID();

        SimpleFeature feature = new AdaptableFeature(newFeature, editLayer);
       
        runFeatureCreationInterceptors(feature);

        map.getEditManagerInternal().addFeature(newFeature, (Layer) editLayer);
    }
View Full Code Here


* @since 1.1.0
*/
public class EditFeatureSelectionProvider extends AbstractMapEditorSelectionProvider implements IMapEditorSelectionProvider {

    public void setActiveMap( IMap map, MapPart editor ) {
        AdaptableFeature selectedFeature = (AdaptableFeature) map.getEditManager().getEditFeature();
        if( selectedFeature==null )
            selection=new StructuredSelection();
        else{
            selection=new StructuredSelection(selectedFeature);
        }
       
        map.getEditManager().addListener(new IEditManagerListener(){

            public void changed( EditManagerEvent event ) {
                if( event.getType()== EditManagerEvent.EDIT_FEATURE ){
                    AdaptableFeature selectedFeature = (AdaptableFeature) event.getNewValue();
                    if( selectedFeature==null )
                        selection=new StructuredSelection();
                    else{
                        selection=new StructuredSelection(selectedFeature);
                    }
View Full Code Here

    private SimpleFeature getAdaptableFeature(SimpleFeature feature, Layer layer) {
        if (feature == null || feature instanceof IAdaptable)
            return feature;

        return (SimpleFeature) new AdaptableFeature(feature, layer);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void addFeature(final SimpleFeature feature, Layer layer) throws IOException {

        SimpleFeature adaptableFeature = feature;
        if (!(feature instanceof IAdaptable)) {
            adaptableFeature = new AdaptableFeature(feature, layer);
        }
        // TODO FeatureInterceptor

        final SimpleFeature finalFeature = adaptableFeature;
        // setEditFeature(feature, layer);
View Full Code Here

        return true;
    }

    private void selectEditFeature( ) {

        AdaptableFeature selectedFeature = (AdaptableFeature) map.getEditManager().getEditFeature();
        if( selectedFeature==null )
            selection=new StructuredSelection();
        else{
            selection=new StructuredSelection(selectedFeature);
        }
View Full Code Here

            if (object instanceof CoveragePointInfo) {
                CoveragePointInfo info = (CoveragePointInfo) object;
                layer = info.getLayer();
            }
            if( object instanceof AdaptableFeature ){
                AdaptableFeature feature=(AdaptableFeature) object;
                layer=(ILayer) feature.getAdapter(ILayer.class);
            }
            if( layer==ApplicationGIS.getActiveMap().getEditManager().getSelectedLayer() ){
                return new StructuredSelection(object);
            }
        }
View Full Code Here

       
        private static final String FEATURE_LABEL = "FEATURE_LABEL"; //$NON-NLS-1$
       
        public String getText(Object element) {
            if (element instanceof AdaptableFeature) {
                final AdaptableFeature feature = (AdaptableFeature) element;
                return getFeatureLabel(feature);
            }
            else if (element instanceof LayerPointInfo) {
                LayerPointInfo info = (LayerPointInfo) element;                   
                return info.getLayer().getName();
View Full Code Here

        /**
         * @see org.locationtech.udig.project.internal.provider.LayerItemProvider
         */
        public Color getBackground(Object element) {
            if (element instanceof AdaptableFeature) {
                AdaptableFeature feature = (AdaptableFeature) element;
                LayerImpl layer = (LayerImpl) feature.getAdapter(ILayer.class);
                IColorProvider colorProvider = (IColorProvider) layer.getAdapter(IColorProvider.class);
                if (colorProvider == null) return null;
                return colorProvider.getBackground(layer);
            }           
            return null;
View Full Code Here

        /**
         * @see org.locationtech.udig.project.internal.provider.LayerItemProvider
         */
        public Color getForeground(Object element) {
            if (element instanceof AdaptableFeature) {
                AdaptableFeature feature = (AdaptableFeature) element;
                LayerImpl layer = (LayerImpl) feature.getAdapter(ILayer.class);
                IColorProvider colorProvider = (IColorProvider) layer.getAdapter(IColorProvider.class);
                if (colorProvider == null) return null;
                return colorProvider.getForeground(layer);
            }
            return null;
View Full Code Here

       
        @Override
        public Image getImage( Object element ) {
            ILayer layer = null;
            if( element instanceof AdaptableFeature){
                AdaptableFeature feature = (AdaptableFeature) element;
                layer = (ILayer) feature.getAdapter(ILayer.class);               
            }
            if( element instanceof LayerPointInfo){
                LayerPointInfo info = (LayerPointInfo) element;
                layer = info.getLayer();
            }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.AdaptableFeature

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.