本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例10: doDrawBorder
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void doDrawBorder(EllipseAttribute ellipseAttr, Graphics graphics, Rectangle bounds) {
graphics.drawOval(bounds);
}
示例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();
}