Package org.eclipse.swt.graphics

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


    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

        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

    }

    @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

        save.dispose();
    }

    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device device = gc.getDevice();
       
        path = new Path(device);
        path.moveTo(0, 0);
        path.lineTo(-NEEDLEWIDTH, NEEDLEHEIGHT);
        path.quadTo(-CP_X_OFFSET, +CP_Y_OFFSET, 0, HEAD_Y_OFFSET);
        path.quadTo(CP_X_OFFSET, CP_Y_OFFSET, NEEDLEWIDTH, NEEDLEHEIGHT);
        path.lineTo(0, 0);       
        path.close();
       
        gc.setAlpha(255);
        Color red = new Color(device, 252, 99, 58);
        gc.setForeground(device.getSystemColor(SWT.COLOR_BLACK));
        gc.setBackground(red);
        red.dispose();
        gc.setLineWidth(SELECTION_STROKE);
    }
View Full Code Here

    @Override
    public void paintControl(PaintEvent e) {
        if (!(e.widget instanceof Canvas)) throw new Error();
        try {
            GC gc = e.gc;
            Device device = gc.getDevice();
            Color waterColor = colorScheme().getWaterColor().asSWTColor(device);
            gc.setBackground(waterColor);
            gc.fillRectangle(gc.getClipping());
           
            Point bounds = ((Canvas) e.widget).getSize();
View Full Code Here

        if (labelScheme == null) labelScheme = new DefaultLabelScheme();
        return computeValue(monitor, mapInstance, labelScheme);
    }

    private Labeling computeValue(ProgressMonitor monitor, MapInstance mapInstance, MapScheme<String> labelScheme) {
        Device device = Display.getDefault();
        Image image = new Image(device, 8, 8); // to get a GC
        GC gc = new GC(image);
        Iterable<Label> labels = makeLabels(monitor, gc, mapInstance, labelScheme);
        labels = new LayoutAlgorithm().layout(labels);
        gc.dispose();
View Full Code Here

    private MarkerSelection markerSelection;

    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device device = gc.getDevice();
        Color orange = new Color(device, 255, 200, 0);
        gc.setBackground(orange);
    }
View Full Code Here

        return computeValue(monitor, mapInstance, elevationModel, hillShading, colors);
    }

    private Image computeValue(ProgressMonitor monitor, MapInstance mapInstance, DigitalElevationModel elevationModel, HillShading hillShading, MapScheme<MColor> colors) {
        int mapSize = mapInstance.getWidth();
        Device device = Display.getCurrent();
        Image image = new Image(device, mapSize, mapSize);
        GC gc = new GC(image);
        this.paintWater(monitor, gc);       
        this.paintBackground(monitor, gc, mapInstance, elevationModel, hillShading, colors);
        gc.dispose();
View Full Code Here

   * create controls for this part<br>
   */
  private void createCustomControls(){
    getBaseComposite().setLayout(new RowLayout());

    Device device = Display.getDefault();
    Color bgColor = new Color (device, 130, 130, 130);
    getBaseComposite().setBackground(bgColor);
   
    captionLabel = new Label(getBaseComposite(), SWT.NONE);
    captionLabel.setBackground(getBaseComposite().getBackground());
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Device

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.