本文整理汇总了Java中org.eclipse.swt.graphics.GC.setAntialias方法的典型用法代码示例。如果您正苦于以下问题:Java GC.setAntialias方法的具体用法?Java GC.setAntialias怎么用?Java GC.setAntialias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.graphics.GC
的用法示例。
在下文中一共展示了GC.setAntialias方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
public void render(XCalendar popup, GC gc) {
final XCalendarModel model = popup.getModel();
final XCalendarTheme theme = model.getTheme();
final Transform t = new Transform(gc.getDevice());
//
try (final XCalendarFrame frame = new XCalendarFrame(gc, t)) {
//
Rectangle area = new Rectangle((area = popup.getClientArea()).x, area.y, area.width - 1, area.height - 1);
gc.setAdvanced(true);
gc.setAntialias(SWT.ON);
gc.setBackground(theme.getBackground(true, false, false, false));
gc.fillRectangle(area); gc.setForeground(theme.getGrid(true)); gc.drawRectangle(area);
List<XCalendarWidget> widgets = popup.getWidgets();
for(XCalendarWidget widget:widgets) widget.render(frame);
}
}
示例2: resizeImage
import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
private Image resizeImage(Image image, int width, int height) {
Image scaled = new Image(Display.getDefault(), width, height);
GC gc = new GC(scaled);
gc.setAntialias(SWT.ON);
gc.setInterpolation(SWT.HIGH);
gc.drawImage(image, 0, 0,image.getBounds().width, image.getBounds().height, 0, 0, width, height);
gc.dispose();
image.dispose();
return scaled;
}
示例3: resize
import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
private Image resize(Image image, int width, int height) {
Image scaled = new Image(display, width, height);
GC gc = new GC(scaled);
gc.setAntialias(SWT.ON);
gc.setInterpolation(SWT.HIGH);
gc.drawImage(image, 0, 0, image.getBounds().width, image.getBounds().height,
0, 0, width, height);
gc.dispose();
image.dispose();
return scaled;
}
示例4: cellPaint
import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
Comparable sortValue = cell.getSortValue();
if (!(sortValue instanceof Long)) {
return;
}
boolean isShare = false;
long health = ((Long) sortValue).longValue();
if (health >= 256) {
health -= 256;
isShare = true;
}
String color = null;
if (health == DownloadManager.WEALTH_KO) {
color = "#f00";
} else if (health == DownloadManager.WEALTH_OK) {
color = "#0f0";
} else if (health == DownloadManager.WEALTH_NO_TRACKER) {
color = "#0ff";
} else if (health == DownloadManager.WEALTH_NO_REMOTE) {
color = "#00f";
} else if (health == DownloadManager.WEALTH_ERROR) {
color = "#800";
}
if (color != null) {
Rectangle bounds = cell.getBounds();
gc.setAdvanced(true);
gc.setAntialias(SWT.ON);
if (isShare) {
gc.setForeground(ColorCache.getColor(gc.getDevice(), color));
gc.fillGradientRectangle(bounds.x, bounds.y, bounds.width, bounds.height, true);
} else {
gc.setBackground(ColorCache.getColor(gc.getDevice(), color));
gc.fillRoundRectangle(bounds.x, bounds.y, bounds.width, bounds.height, bounds.height, bounds.height);
}
}
}