Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Device


   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    if (textColor != null && textColor.getBgColor1() != null)
      gc.setForeground(textColor.getBgColor1());

    gc.setTextAntialias(TextAntialiasTab.aliasValues[aliasCombo.getSelectionIndex()]);
View Full Code Here


  }

  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();
    if (image == null) {
      image = example.loadImage(device, "irmaos.jpg");
      Rectangle rect = image.getBounds();
      FontData fd = device.getSystemFont().getFontData()[0];
      font = new Font(device, fd.getName(), rect.height / 4, SWT.BOLD);
      gc.setFont(font);
      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));
    gc.drawPath(path);
    path.dispose();
  }
View Full Code Here

    else
      size += 10;
  }

  public void paint(GC gc, int width, int height) {
    Device device = gc.getDevice();
    gc.setBackground(device.getSystemColor(SWT.COLOR_BLACK));
    gc.fillOval((width - size) / 2, (height - size) / 2, size, size);
  }
View Full Code Here

   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    String fontFace = (String) fontNames.get(fontFaceCb.getSelectionIndex());
    int points = fontPointSpinner.getSelection();
    int style = styleValues[fontStyleCb.getSelectionIndex()];

View Full Code Here

  }

  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    // array of coordinate points of polygon 1 (region 1)
    int[] polygon1 = new int[] { 10, height / 2, 9 * width / 16, 10, 9 * width / 16, height - 10 };
    Region region1 = new Region(device);
    region1.add(polygon1);
View Full Code Here

   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_club.jpg");

    Transform transform = new Transform(device);

View Full Code Here

  public String getText() {
    return GraphicsExample.getResourceString("LineCap"); //$NON-NLS-1$
  }

  public void paint(GC gc, int width, int height) {
    Device device = gc.getDevice();

    // draw side lines
    gc.setLineWidth(1);
    gc.setLineStyle(SWT.LINE_DOT);
    gc.setForeground(device.getSystemColor(SWT.COLOR_BLACK));
    gc.drawLine(3 * width / 16, height / 6, 3 * width / 16, 5 * height / 6);
    gc.drawLine(13 * width / 16, height / 6, 13 * width / 16, 5 * height / 6);
    gc.setLineStyle(SWT.LINE_SOLID);

    // draw labels
View Full Code Here

   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    // set line attributes
    gc.setLineWidth(20);
    gc.setLineCap(SWT.CAP_ROUND); // round line ends
    gc.setAntialias(SWT.ON); // smooth jagged edges
View Full Code Here

   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    Font font = new Font(device, FontBounceTab.getPlatformFontFace(fontFace), fontSize, fontStyle);
    gc.setFont(font);

    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);
    gc.drawPath(path);
    font.dispose();
    path.dispose();
View Full Code Here

   * @see org.eclipse.swt.examples.graphics.GraphicsTab#paint(org.eclipse.swt.graphics.GC, int, int)
   */
  public void paint(GC gc, int width, int height) {
    if (!example.checkAdvancedGraphics())
      return;
    Device device = gc.getDevice();

    if (ovalColorGB != null && ovalColorGB.getBgColor1() != null)
      gc.setBackground(ovalColorGB.getBgColor1());

    gc.setAntialias(aliasValues[aliasCombo.getSelectionIndex()]);
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.