当前位置: 首页>>代码示例>>Java>>正文


Java Graphics.setAntialias方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.Graphics.setAntialias方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.setAntialias方法的具体用法?Java Graphics.setAntialias怎么用?Java Graphics.setAntialias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.Graphics的用法示例。


在下文中一共展示了Graphics.setAntialias方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.AbstractNotationNodeFigure#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
protected void paintFigure(Graphics graphics) {
    
    super.paintFigure(graphics);
    graphics.drawRectangle(getLocation().x, getLocation().y, getSize().width - 1, getSize().height - 1);

    graphics.setAntialias(SWT.ON);
    
    Rectangle bounds = getBounds();
    if(isDangling()){
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(bounds.x, bounds.y, 12, 12);
        graphics.drawLine(bounds.x + 2, bounds.y + 2, bounds.x + 10, bounds.y + 10);
        graphics.drawLine(bounds.x + 10, bounds.y + 2, bounds.x + 2, bounds.y + 10);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:DataTypeFigure.java

示例2: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void paintFigure(final Graphics graphics) {
    final ERDiagramConnection connection = (ERDiagramConnection) getParent();

    graphics.setAntialias(SWT.ON);

    final Color color = connection.getColor();

    if (color != null) {
        graphics.setForegroundColor(color);
        graphics.setBackgroundColor(color);
    }

    super.paintFigure(graphics);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:19,代码来源:ERDecoration.java

示例3: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void paintFigure(Graphics graphics) {
	ERDiagramConnection connection = (ERDiagramConnection) this.getParent();

	graphics.setAntialias(SWT.ON);

	Color color = connection.getColor();

	if (color != null) {
		graphics.setForegroundColor(color);
		graphics.setBackgroundColor(color);
	}

	super.paintFigure(graphics);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:19,代码来源:ERDecoration.java

示例4: createFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    polygonDecoreation.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    polygonDecoreation.setScale(10, 5);
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());

    return connection;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:GeneralizationEditPart.java

示例5: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.AbstractNotationNodeFigure#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
protected void paintFigure(Graphics graphics) {
    
    super.paintFigure(graphics);
    graphics.setAntialias(SWT.ON);

    graphics.drawRectangle(getLocation().x, getLocation().y, getSize().width - 1, getSize().height - 1);
    
    Rectangle bounds = getBounds();
    if(isDangling()){
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(bounds.x, bounds.y, 12, 12);
        graphics.drawLine(bounds.x + 2, bounds.y + 2, bounds.x + 10, bounds.y + 10);
        graphics.drawLine(bounds.x + 10, bounds.y + 2, bounds.x + 2, bounds.y + 10);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:ArtifactFigure.java

示例6: outlineShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see Shape#outlineShape(Graphics)
 */
protected void outlineShape(Graphics graphics) {
	DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();
	
	graphics.setAntialias(SWT.ON);
	graphics.setForegroundColor(color);
	graphics.setLineWidth(theme.getLineWidth());
	graphics.drawPolyline(getPoints());
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:12,代码来源:DwParentChildConnectionFigure.java

示例7: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see org.eclipse.draw2d.Shape#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
public void paintFigure(Graphics graphics) {
    graphics.setAntialias(SWT.ON);
    super.paintFigure(graphics);
    fragmentBoundary.setPoints(getInitializedPointList());
    fragmentLabel.setLocation(getBounds().getCopy().getLocation());
    fragmentLabel.setSize(LABEL_WIDTH, LABEL_HEIGHT);
    
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:13,代码来源:CombinedFragmentFigure.java

示例8: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics graphics) {
	super.paintFigure(graphics);
	graphics.setAntialias(SWT.ON);
	paintCompose(graphics);
	paintBody(graphics);
	paindButtonsBar(graphics);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:9,代码来源:EmailDialogFigure.java

示例9: 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());
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:35,代码来源:PtolemyModelElementShape.java

示例10: outlineShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.ShadowShape#outlineShape(org.eclipse.draw2d.Graphics, org.eclipse.draw2d.geometry.Rectangle)
 */
protected void outlineShape(Graphics graphics, Rectangle bounds) {
    PointList pl = setupPoints(bounds);
    graphics.setAntialias(SWT.ON);
    graphics.drawPolygon(pl);
    int add = graphics.getLineWidth() / 2;
    graphics.drawOval(new Rectangle(ovalX, ovalY, ovalD + add, ovalD + add));
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:11,代码来源:StickMan.java

示例11: fillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.ShadowShape#fillShape(org.eclipse.draw2d.Graphics, org.eclipse.draw2d.geometry.Rectangle)
 */
protected void fillShape(Graphics graphics, Rectangle bounds) {
    PointList pl = setupPoints(bounds);
    graphics.setAntialias(SWT.ON);
    graphics.fillPolygon(pl);
    int add = graphics.getLineWidth() / 2;
    graphics.fillOval(new Rectangle(ovalX, ovalY, ovalD + add, ovalD + add));
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:11,代码来源:StickMan.java

示例12: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see org.eclipse.draw2d.Shape#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
public void paintFigure(Graphics graphics) {
    super.paintFigure(graphics);

    graphics.setAntialias(SWT.ON);
    Rectangle bounds = getBounds();
    if (isDangling()) {
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(bounds.x, bounds.y, 12, 12);
        graphics.drawLine(bounds.x + 2, bounds.y + 2, bounds.x + 10, bounds.y + 10);
        graphics.drawLine(bounds.x + 10, bounds.y + 2, bounds.x + 2, bounds.y + 10);
    }

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:CollaborationFigure.java

示例13: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see org.eclipse.draw2d.Figure#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
protected void paintFigure(Graphics graphics) {

    // Rectangle r = new Rectangle();
    r.setBounds(getBounds());
    r.crop(getInsets());

    int pixelWidth = 2;
    PointList diamond = new PointList(4);
    // 4 points of the diamond.
    Point top, right, bottom, left;
    top = new Point(r.x + r.width / 2, r.y);
    right = new Point((r.x + r.width - pixelWidth), r.y + r.height / 2);
    bottom = new Point((r.x + r.width / 2 - pixelWidth), r.y + r.height - 1); // The
                                                                              // -1
                                                                              // fixes
                                                                              // the
                                                                              // look
    left = new Point(r.x, r.y + r.height / 2);

    diamond.removeAllPoints();
    diamond.addPoint(top);
    diamond.addPoint(right);
    diamond.addPoint(bottom);
    diamond.addPoint(left);

    // graphics.setBackgroundColor(ColorConstants.lightGray);
    graphics.setAntialias(SWT.ON);

    graphics.fillPolygon(diamond);
    graphics.drawPolygon(diamond);
    super.paintFigure(graphics);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:MergeNodeFigure.java

示例14: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.AbstractNotationNodeFigure#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
protected void paintFigure(Graphics graphics) {
    super.paintFigure(graphics);

    graphics.setAntialias(SWT.ON);
    Rectangle bounds = getBounds();
    if(isDangling()){
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(bounds.x, bounds.y, 12, 12);
        graphics.drawLine(bounds.x + 2, bounds.y + 2, bounds.x + 10, bounds.y + 10);
        graphics.drawLine(bounds.x + 10, bounds.y + 2, bounds.x + 2, bounds.y + 10);
    }
    
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:InterfaceFigure.java

示例15: 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());
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:34,代码来源:SvgModelElementShape.java


注:本文中的org.eclipse.draw2d.Graphics.setAntialias方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。