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


Java Graphics.drawOval方法代码示例

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


在下文中一共展示了Graphics.drawOval方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
/**
 * @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

示例3: paintFigure

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

    if (isDangling) {
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(5, 5, 12, 12);
        graphics.drawLine(7, 7, 5 + 10, 5 + 10);
        graphics.drawLine(7 + 8, 7, 7, 7 + 8);
    }

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

示例4: 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

示例5: 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

示例6: 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);

    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,代码来源:ClassFigure.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);

    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,代码来源:UseCaseFigure.java

示例8: 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);

    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,代码行数:16,代码来源:EnumerationFigure.java

示例9: 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

示例10: doDrawBorder

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void doDrawBorder(EllipseAttribute ellipseAttr, Graphics graphics, Rectangle bounds) {
  graphics.drawOval(bounds);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:5,代码来源:EllipseDrawingStrategy.java

示例11: drawPoint

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * Draw point with the pointStyle and size of the trace;
 * 
 * @param graphics
 * @param pos
 */
public void drawPoint(Graphics graphics, Point pos) {
	// Shortcut when no point requested
	if (pointStyle == PointStyle.NONE)
		return;
	graphics.pushState();
	graphics.setBackgroundColor(traceColor);
	// graphics.setForegroundColor(traceColor);
	graphics.setLineWidth(1);
	graphics.setLineStyle(SWTConstants.LINE_SOLID);
	switch (pointStyle) {
	case POINT:
		graphics.fillOval(new Rectangle(pos.x - pointSize / 2, pos.y
				- pointSize / 2, pointSize, pointSize));
		break;
	case CIRCLE:
		graphics.drawOval(new Rectangle(pos.x - pointSize / 2, pos.y
				- pointSize / 2, pointSize, pointSize));
		break;
	case TRIANGLE:
		graphics.drawPolygon(new int[] { pos.x - pointSize / 2,
				pos.y + pointSize / 2, pos.x, pos.y - pointSize / 2,
				pos.x + pointSize / 2, pos.y + pointSize / 2 });
		break;
	case FILLED_TRIANGLE:
		graphics.fillPolygon(new int[] { pos.x - pointSize / 2,
				pos.y + pointSize / 2, pos.x, pos.y - pointSize / 2,
				pos.x + pointSize / 2, pos.y + pointSize / 2 });
		break;
	case SQUARE:
		graphics.drawRectangle(new Rectangle(pos.x - pointSize / 2, pos.y
				- pointSize / 2, pointSize, pointSize));
		break;
	case FILLED_SQUARE:
		graphics.fillRectangle(new Rectangle(pos.x - pointSize / 2, pos.y
				- pointSize / 2, pointSize, pointSize));
		break;
	case BAR:
		graphics.drawLine(pos.x, pos.y - pointSize / 2, pos.x, pos.y
				+ pointSize / 2);
		break;
	case CROSS:
		graphics.drawLine(pos.x, pos.y - pointSize / 2, pos.x, pos.y
				+ pointSize / 2);
		graphics.drawLine(pos.x - pointSize / 2, pos.y, pos.x + pointSize
				/ 2, pos.y);
		break;
	case XCROSS:
		graphics.drawLine(pos.x - pointSize / 2, pos.y - pointSize / 2,
				pos.x + pointSize / 2, pos.y + pointSize / 2);
		graphics.drawLine(pos.x + pointSize / 2, pos.y - pointSize / 2,
				pos.x - pointSize / 2, pos.y + pointSize / 2);
		break;
	case DIAMOND:
		graphics.drawPolyline(new int[] { pos.x, pos.y - pointSize / 2,
				pos.x - pointSize / 2, pos.y, pos.x, pos.y + pointSize / 2,
				pos.x + pointSize / 2, pos.y, pos.x, pos.y - pointSize / 2 });
		break;
	case FILLED_DIAMOND:
		graphics.fillPolygon(new int[] { pos.x, pos.y - pointSize / 2,
				pos.x - pointSize / 2, pos.y, pos.x, pos.y + pointSize / 2,
				pos.x + pointSize / 2, pos.y });
		break;
	default:
		break;
	}
	graphics.popState();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:74,代码来源:Trace.java


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