Examples of ILayer


Examples of org.locationtech.udig.project.ILayer

            if (comboViewer == null || disposed) {
                listenAOILayer(false);
                return; // the view has shutdown!
            }

            ILayer current = getSelected();
            // check combo
            if (current != selected) {
                try {
                    listenCombo(false);
                    comboViewer.setSelection(new StructuredSelection(selected), true);
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

                    monitor.beginTask(Messages.ArrowSelection_0, 5);
                    ReferencedEnvelope bbox = getContext().getBoundingBox(new Point(x, y), 5);
                    SimpleFeatureCollection collection = null;
                    FeatureIterator<SimpleFeature> iter = null;
                    try {
                        ILayer selectedLayer = getContext().getSelectedLayer();
                        SimpleFeatureSource source = selectedLayer.getResource(
                                SimpleFeatureSource.class, new SubProgressMonitor(monitor, 1));
                        if (source == null)
                            return;
                        collection = source.getFeatures(selectedLayer.createBBoxFilter(bbox,
                                new SubProgressMonitor(monitor, 1)));
                        iter = collection.features();
                        if (!iter.hasNext()) {
                            if (!e.buttonsDown()) {
                                getContext().sendASyncCommand(
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

        comboViewer.setContentProvider(new ArrayContentProvider());
        comboViewer.setLabelProvider(new LabelProvider(){
            @Override
            public String getText( Object element ) {
                if (element instanceof ILayer) {
                    ILayer layer = (ILayer) element;
                    return layer.getName();
                }
                return super.getText(element);
            }
        });
        List<ILayer> layers = getAOILayerStrategy().getAOILayers();
        comboViewer.setInput(layers);
       
        ILayer activeLayer = getAOILayerStrategy().getActiveLayer();
        setSelected(activeLayer);
       
        comboViewer.addSelectionChangedListener(comboListener);
       
//        // list of current AOI features
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

        if (comboViewer == null || disposed) {
            listenStrategy(false);
            return; // the view has shutdown!
        }
       
        ILayer current = getSelected();
        // check combo
        if (current != selected) {
            try {
                listenCombo(false);
                comboViewer.setSelection(new StructuredSelection(selected), true);
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

    public ZoomSelection() {
    }

    public void run() {
        ILayer layer = getContext().getSelectedLayer();
        if (layer.hasResource(SimpleFeatureSource.class)) {
            try {
                SimpleFeatureSource resource = featureSource(layer);
                Query query = layer.getQuery(true);
                ReferencedEnvelope bounds = resource.getBounds(query);
                if (bounds == null) {
                  FeatureCollection<SimpleFeatureType, SimpleFeature> featureResult = resource.getFeatures(query);
                  if (featureResult != null && !featureResult.isEmpty()) {
                    ReferencedEnvelope envelope = featureResult.getBounds();
                    if (envelope != null) {
                      bounds = new ReferencedEnvelope(envelope, layer.getCRS());
                    }
                  }
                }
               
                if (bounds != null) {
                  // If the selection is a single point the bounds will
                  // have height == 0 and width == 0. This will break
                  // in ScaleUtils:306. Adding 1 to the extent fixes the problem:
                  if (bounds.getHeight() <= 0 || bounds.getWidth() <= 0) {
                      bounds.expandBy(1);
                  }
                  bounds = ScaleUtils.fitToMinAndMax(bounds, layer);
 
                  getContext().sendASyncCommand(new SetViewportBBoxCommand(bounds, layer.getCRS()));
              }
            } catch (IOException e) {
                SelectPlugin.log("failed to obtain resource", e); //$NON-NLS-1$
            }
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

            table.update();
            return;
        }
       
        Map map = currentEditor.getMap();
        final ILayer selectedLayer = map.getEditManager().getSelectedLayer();
        // layerSelecte returns if layer==newLayer.  If both are null we still want to listen to map for a
        // layer being added (and selected).
        if( selectedLayer==null && layer == null ){
            map.getEditManager().addListener(editManagerListener);
            return;
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

            return;
        }
        for( Iterator< ? > iter = structuredSelection.iterator(); iter.hasNext(); ) {
            Object item = iter.next();
            if (item instanceof ILayer) {
                ILayer layer = (ILayer) item;
                selection.add(layer);
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                selection.add(layerItem.getLayer());
            }
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

            return;
        }
        for( Iterator< ? > iter = structuredSelection.iterator(); iter.hasNext(); ) {
            Object item = iter.next();
            if (item instanceof ILayer) {
                ILayer layer = (ILayer) item;
                selection.add(layer);
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                selection.add(layerItem.getLayer());
            }
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

    private CircleAnimation animation;

    public void draw(MapGraphicContext context) {
        if (this.animation == null) {
            ILayer layer = context.getLayer();
            IBlackboard blackboard = layer.getBlackboard();
            blackboard.putInteger("x", 0);
            blackboard.putInteger("y", 50);
            this.animation = new CircleAnimation(layer, context);
            AnimationUpdater.runTimer(context.getMapDisplay(), animation);
        }
View Full Code Here

Examples of org.locationtech.udig.project.ILayer

            return;
        }

        for (Iterator<?> iter = structuredSelection.iterator(); iter.hasNext();) {
            final Object item = iter.next();
            ILayer layer = null;
            if (item instanceof ILayer) {
                layer = (ILayer) item;
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                layer = layerItem.getLayer();
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.