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

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

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

GC.getAntialias介绍

[英]Returns the receiver's anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.
[中]返回接收器的抗锯齿设置值,该值将是SWT.DEFAULTSWT.OFFSWT.ON中的一个。请注意,这将控制所有非文本绘图操作的抗锯齿。

代码示例

代码示例来源:origin: org.microemu/microemu-javase-swt

public boolean getAntialias()
{
  if (gc.getAntialias() == SWT.ON) {
    return  true;
  } else {
    return false;
  }
}

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

public Object getRenderingHint(Key key) {
  if (RenderingHints.KEY_ANTIALIASING.equals(key)) {
    switch (_gc.getAntialias()) {
    case SWT.DEFAULT:
      return RenderingHints.VALUE_ANTIALIAS_DEFAULT;
    case SWT.OFF:
      return RenderingHints.VALUE_ANTIALIAS_OFF;
    case SWT.ON:
      return RenderingHints.VALUE_ANTIALIAS_ON;
    }
  }
  return null;
}

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

private void onPaint(PaintEvent e) {
  if (hoverState == STATE_NORMAL)
    return;
  GC gc = e.gc;
  Rectangle carea = getClientArea();
  gc.setBackground(getHoverBackground());
  int savedAntialias = gc.getAntialias();
  FormUtil.setAntialias(gc, SWT.ON);
  gc.fillRoundRectangle(carea.x + HMARGIN, carea.y + 2, carea.width
      - HMARGIN * 2, carea.height - 4, ARC_WIDTH, ARC_HEIGHT);
  FormUtil.setAntialias(gc, savedAntialias);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

private void onPaint(PaintEvent e) {
  if (hoverState == STATE_NORMAL)
    return;
  GC gc = e.gc;
  Rectangle carea = getClientArea();
  gc.setBackground(getHoverBackground());
  int savedAntialias = gc.getAntialias();
  FormUtil.setAntialias(gc, SWT.ON);
  gc.fillRoundRectangle(carea.x + HMARGIN, carea.y + 2, carea.width
      - HMARGIN * 2, carea.height - 4, ARC_WIDTH, ARC_HEIGHT);
  FormUtil.setAntialias(gc, savedAntialias);
}

代码示例来源:origin: org.xworker/xworker_swt

public void draw(Canvas canvas, GC gc){
  //打开反锯齿
  int antialias = gc.getAntialias();
  if(antialias != SWT.ON) {
    gc.setAntialias(SWT.ON);
  }
  
  //先填充画面
  Color oldColor = gc.getBackground();
  gc.setBackground(canvas.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  gc.fillRectangle(canvas.getClientArea());
  gc.setBackground(oldColor);
  
  if(backgroundImage != null){
    gc.drawImage(backgroundImage, 0, 0);
  }
  
  //绘画各种形状
  for(SimpleShape shape : shapes){			
    try {
      shape.draw(canvas, gc);
    }catch(Exception e) {
      logger.warn("Draw SimpleDraw2d shape exception, path=" + shape.getThing().getMetadata().getPath(), e);
    }
  }
}

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

@Override
protected void paintHyperlink(GC gc) {
  int as = gc.getAntialias();
  gc.setAntialias(SWT.ON);
  Color bg;
  if (!isEnabled())
    bg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
  else if (hover && getHoverDecorationColor() != null)
    bg = getHoverDecorationColor();
  else if (getDecorationColor() != null)
    bg = getDecorationColor();
  else
    bg = getForeground();
  gc.setBackground(bg);
  int[] data;
  Point size = getSize();
  int x = (size.x - 9) / 2;
  int y = (size.y - 9) / 2;
  if (isExpanded())
    data = translate(onPoints, x, y);
  else
    data = translate(offPoints, x, y);
  gc.fillPolygon(data);
  gc.setBackground(getBackground());
  gc.setAntialias(as);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

final Color oldBackground = gc.getBackground();
final int oldLineWidth = gc.getLineWidth();
final int oldAntialias = gc.getAntialias();

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

int oldAntialias = gc.getAntialias ();
Pattern oldBackgroundPattern = gc.getBackgroundPattern ();
Pattern oldForegroundPattern = gc.getForegroundPattern ();

相关文章

GC类方法