本文整理汇总了Java中org.eclipse.draw2d.Graphics.setTextAntialias方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.setTextAntialias方法的具体用法?Java Graphics.setTextAntialias怎么用?Java Graphics.setTextAntialias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.Graphics
的用法示例。
在下文中一共展示了Graphics.setTextAntialias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillShape
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void fillShape(Graphics graphics) {
LOGGER.trace("SVG fillShape - entry - for {}", getIconURI());
try {
svgShapeBounds = svgShapeBounds != null ? svgShapeBounds : determineExtremeBounds(getIconURI());
int minX = svgShapeBounds.x;
int minY = svgShapeBounds.y;
int width = svgShapeBounds.width;
int height = svgShapeBounds.height;
setInitialSize(ga, width, height);
// Simple instance caching to reduce redrawing overhead doesn't work here as it seems
// we need to reconstruct the figure after all, when its shape is being moved.
// TODO figure out a way in graphiti to differentiate plain redrawing due to selection/changes
// somewhere else in the diagram, vs when this figure's shape effectively needs redrawing...
// if (figure == null) {
figure = new SVGFigure();
// move SVG figure from its defined top-left to origin (0,0) top-left
figure.setTranslateX(-minX);
figure.setTranslateY(-minY);
figure.setURI(getIconURI());
figure.setBounds(this.getBounds());
// }
graphics.setAntialias(SWT.ON);
graphics.setTextAntialias(SWT.ON);
figure.paint(graphics);
} catch (IOException e) {
LOGGER.error("Error drawing SVG shape " + getIconURI(), e);
}
LOGGER.trace("SVG fillShape - exit - for {}", getIconURI());
}
示例2: fillShape
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void fillShape(Graphics graphics) {
LOGGER.trace("Ptolemy fillShape - entry - for {}", getIconURI());
try {
iconDef = iconDef != null ? iconDef : (EditorIcon) WorkflowUtils.readFrom(URI.create(getIconURI()));
// As Ptolemy II icon definitions often use negative coordinates,
// while draw2d graphics assumes a top-left corner at (0,0),
// the overall icon shape drawing must first determine the most extreme
// boundaries as defined in the icon MOML and translate the draw2d coordinates space
// accordingly before starting the effective drawing.
ptShapeBounds = ptShapeBounds != null ? ptShapeBounds : determineExtremeBounds(iconDef, graphics);
LOGGER.debug("Extreme bounds for {} : {}", getIconURI(), ptShapeBounds);
int width = ptShapeBounds.width;
int height = ptShapeBounds.height;
Rectangle bnds = getBounds();
graphics.setAntialias(SWT.ON);
graphics.setTextAntialias(SWT.ON);
graphics.drawRectangle(bnds.x, bnds.y, width, height);
graphics.translate(getLocation());
graphics.translate(ptShapeBounds.getTopLeft().getNegated().getTranslated(1, 1));
for (VisibleAttribute a : iconDef.attributeList(VisibleAttribute.class)) {
DrawingStrategy drawingStrategy = drawingStrategies.get(a.getClass());
if (drawingStrategy != null) {
drawingStrategy.draw(a, graphics, resourceManager);
}
}
setInitialSize(ga, width + 2, height + 2);
} catch (Exception e) {
LOGGER.error("Error drawing ptolemy shape " + getIconURI(), e);
}
LOGGER.trace("Ptolemy fillShape - exit - for {}", getIconURI());
}