org.eclipse.swt.graphics.GC.setTextAntialias()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.eclipse.swt.graphics.GC.setTextAntialias()方法的一些代码示例,展示了GC.setTextAntialias()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.setTextAntialias()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:setTextAntialias

GC.setTextAntialias介绍

[英]Sets the receiver's text anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing only for all text drawing operations.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.
[中]将接收方的文本抗锯齿值设置为参数,该参数必须是SWT.DEFAULTSWT.OFFSWT.ON中的一个。请注意,这仅控制所有文本绘图操作的抗锯齿。
此操作需要操作系统的高级图形子系统,该子系统在某些平台上可能不可用。

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setup(FontContext context) {
  GC gc = ((SWTFontContext) context).getGC();
  gc.setTextAntialias(_antialiasing ? SWT.ON : SWT.OFF);
}

代码示例来源:origin: rherrmann/eclipse-extras

private void prepareGC() {
 if( gc.getAdvanced() ) {
  gc.setTextAntialias( SWT.ON );
 }
 gc.fillRectangle( clientArea );
}

代码示例来源:origin: com.github.rinde/rinsim-problem

void drawTimeline() {
  final GC gc = new GC(contents);
  gc.setAdvanced(true);
  // gc.setAntialias(SWT.ON);
  gc.setTextAntialias(SWT.OFF);
  final int large = (600000 / 15000);
  final int small = large / 5;
  for (int i = 0; i < contents.getBounds().width; i += small) {
   final int height = i % large == 0 ? 10 : 5;
   if (i % large == 0) {
    String time = TimeFormatter.format(15000 * i);
    time = time.substring(0, time.length() - 3);
    gc.setFont(font);
    final Point size = gc.textExtent(time);
    gc.drawText(time, i - (size.x / 2), 0);
   }
   gc.drawLine(i, 20 - height, i, 20);
  }
  gc.dispose();
 }
}

代码示例来源:origin: BiglySoftware/BiglyBT

gc.setTextAntialias( SWT.ON );

代码示例来源:origin: org.apache.uima/textmarker-ep-caseditor

private Image updateIcon(Type type) {
 AnnotationStyle style = editor.getAnnotationStyle(type);
 Color fg = new Color(Display.getCurrent(), 0, 0, 0);
 Color bg = new Color(Display.getCurrent(), style.getColor().getRed(), style.getColor()
     .getGreen(), style.getColor().getBlue());
 PaletteData paletteData = new PaletteData(new RGB[] { bg.getRGB(), fg.getRGB() });
 ImageData imageData = new ImageData(40, 40, 1, paletteData);
 Image image = new Image(Display.getCurrent(), imageData);
 GC gc = new GC(image);
 String styleString = style.getStyle().name().substring(0, 2);
 Point p = gc.stringExtent(styleString);
 gc.dispose();
 image.dispose();
 imageData = new ImageData(p.x + 4, p.y, 1, paletteData);
 image = new Image(Display.getCurrent(), imageData);
 gc = new GC(image);
 gc.setBackground(bg);
 gc.setForeground(fg);
 gc.setTextAntialias(SWT.ON);
 gc.drawString(styleString, 2, 0);
 gc.dispose();
 Image oldImage = icons.get(type);
 if (oldImage != null) {
  oldImage.dispose();
 }
 icons.put(type, image);
 return image;
}

代码示例来源:origin: org.apache.uima/ruta-ep-caseditor

private Image updateIcon(Type type) {
 AnnotationStyle style = editor.getAnnotationStyle(type);
 Color fg = new Color(Display.getCurrent(), 0, 0, 0);
 Color bg = new Color(Display.getCurrent(), style.getColor().getRed(),
     style.getColor().getGreen(), style.getColor().getBlue());
 PaletteData paletteData = new PaletteData(new RGB[] { bg.getRGB(), fg.getRGB() });
 ImageData imageData = new ImageData(40, 40, 1, paletteData);
 Image image = new Image(Display.getCurrent(), imageData);
 GC gc = new GC(image);
 String styleString = style.getStyle().name().substring(0, 2);
 Point p = gc.stringExtent(styleString);
 gc.dispose();
 image.dispose();
 imageData = new ImageData(p.x + 4, p.y, 1, paletteData);
 image = new Image(Display.getCurrent(), imageData);
 gc = new GC(image);
 gc.setBackground(bg);
 gc.setForeground(fg);
 gc.setTextAntialias(SWT.ON);
 gc.drawString(styleString, 2, 0);
 gc.dispose();
 Image oldImage = icons.get(type);
 if (oldImage != null) {
  oldImage.dispose();
 }
 icons.put(type, image);
 return image;
}

代码示例来源:origin: com.github.rinde/rinsim-pdptw

final void drawTimeline() {
  final GC gc = new GC(contents);
  gc.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  gc.fillRectangle(0, 0, contents.getBounds().width,
   contents.getBounds().height);
  gc.setAdvanced(true);
  gc.setTextAntialias(SWT.ON);
  for (int i = 0; i < contents.getBounds().width; i += SMALL_TICK_DIST) {
   final int height = i % LARGE_TICK_DIST == 0 ? LARGE_TICK_HEIGHT
    : SMALL_TICK_HEIGHT;
   if (i % LARGE_TICK_DIST == 0) {
    final String time = FORMATTER
     .print(new Period(0L, TIME_PER_PIXEL * i));
    gc.setFont(font);
    final Point size = gc.textExtent(time);
    gc.drawText(time, i - size.x / 2, 0, true);
   }
   gc.drawLine(i, TL_BAR_HEIGHT_PX - height, i, TL_BAR_HEIGHT_PX);
  }
  gc.dispose();
 }
}

代码示例来源:origin: rinde/RinSim

final void drawTimeline() {
  final GC gc = new GC(contents);
  gc.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  gc.fillRectangle(0, 0, contents.getBounds().width,
   contents.getBounds().height);
  gc.setAdvanced(true);
  gc.setTextAntialias(SWT.ON);
  for (int i = 0; i < contents.getBounds().width; i += SMALL_TICK_DIST) {
   final int height = i % LARGE_TICK_DIST == 0 ? LARGE_TICK_HEIGHT
    : SMALL_TICK_HEIGHT;
   if (i % LARGE_TICK_DIST == 0) {
    final String time = FORMATTER
     .print(new Period(0L, TIME_PER_PIXEL * i));
    gc.setFont(font);
    final Point size = gc.textExtent(time);
    gc.drawText(time, i - size.x / 2, 0, true);
   }
   gc.drawLine(i, TL_BAR_HEIGHT_PX - height, i, TL_BAR_HEIGHT_PX);
  }
  gc.dispose();
 }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

setForegroundPattern(null);
setInterpolation(SWT.DEFAULT);
setTextAntialias(SWT.DEFAULT);
setTransform(null);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

gc.setTextAntialias(SWT.ON);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

gc.setTextAntialias(SWT.ON);
gc.setTextAntialias(antialias); // smooth jagged edges

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

setForegroundPattern(null);
setInterpolation(SWT.DEFAULT);
setTextAntialias(SWT.DEFAULT);
setTransform(null);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

setForegroundPattern(null);
setInterpolation(SWT.DEFAULT);
setTextAntialias(SWT.DEFAULT);
setTransform(null);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

setForegroundPattern(null);
setInterpolation(SWT.DEFAULT);
setTextAntialias(SWT.DEFAULT);
setTransform(null);

代码示例来源:origin: BiglySoftware/BiglyBT

gc.setTextAntialias(SWT.ON);
} catch (Exception e) {

代码示例来源:origin: BiglySoftware/BiglyBT

gc.setTextAntialias(antialiasMode);
} catch (Exception ex) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.tips.ui

gc.setFont(SWTResourceManager.getBoldFont(gc.getFont()));
gc.setAlpha(200);
gc.setTextAntialias(SWT.ON);
if (tipCount > 9) {
  gc.fillOval(0, 0, textExtent.x + 8, imageHeight);

代码示例来源:origin: BiglySoftware/BiglyBT

gcBuffer.setTextAntialias(SWT.ON);
 gcBuffer.setAntialias(SWT.ON);
} catch(Exception e) {

代码示例来源:origin: BiglySoftware/BiglyBT

gc.setTextAntialias(SWT.ON);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

gc.setForeground(textColor.getBgColor1());
gc.setTextAntialias(aliasValues[aliasCombo.getSelectionIndex()]);

相关文章

GC类方法