Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Font.dispose()


    Font oldFont = font;
    font = null;
    setExampleWidgetFont();
    setExampleWidgetSize();
    if (oldFont != null)
      oldFont.dispose();
  }

  void resetLabels() {
    String methodRoot = nameCombo.getText();
    returnTypeLabel.setText(parameterInfo(methodRoot));
View Full Code Here


    // column 1, row 1
    Font font = new Font(device, TextAntialiasTab.getPlatformFontFace(0), 100, SWT.NORMAL);
    gc.setFont(font);
    Point size = gc.stringExtent(text);
    gc.drawString(text, width / 4 - size.x / 2, height / 4 - size.y / 2, true);
    font.dispose();

    // column 1, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(1), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 1, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(1), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, width / 4 - size.x / 2, 3 * height / 4 - size.y / 2, true);
    font.dispose();

    // column 2, row 1
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(2), 50, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 2, row 1
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(2), 50, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 0, true);
    font.dispose();

    // column 2, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(3), 100, SWT.ITALIC);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 2, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(3), 100, SWT.ITALIC);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, (height - size.y) / 2, true);
    font.dispose();

    // column 2, row 3
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(4), 50, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 2, row 3
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(4), 50, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, height - size.y, true);
    font.dispose();

    // column 3, row 1
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(5), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 3, row 1
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(5), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, 3 * width / 4 - size.x / 2, height / 4 - size.y / 2, true);
    font.dispose();

    // column 3, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(6), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
View Full Code Here

    // column 3, row 2
    font = new Font(device, TextAntialiasTab.getPlatformFontFace(6), 100, SWT.NORMAL);
    gc.setFont(font);
    size = gc.stringExtent(text);
    gc.drawString(text, 3 * width / 4 - size.x / 2, 3 * height / 4 - size.y / 2, true);
    font.dispose();
  }
}
View Full Code Here

      gc.setForegroundPattern(pattern);
    }

    gc.drawString(text, (width - textWidth) / 2, (height - textHeight) / 2, true);

    font.dispose();
    if (pattern != null)
      pattern.dispose();
  }

}
View Full Code Here

    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 5 * height / 12, true);
    text = GraphicsExample.getResourceString("Round"); //$NON-NLS-1$
    size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 7 * height / 12, true);
    font.dispose();

    Pattern pattern = null;
    if (foreground.getBgColor1() != null)
      gc.setForeground(foreground.getBgColor1());
    else if (foreground.getBgImage() != null) {
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.