Examples of Device


Examples of org.eclipse.swt.graphics.Device

        ShadeAlgorithm hsa = new ShadeAlgorithm();
        hsa.setMap(mapInstance);
        double[][] shading = hsa.call();
       
        int mapSize = mapInstance.getWidth();
        Device device = Display.getCurrent();
        background = new Image(device, mapSize, mapSize);
        GC gc = new GC(background);
       
        String makeRed = "MapPerProject";
       
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

    protected final int SELECTION_SIZE = 12;
    protected final int POINT_STROKE = 1

    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device device = Display.getCurrent();
        gc.setForeground(device.getSystemColor(SWT.COLOR_BLACK));
        gc.setBackground(device.getSystemColor(SWT.COLOR_WHITE));
        gc.setLineWidth(POINT_STROKE);
        gc.setAlpha(255);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

        if (labeling == null) return;
        paintLabels(labeling, gc);
    }
   
    public void paintLabels(Labeling labeling, GC gc) {
        Device device = gc.getDevice();
        String fname = ARIAL_NARROW;
        Font basefont = new Font(device, fname, 12, SWT.NORMAL);
       
        for (Label each: labeling.labels()) {
            FontData[] fontData = basefont.getFontData();
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

        return map.openFilesSelection;
    }
   
    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device d = gc.getDevice();
        gc.setBackground(d.getSystemColor(SWT.COLOR_WHITE));
        gc.setForeground(d.getSystemColor(SWT.COLOR_BLACK));
        gc.setLineWidth(1);
        gc.setAntialias(SWT.ON);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

    public void paintBefore(MapValues map, GC gc) {
        image = descriptor(MEEPLE).createImage();
        bounds = image.getBounds();       
        diameter = (int) Math.sqrt(bounds.width * bounds.width + bounds.height * bounds.height);
       
        Device d = gc.getDevice();
        gc.setBackground(d.getSystemColor(SWT.COLOR_WHITE));
        gc.setForeground(d.getSystemColor(SWT.COLOR_BLACK));
        gc.setLineWidth(1);
        gc.setAntialias(SWT.ON);       
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

        return .5;
    }

    @Override
    public void renderLabel(GC gc, String text, Rectangle bounds) {
        Device device = gc.getDevice();
        gc.setAlpha(128);
        gc.setForeground(device.getSystemColor(SWT.COLOR_BLACK));
        gc.drawText(text, bounds.x + 1, bounds.y + 1, SWT.DRAW_TRANSPARENT);
        gc.setAlpha(255);
       
        gc.setForeground(device.getSystemColor(SWT.COLOR_WHITE));
        gc.drawText(text, bounds.x, bounds.y, SWT.DRAW_TRANSPARENT);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

        }
    }

    @Override
    public void paintChild(MapValues map, GC gc, Location each) {
        Device device = gc.getDevice();
        int mapSize = map.mapSize.getValue();
        int magic_r = (int) (each.getElevation() * 2 * mapSize / DEMAlgorithm.MAGIC_VALUE);
       
        gc.setAlpha(128);       
        gc.setBackground(device.getSystemColor(SWT.COLOR_LIST_SELECTION));
        gc.fillOval(each.px - magic_r, each.py - magic_r, magic_r * 2, magic_r * 2);
       
        gc.setAlpha(255);       
        gc.setForeground(device.getSystemColor(SWT.COLOR_WHITE));
       
        gc.drawOval(each.px-magic_r, each.py-magic_r, magic_r*2, magic_r*2);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

    private static final int PADDING_X = 6;
    private static final int PADDING_Y = 1;

    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device device = gc.getDevice();
        gc.setLineWidth(1);
        gc.setAlpha(255);
        gc.setForeground(device.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
        gc.setBackground(device.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

        gc.setBackground(device.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    }

    @Override
    public void paintChild(MapValues map, GC gc, Location location) {
        Device device = gc.getDevice();
        gc.setFont(device.getSystemFont());
        String name = location.getName();
        Point e = gc.stringExtent(name);
        e.x += PADDING_X * 2;
        e.y += PADDING_Y * 2;
        int[] polygon = new int[] {
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

    }

    @Override
    public void paintChild(MapValues map, GC gc, Location each) {
        // draw background
        Device device = gc.getDevice();
       
        // get transform
        Transform save = new Transform(device);
        gc.getTransform(save);
        Transform t = new Transform(device);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.