Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.IMap


                return Integer.toString(scale2);
            }

            public void modify(Object element, String property, Object value) {
                TableItem item = (TableItem) element;
                IMap map = (IMap) item.getData();
                try{
                    int parseInt = Integer.parseInt((String) value);
                    if( parseInt<-1 ){
                        setErrorMessage(message);
                    }
                    map.getBlackboard().putInteger(SCALE, parseInt);
                    viewer2.update(map, new String[]{SCALE});               
                    setErrorMessage(null);
                }catch (NumberFormatException e) {
                    setErrorMessage(message);
                    return ;
View Full Code Here


        public String getColumnText( Object element, int columnIndex ) {
            if( columnIndex==0 ){
                return wrapped.getText(element);
            }
            IMap map = (IMap) element;
            int scale = getScaleDenom(map);
            if( scale==-1 ){
                return Messages.MapSelectorPageWithScaleColumn_defaultScale;
            }
            return "1:"+scale; //$NON-NLS-1$
View Full Code Here

                public void run() {
                    try {
                        IWorkbenchWindow window = PlatformUI.getWorkbench()
                                .getActiveWorkbenchWindow();
                        IEditorReference[] refs = window.getActivePage().getEditorReferences();
                        IMap map = ApplicationGIS.getActiveMap();

                        for( IEditorReference ref : refs ) {
                            IEditorInput input = ref.getEditorInput();
                            if (input instanceof UDIGEditorInput) {
                                UDIGEditorInput in = (UDIGEditorInput) input;
View Full Code Here

    private static Shell shell;

    private RasterLegendStyle legendStyle;

    public void draw( MapGraphicContext context ) {
        IMap activeMap = ApplicationGIS.getActiveMap();
        IMap currentMap = context.getLayer().getMap();
        if (!activeMap.equals(currentMap)) {
            return;
        }

        context.getLayer().setStatus(ILayer.WORKING);
View Full Code Here

    public boolean canStyle( Layer aLayer ) {
        return aLayer.hasResource(RasterLegendGraphic.class);
    }

    private void checkStyle() {
        IMap activeMap = ApplicationGIS.getActiveMap();

        IBlackboard styleBlackboard = activeMap.getBlackboard();
        if (style == null) {
            style = (RasterLegendStyle) styleBlackboard.get(RasterLegendStyleContent.ID);
        }
        if (style == null) {
            style = RasterLegendStyleContent.createDefault();
View Full Code Here

    public void preApply() {
        updateBlackboard();
    }

    private void updateBlackboard() {
        IMap activeMap = ApplicationGIS.getActiveMap();
        IBlackboard styleBlackboard = activeMap.getBlackboard();
        style = (RasterLegendStyle) styleBlackboard.get(RasterLegendStyleContent.ID);

        if (style == null) {
            style = RasterLegendStyleContent.createDefault();
            styleBlackboard.put(RasterLegendStyleContent.ID, style);
View Full Code Here

            //outside the graphics canvas
            graphics.setClip(1, 1, size.width-2, size.height-2);
           
            java.awt.Dimension awtSize = new java.awt.Dimension(
                    size.width, size.height);
            IMap modifiedMap = null;
            if (scaleDenom == -1) {
                //ApplicationGIS.drawMap(new DrawMapParameter(graphics, awtSize, getMap(), monitor, true));
                modifiedMap = ApplicationGIS.drawMap(new DrawMapParameter(graphics, awtSize, getMap(), null /*use current scale*/, 90, selectionStyle, monitor, true, true));
            }
            else {
                BoundsStrategy boundsStrategy = new BoundsStrategy(scaleDenom);
                modifiedMap = ApplicationGIS.drawMap(new DrawMapParameter(graphics, awtSize, getMap(), boundsStrategy, 90, selectionStyle, monitor, true, true));
            }

            //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

                }
            } else if (GOTO_BOOKMARK_ACTION_ID.equals(action.getId())) {
                Bookmark bookmark = (Bookmark) selection.getFirstElement();
                gotoBookmark(bookmark);
            } else if (ADD_BOOKMARK_ACTION_ID.equals(action.getId())) {
                IMap map = ApplicationGIS.getActiveMap();
                if (map != ApplicationGIS.NO_MAP) {
                    IViewportModel v = map.getViewportModel();
                    Envelope env = v.getBounds();
                    ReferencedEnvelope bounds;
                    if (env instanceof ReferencedEnvelope) {
                        bounds = (ReferencedEnvelope) env;
                    } else {
View Full Code Here

         * @return Object[]
         */
        public Object[] getChildren( Object arg0 ) {

            if (arg0 instanceof IMap) {
                IMap map = (IMap) arg0;

                List<ILayer> layers = map.getMapLayers();

                return filteredLayers(layers);
            } else if (arg0 instanceof ILayer) {
                return null;
            }
View Full Code Here

         *
         * @param arg0 the input data
         * @return Object[]
         */
        public Object[] getElements( Object arg0 ) {
            IMap map = ApplicationGIS.getActiveMap();
            return new Object[]{map};
        }
View Full Code Here

TOP

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

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.