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

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


       
        imageBox.setLocation(new Point(43, 10));
        mapBox.setLocation(new Point(143, 210));
        labelBox.setLocation(new Point(100, 612));
       
        LabelBoxPrinter lbPrinter = new LabelBoxPrinter();
        MapBoxPrinter mbPrinter = new MapBoxPrinter();
        ImageBoxPrinter ibPrinter = new ImageBoxPrinter();
       
        mbPrinter.setMap(map);
        lbPrinter.setText("Image Example");
       
        mapBox.setBoxPrinter(mbPrinter);
        labelBox.setBoxPrinter(lbPrinter);
        imageBox.setBoxPrinter(ibPrinter);
       
View Full Code Here


    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$
        labelBoxPrinter.setText(text);
        labelBoxPrinter.setHorizontalAlignment(SWT.CENTER);
        try {
            FontData data = Display.getDefault().getSystemFont().getFontData()[0];

            data.setHeight(fontSize);
            data.setStyle(SWT.BOLD);

            Font font = AWTSWTImageUtils.swtFontToAwt(data);
            labelBoxPrinter.setFont(font);

        } catch (Exception e) {
            // oh well don't have that font type
        }
        boxes.add(labelBox);
View Full Code Here

        boxes.add(scaleBox);
    }

    private int addLabelBox( Map map, int width, final int labelWidth) {
        Box labelBox = ModelFactory.eINSTANCE.createBox();
        LabelBoxPrinter labelBoxPrinter = new LabelBoxPrinter();
        labelBoxPrinter.setText(formatName(map.getName()));
        labelBoxPrinter.setHorizontalAlignment(SWT.CENTER);
        try {
            FontData data = Display.getDefault().getSystemFont().getFontData()[0];

            data.setHeight( 18 );
            data.setStyle( SWT.BOLD );
            Font font = AWTSWTImageUtils.swtFontToAwt(data);
            labelBoxPrinter.setFont(font);

        } catch (Exception e) {
            // oh well don't have that font type
        }
        labelBox.setBoxPrinter(labelBoxPrinter);
View Full Code Here

TOP

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

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.