Package org.locationtech.udig.printing.model.impl

Examples of org.locationtech.udig.printing.model.impl.MapGraphicBoxPrinter


    private MapGraphicResource graphic;

    public Command getCommand() {
        final MapGraphicResource newGraphic = graphic;
        graphic = null;
        final MapGraphicBoxPrinter boxPrinter = getBoxPrinter();
        final MapGraphicResource old = boxPrinter.getMapGraphic();
       
        return new Command(){
            @Override
            public void execute() {
                boxPrinter.setMapGraphic(newGraphic);
            }
           
            @Override
            public void undo() {
                boxPrinter.setMapGraphic(old);
            }
        };
    }
View Full Code Here


        addScale(height, scaleHeight, scaleWidth);
    }

    private void addScale( int height, int scaleHeight, int scaleWidth ) {
        Box scaleBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter scale = new MapGraphicBoxPrinter(null);
        scale.setMapGraphic(MapGraphicChooserDialog.findResource(ScalebarMapGraphic.class));
        scaleBox.setBoxPrinter(scale);
        scaleBox.setID("Scalebar Box"); //$NON-NLS-1$
        scaleBox.setLocation(new Point(MARGIN, height - MARGIN - scaleHeight));
        scaleBox.setSize(new Dimension(scaleWidth, scaleHeight));
        boxes.add(scaleBox);
View Full Code Here

    }

    private void addLegendBox( int height, final int legendWidth, int legendHeight, int labelHeight,
            Rectangle mapBounds ) {
        Box legendBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter legend = new MapGraphicBoxPrinter(null);
        legend.setMapGraphic(MapGraphicChooserDialog.findResource(LegendGraphic.class));
        legendBox.setBoxPrinter(legend);
        legendBox.setID("Legend Box"); //$NON-NLS-1$
        legendBox.setLocation(new Point(MARGIN + mapBounds.width + SPACING, MARGIN+labelHeight+MARGIN));
        legendBox.setSize(new Dimension(legendWidth, legendHeight));
        boxes.add(legendBox);
View Full Code Here

        return res;
    }

    protected void addScale( int xPos, int yPos, int scaleWidth, int scaleHeight ) {
        Box scaleBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter scale = new MapGraphicBoxPrinter(page);
        scale.setMapGraphic(MapGraphicChooserDialog.findResource(ScalebarMapGraphic.class));
        scaleBox.setBoxPrinter(scale);
        scaleBox.setID("Scalebar Box"); //$NON-NLS-1$
        scaleBox.setLocation(new Point(xPos, yPos));
        scaleBox.setSize(new Dimension(scaleWidth, scaleHeight));
        boxes.add(scaleBox);
View Full Code Here

        return mapBounds;
    }

    protected void addLegendBox( int xPos, int yPos, int legendWidth, int legendHeight ) {
        Box legendBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter legend = new MapGraphicBoxPrinter(page);
        legend.setMapGraphic(MapGraphicChooserDialog.findResource(LegendGraphic.class));
        legendBox.setBoxPrinter(legend);
        legendBox.setID("Legend Box"); //$NON-NLS-1$
        legendBox.setLocation(new Point(xPos, yPos));
        legendBox.setSize(new Dimension(legendWidth, legendHeight));
        boxes.add(legendBox);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.printing.model.impl.MapGraphicBoxPrinter

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.