Package org.locationtech.udig.project.internal.command.navigation

Examples of org.locationtech.udig.project.internal.command.navigation.SetViewportBBoxCommand


                  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


            return; // no go
        }
       
        //NavigationCommandFactory navigate = NavigationCommandFactory.getInstance();

        NavCommand show = new SetViewportBBoxCommand(areaOfInterest, world);
        imap.sendCommandASync( show );
    }
View Full Code Here

                            env = JTS.transform(env, map.getEditManager().getEditLayer()
                                    .layerToMapTransform());
                        } catch (Exception e1) {
                            ProjectUIPlugin.log(null, e1);
                        }
                        map.sendCommandASync(new SetViewportBBoxCommand(env, map.getViewportModel().getCRS()));
                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                                .activate(editor);
                    }

                });
View Full Code Here

        public SetZoomToMapToolAction() {
            super("Zoom to Map"); //$NON-NLS-1$
        }
        public void run() {
            ReferencedEnvelope bounds = map.getBounds(new NullProgressMonitor());
            map.sendCommandASync(new SetViewportBBoxCommand(bounds));
        }
View Full Code Here

        public SetZoomToMapToolAction() {
            super("Zoom to Map"); //$NON-NLS-1$
        }
        public void run() {
            ReferencedEnvelope bounds = getMap().getBounds(new NullProgressMonitor());
            getMap().sendCommandASync(new SetViewportBBoxCommand(bounds));
        }
View Full Code Here

     * @return a new SetViewportBBoxCommand object
     * @see NavCommand
     * @see Envelope
     */
    public NavCommand createSetViewportBBoxCommand( Envelope newbbox ) {
        return new SetViewportBBoxCommand(newbbox);
    }
View Full Code Here

    public NavCommand createPanCommandUsingWorldCoords( double x, double y ) {
        return new PanCommand(x, y);
    }

  public NavCommand createSetViewportBBoxCommand(Envelope bounds, CoordinateReferenceSystem crs) {
    return new SetViewportBBoxCommand(bounds, crs);
  }
View Full Code Here

                // new bounding box
                ReferencedEnvelope re = new ReferencedEnvelope( xmin, xmax, ymin, ymax, model.getCRS() );

                // create a navigation command to update the viewport
                map.sendCommandSync( new SetViewportBBoxCommand(re) );
            }
        } );
    }
View Full Code Here

            }

            //ApplicationGIS.drawMap makes a copy of the map, and may change its bounds.  If it does change
            //the bounds then update the original map to match (this will force the mapgraphics to update too)
            if (!getMap().getViewportModel().getBounds().equals(modifiedMap.getViewportModel().getBounds())) {
                SetViewportBBoxCommand cmdBBox = new SetViewportBBoxCommand(modifiedMap.getViewportModel().getBounds());
                getMap().sendCommandSync(cmdBBox);
            }
           
            //restore regular clip rectangle
            graphics.setClip(0, 0, size.width, size.height);
View Full Code Here

    ILayer selectedLayer = getContext().getSelectedLayer();
    Filter selectionFilter = selectedLayer.getFilter();
    try {
      SimpleFeatureSource source = selectedLayer.getResource(SimpleFeatureSource.class, ProgressManager.instance().get());
      ReferencedEnvelope bounds = source.getFeatures(selectionFilter).getBounds();
      getContext().sendASyncCommand(new SetViewportBBoxCommand(bounds, true));
    } catch (IOException e) {
      e.printStackTrace();
    }
   
  }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.command.navigation.SetViewportBBoxCommand

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.