Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Dimension


        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


            template.setMapScaleHint(currentViewportScaleDenom);
       
       
        //3. make the page itself
        Page page = ModelFactory.eINSTANCE.createPage();
        page.setSize(new Dimension((int)pageSize.getWidth(), (int)pageSize.getHeight()));

        //page name stuff not required, because this page will just get discarded
        MessageFormat formatter = new MessageFormat(Messages.CreatePageAction_newPageName, Locale.getDefault());
        if (page.getName() == null || page.getName().length() == 0) {
            page.setName(formatter.format(new Object[] { mapNoRasterLayers.getName() }));
View Full Code Here

        }
        if (page == null) {
            throw new RuntimeException(Messages.PrintAction_pageError);
        }

        Dimension pSize = page.getSize();

        float factor = (float) pSize.height / (float) pSize.width;
        float xPlus = 10f;
        float yPlus = xPlus * factor;
        int w = pSize.width - (int) xPlus;
        int h = pSize.height - (int) yPlus;
        page.setSize(new Dimension(w, h));

    }
View Full Code Here

     * @param map the Map to be drawn
     */
    public void init( Page page, Map map ) {
        this.page = page;
        com.lowagie.text.Rectangle paperRectangle = getPaperSize();
        Dimension paperSize = new Dimension((int) paperRectangle.getWidth(), (int) paperRectangle
                .getHeight());
        // set the requested papersize
        page.setPaperSize(paperSize);
        // then apply the ratio of the papersize also to the page size.
        setPageSizeFromPaperSize(page, paperSize);
View Full Code Here

        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

    protected abstract com.lowagie.text.Rectangle getPaperSize();

    protected int addLabelBox( String text, int xPos, int yPos, int labelWidth, int labelHeight,
            int fontSize, float scaleFactor ) {
        Box labelBox = ModelFactory.eINSTANCE.createBox();
        labelBox.setSize(new Dimension(labelWidth, labelHeight));
        labelBox.setLocation(new Point(xPos, yPos));
        LabelBoxPrinter labelBoxPrinter = new LabelBoxPrinter(scaleFactor);
        labelBox.setBoxPrinter(labelBoxPrinter);

        labelBox.setID("Standard Label"); //$NON-NLS-1$
View Full Code Here

        mapBox.setBoxPrinter(mapBoxPrinter);
        mapBoxPrinter.setMap(map);
       

        Rectangle mapBounds = new Rectangle(xPos, yPos, mapWidth, mapHeight);
        mapBox.setSize(new Dimension(mapBounds.width, mapBounds.height));
        mapBox.setPaperSize(paperSize);

        mapBox.setLocation(new Point(mapBounds.x, mapBounds.y));
        boxes.add(mapBox);
        return mapBounds;
View Full Code Here

        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

            height = new Double(pageFormat.getImageableHeight()).intValue();
        }

        Page page = ModelFactory.eINSTANCE.createPage();

        page.setSize(new Dimension(width, height));

        MessageFormat formatter = new MessageFormat("{0} - " + template.getAbbreviation(), Locale
                .getDefault());
        if (page.getName() == null || page.getName().length() == 0) {
            page.setName(formatter.format(new Object[]{map.getName()}));
View Full Code Here

    public Rectangle getMapBounds() throws IllegalStateException {
        Rectangle bounds = null;
        for( Box box : boxes ) {
            if (box.getBoxPrinter() instanceof MapBoxPrinter) {
                Dimension size = box.getSize();
                Point location = box.getLocation();
                bounds = new Rectangle(location.x, location.y, size.width, size.height);
            }
        }
        return bounds;
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.geometry.Dimension

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.