Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Path.addString()


                                * binLabels[i].length()) {
                    Transform tr = new Transform(disp);
                    tr.rotate(-90.0f);
                    g.setTransform(tr);
                    Path p = new Path(disp);
                    p.addString(binLabels[i], -c.getBounds().height + 5,
                            x1 + (int) (0.5 * width) - 10, f);
                    g.fillPath(p);
                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
View Full Code Here


                                * binLabels[i].length()) {
                    Transform tr = new Transform(disp);
                    tr.rotate(-90.0f);
                    g.setTransform(tr);
                    Path p = new Path(disp);
                    p.addString(binLabels[i], -c.getBounds().height + 5,
                            x1 + (int) (0.5 * width) - 10, f);
                    g.fillPath(p);
                    tr.rotate(90.0f);
                    g.setTransform(tr);
                    tr.dispose();
View Full Code Here

      path = new Path(device);
      String text = GraphicsExample.getResourceString("SWT"); //$NON-NLS-1$
      Font font = new Font(device, "Times", 200, SWT.NORMAL);
      gc.setFont(font);
      Point size = gc.stringExtent(text);
      path.addString(text, (width - size.x) / 2, (height - size.y) / 2, font);
      font.dispose();
      gc.setClipping(path);
      path.dispose();
      break;
    case 4: // star
View Full Code Here

      Point size = gc.stringExtent(text);
      textWidth = size.x;
      textHeight = size.y;
    }
    Path path = new Path(device);
    path.addString(text, x, y, font);
    gc.setClipping(path);
    Rectangle rect = image.getBounds();
    gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, width, height);
    gc.setClipping((Rectangle) null);
    gc.setForeground(device.getSystemColor(SWT.COLOR_BLUE));
View Full Code Here

    Point size = gc.stringExtent(text);
    textWidth = size.x;
    textHeight = size.y;

    Path path = new Path(device);
    path.addString(text, x, y, font);

    gc.setForeground(device.getSystemColor(foreGrdColor));
    gc.setBackground(device.getSystemColor(fillColor));

    gc.fillPath(path);
View Full Code Here

        if (image != null)
          gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, rect.width, rect.height);
        gc.setAlpha(100);
        gc.setTransform(tr);
        Path path = new Path(display);
        path.addString("SWT", 0, 0, font);
        gc.setBackground(display.getSystemColor(SWT.COLOR_GREEN));
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
        gc.fillPath(path);
        gc.drawPath(path);
        tr.dispose();
View Full Code Here

        tr.rotate(-30);
        gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, rect.width / 2, rect.height / 2);
        gc.setAlpha(100);
        gc.setTransform(tr);
        Path path = new Path(display);
        path.addString("SWT", 0, 0, font);
        gc.setBackground(display.getSystemColor(SWT.COLOR_GREEN));
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
        gc.fillPath(path);
        gc.drawPath(path);
        tr.dispose();
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.