Package org.locationtech.udig.project.ui.internal.tool

Examples of org.locationtech.udig.project.ui.internal.tool.ToolContext


     * @return a ToolContext
     * @see ToolContext
     */
    public static IToolContext createContext(IMap map) {
        if (map instanceof org.locationtech.udig.project.internal.Map) {
            ToolContext context = new ToolContextImpl();
            context
                    .setMapInternal((org.locationtech.udig.project.internal.Map) map);
            return context;
        }
        return null;
    }
View Full Code Here


            if (partRef.getPart(false) instanceof IUDIGView) {
                IUDIGView udigview = (IUDIGView) partRef.getPart(false);
                if (!views.contains(udigview))
                    views.add(udigview);
                SimpleFeature editFeature;
                ToolContext copy;
                synchronized (this) {
                    if (!validateContext(currentContext))
                        return;
                    copy = currentContext.copy();
                    editFeature = currentContext.getEditManager().getEditFeature();
View Full Code Here

         
        }
      });
        return;
      }
        final ToolContext context = ApplicationGISInternal.createContext(getLayer().getMap());
        final CoordinateReferenceSystem crs=getLayer().getCRS( );
        ReferencedEnvelope bounds = new ReferencedEnvelope(getFeature().getBounds());
        double deltax=bounds.getWidth()/4;
        double deltay=bounds.getHeight()/4;
        bounds.expandToInclude(bounds.getMinX()-deltax, bounds.getMinY()-deltay);
        bounds.expandToInclude(bounds.getMaxX()+deltax, bounds.getMaxY()+deltay);
        UndoableComposite composite = new UndoableComposite();
        IAction tool = ApplicationGIS.getToolManager().getToolAction("org.locationtech.udig.tools.selectionTool", "org.locationtech.udig.tool.edit.edit"); //$NON-NLS-1$ //$NON-NLS-2$
        // could be null if tool.edit plug-in is not in distribution.
        if( tool !=null ){
          tool.run();
        }
        NavCommand zoom = context.getNavigationFactory().createSetViewportBBoxCommand(
                bounds, crs);
        context.sendASyncCommand(zoom);
        composite.getCommands().add(context.getSelectionFactory().createFIDSelectCommand(getLayer(),getFeature()));
        composite.getCommands().add(context.getEditFactory().createSetEditFeatureCommand(getFeature(), getLayer()));
        context.sendASyncCommand(composite);
    }
View Full Code Here

            }
        } else if (dialogPage != null) {
            try {
                IUDIGDialogPage page = (IUDIGDialogPage) definition
                        .createExecutableExtension("dialogPage"); //$NON-NLS-1$
                ToolContext toolContext;
                synchronized (this.processor.partListener) {
                    toolContext = this.processor.partListener.currentContext;
                }
                page.setContext(toolContext);
                Dialog dialog = new FeatureEditorExtensionProcessor.EditorDialog(new Shell(display
View Full Code Here

        if (!map.eAdapters().contains(listener)){
            map.eAdapters().add(listener);
        }
       
        // Define the tool context allowing tools to interact with this map
        ToolContext tools = new ToolContextImpl();
        tools.setMapInternal(map);
       
        // Provide each tool with the new tool context
        //
        setContext(modalCategories, tools); // if active a modal tool is supposed to register listeners
        setContext(actionCategories, tools);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.ui.internal.tool.ToolContext

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.