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


Java Graphics.fillOval方法代码示例

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


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

示例1: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics g) {
	super.paintFigure(g);
	
	Rectangle r = getBounds();
	Rectangle square = new Rectangle(r.getLocation().getTranslated(0, r.height/4), new Dimension(r.width/2, r.height/2));
	center = new Point(square.x + square.width/2, square.y + square.height/2);

	g.setBackgroundColor(dirty ? PandionJConstants.Colors.HIGHLIGHT : PandionJConstants.Colors.VARIABLE_BOX);
	g.fillRectangle(square);

	g.setForegroundColor(ref.getRole() == Role.FIXED_VALUE ? PandionJConstants.Colors.CONSTANT : ColorConstants.black);
	g.drawRectangle(square);

	g.setBackgroundColor(error ? PandionJConstants.Colors.ERROR : ColorConstants.black);
	g.fillOval(center.x-3, center.y-3, 7, 7);

	if(isnull) {
		g.setForegroundColor(error ? PandionJConstants.Colors.ERROR : ColorConstants.black);
		Point dest = center.getTranslated(20, 0);
		g.drawLine(center, dest);
		g.drawLine(dest.getTranslated(-3, 5), dest.getTranslated(3, -5));
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:25,代码来源:ReferenceLabel.java

示例2: drawHistory

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
private void drawHistory(Graphics g, IArrayIndexModel v, Color color) {
	g.setBackgroundColor(color);
	List<String> history = v.getHistory();
	for (int j = 0; j < history.size()-1; j++) {
		Integer i = Integer.parseInt(history.get(j));
		Point p = getIndexLocation(i);
		
		if(horizontal)
			p = p.translate(0, EXTRA);
		
		g.fillOval(p.x, p.y, PandionJConstants.ILLUSTRATION_LINE_WIDTH+1, PandionJConstants.ILLUSTRATION_LINE_WIDTH+1);
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:14,代码来源:IllustrationBorder.java

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

示例4: doFillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void doFillShape(EllipseAttribute ellipseAttr, Graphics graphics, Rectangle bounds) {
  // minor adjustment to fix pixel errors between fill and border
  graphics.fillOval(bounds.x(), bounds.y(), bounds.width() + 1, bounds.height() +1);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:6,代码来源:EllipseDrawingStrategy.java

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