Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.Map


     * @param editor MapEditor associated with the support view (such as the Layers view)
     */
    @SuppressWarnings("unchecked")
    void setActiveTool( MapPart editor ) {
        // ensure we are listening to this MapPart's Map
        Map map = editor.getMap();
        Adapter listener = getCommandListener(editor);
        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);
View Full Code Here


    /**
     * Retrieves the redo action that is used by much of the map components such as the MapEditor
     * and the LayersView. redoes the last undone command sent to the currently active map.
     */
    public IAction getREDOAction() {
        Map activeMap = ApplicationGISInternal.getActiveMap();
        redoLock.lock();
        try{
            if (redoAction == null) {
                redoAction = new Action(){
                    /**
                     * @see org.eclipse.jface.action.Action#run()
                     */
                    public void run() {
                        Map activeMap = ApplicationGISInternal.getActiveMap();
                        if (activeMap != ApplicationGIS.NO_MAP)
                            activeMap.redo();
                    }
                };
                redoAction.setImageDescriptor(sharedImages
                        .getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
                redoAction.setText(Messages.ToolManager_redoAction);
                redoAction.setActionDefinitionId("org.eclipse.ui.edit.redo"); //$NON-NLS-1$
            }
            if (activeMap != ApplicationGIS.NO_MAP)
                redoAction.setEnabled(activeMap.getCommandStack().canRedo());
            else
                redoAction.setEnabled(false);

        return redoAction;
        }finally{
View Full Code Here

     * and the LayersView. Undoes the last command sent to the currently active map.
     *
     * @param part
     */
    public IAction getUNDOAction() {
        Map activeMap = ApplicationGISInternal.getActiveMap();
        undoLock.lock();
        try{
            if (undoAction == null) {
                undoAction = new Action(){
                    /**
                     * @see org.eclipse.jface.action.Action#run()
                     */
                    public void run() {
                        Map activeMap = ApplicationGISInternal.getActiveMap();
                        if (activeMap != ApplicationGIS.NO_MAP)
                            activeMap.undo();
                    }
                };
                undoAction.setImageDescriptor(sharedImages
                        .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
                undoAction.setText(Messages.ToolManager_undoAction);
                undoAction.setActionDefinitionId("org.eclipse.ui.edit.undo"); //$NON-NLS-1$
            }
            if (activeMap != ApplicationGIS.NO_MAP)
                undoAction.setEnabled(activeMap.getCommandStack().canUndo());
            else
                undoAction.setEnabled(false);
            return undoAction;
        }finally{
            undoLock.unlock();
View Full Code Here

    /**
     * Retrieves the forward navigation action that is used by much of the map components such as
     * the MapEditor and the LayersView. Executes the last undone Nav command on the current map.
     */
    public IAction getFORWARD_HISTORYAction() {
        Map activeMap = ApplicationGISInternal.getActiveMap();
        forwardLock.lock();
        try{
            if (forwardAction == null) {
                forwardAction = new Action(){
                    /**
                     * @see org.eclipse.jface.action.Action#run()
                     */
                    public void run() {
                        Map activeMap = ApplicationGISInternal.getActiveMap();
                        if (activeMap != ApplicationGIS.NO_MAP)
                            activeMap.forwardHistory();
                    }
                };
                forwardAction.setImageDescriptor(sharedImages
                        .getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
                forwardAction.setText(Messages.ToolManager_forward);
                forwardAction.setToolTipText(Messages.ToolManager_forward_tooltip);
                forwardAction.setActionDefinitionId("org.eclipse.ui.navigate.forward"); //$NON-NLS-1$
            }
            if (activeMap != ApplicationGIS.NO_MAP)
                forwardAction.setEnabled(activeMap.getCommandStack().canRedo());
            else
                forwardAction.setEnabled(false);
            return forwardAction;
        }finally{
            forwardLock.unlock();
View Full Code Here

     * the MapEditor and the LayersView. Undoes the last Nav command set to the current map.
     *
     * @param part
     */
    public IAction getBACKWARD_HISTORYAction() {
        Map activeMap = ApplicationGISInternal.getActiveMap();
        backwardLock.lock();
        try{
            if (backwardAction == null) {
                backwardAction = new Action(){
                    /**
                     * @see org.eclipse.jface.action.Action#run()
                     */
                    public void run() {
                        Map activeMap = ApplicationGISInternal.getActiveMap();
                        if (activeMap != ApplicationGIS.NO_MAP)
                            activeMap.backwardHistory();
                    }

                };
                backwardAction.setImageDescriptor(sharedImages
                        .getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
                backwardAction.setText(Messages.ToolManager_back);
                backwardAction.setToolTipText(Messages.ToolManager_back_tooltip);
                backwardAction.setActionDefinitionId("org.eclipse.ui.navigate.back"); //$NON-NLS-1$
            }
            if (activeMap != ApplicationGIS.NO_MAP)
                backwardAction.setEnabled(activeMap.getCommandStack().canUndo());
            else
                backwardAction.setEnabled(false);
        }finally{
            backwardLock.unlock();
        }
View Full Code Here

                    // Map map = (Map) getTarget();
                    /*
                     * While this adapter is a singlton and added to all opened maps, each time
                     * target variable is reset.
                     */
                    Map map = null;
                    switch( msg.getFeatureID(msg.getNotifier().getClass()) ) {
                    case ProjectPackage.MAP__COMMAND_STACK:
                        map = (Map) msg.getNotifier();
                        setCommandActions(map, editor);
                        break;
View Full Code Here

    /**
     * Updates the crs label in the statusbar.
     */
    protected void updateCRS() {
        Map map = getMap();
        if (map == null) {
            getSite().getPage().closeEditor(this, false);
            return;
        }
        CoordinateReferenceSystem crs = map.getViewportModel().getCRS();
        if (crs == null || crs.getName() == null) {
            return;
        }

        final String full = crs.getName().getCode();
View Full Code Here

                           
                            /*
                             * when closing a map the platform wants to save the map resource,
                             * but if you are removing the map, its no longer available.
                             */
                            final Map map = getMap();
                            final Resource resource = map.eResource();
                            if (resource != null)
                                resource.save(ProjectPlugin.getPlugin().saveOptions);

                            // need to kick the Project so viewers will update
                            p.eNotify(new ENotificationImpl((InternalEObject) p, Notification.SET,
View Full Code Here

    /**
     * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
     */
    protected void setInput( IEditorInput input ) {
        if (getEditorInput() != null) {
            Map map = (Map) ((UDIGEditorInput) getEditorInput()).getProjectElement();
            if (viewer != null) {
                viewer.setMap(null);
            }
            map.removeMapCompositionListener(mapCompositionListener);
            map.removeMapListener(mapListener);
            map.getEditManager().removeListener(editListener);
        }
        super.setInput(input);
        if (input != null) {
            if (viewer != null) {
                viewer.setMap((Map) ((UDIGEditorInput) input).getProjectElement());
View Full Code Here

        // allow the viewer to open our context menu; work with our selection proivder etc
        viewer.init(this);
       
        // if a map was provided as input we can ask the viewer to use it
        Map input = (Map) ((UDIGEditorInput) getEditorInput()).getProjectElement();
        if (input != null) {
            viewer.setMap(input);
        }

        FormData formdata = new FormData();
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.Map

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.