org.eclipse.swt.graphics.GC.drawOval()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.eclipse.swt.graphics.GC.drawOval()方法的一些代码示例,展示了GC.drawOval()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.drawOval()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:drawOval

GC.drawOval介绍

[英]Draws the outline of an oval, using the foreground color, within the specified rectangular area.

The result is a circle or ellipse that fits within the rectangle specified by the x, y, width, and height arguments.

The oval covers an area that is width + 1 pixels wide and height + 1 pixels tall.
[中]

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

int x_oval = LEFT + MARGIN + str.length() * fontwidth + offset.x;
int y_oval = TOP + i * ( fontheight + 2 ) + offset.y;
gc.drawOval( x_oval, y_oval, fontwidth, fontheight );
gc.fillOval( x_oval, y_oval, fontwidth, fontheight );
gc.setForeground( black );

代码示例来源:origin: pentaho/pentaho-kettle

int x_oval = LEFT + MARGIN + str.length() * fontwidth + offset.x;
int y_oval = TOP + i * ( fontheight + 2 ) + offset.y;
gc.drawOval( x_oval, y_oval, fontwidth, fontheight );
gc.fillOval( x_oval, y_oval, fontwidth, fontheight );
gc.setForeground( black );

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void drawOval(int x, int y, int width, int height) {
  _gc.drawOval(x, y, width, height);
}

代码示例来源:origin: org.jfree/swtgraphics2d

/**
 * Draws an oval that fits within the specified rectangular region.
 *
 * @param x  the x-coordinate.
 * @param y  the y-coordinate.
 * @param width  the frame width.
 * @param height  the frame height.
 *
 * @see #fillOval(int, int, int, int)
 * @see #draw(Shape)
 */
@Override
public void drawOval(int x, int y, int width, int height) {
  this.gc.drawOval(x, y, width - 1, height - 1);
}

代码示例来源:origin: rinde/RinSim

void drawCircle(Point p, int radius) {
 gc.get().drawOval(
  vp.get().toCoordX(p.x) - radius,
  vp.get().toCoordY(p.y) - radius,
  radius * 2,
  radius * 2);
}

代码示例来源:origin: rinde/RinSim

void drawCircle(Point p, double radius) {
 gc.get().drawOval(
  vp.get().toCoordX(p.x - radius),
  vp.get().toCoordY(p.y - radius),
  vp.get().scale(radius * 2),
  vp.get().scale(radius * 2));
}

代码示例来源:origin: org.piccolo2d/piccolo2d-swt

/**
 * Draws the outline of an oval. The result is a circle or ellipse that fits
 * within the rectangle specified by the x, y, width, and height arguments.
 * The oval covers an area that is width + 1 pixels wide and height + 1
 * pixels tall.
 * 
 * @param x the x coordinate of the upper left corner of the oval to be
 *            drawn.
 * @param y the y coordinate of the upper left corner of the oval to be
 *            drawn.
 * @param width the width of the oval to be drawn.
 * @param height the height of the oval to be drawn.
 */
public void drawOval(final double x, final double y, final double width, final double height) {
  TEMP_RECT.setRect(x, y, width, height);
  SWTShapeManager.transform(TEMP_RECT, transform);
  gc.setLineWidth(getTransformedLineWidth());
  gc.drawOval((int) (TEMP_RECT.getX() + 0.5), (int) (TEMP_RECT.getY() + 0.5), (int) (TEMP_RECT.getWidth() + 0.5),
      (int) (TEMP_RECT.getHeight() + 0.5));
}

代码示例来源:origin: org.eclipse.egit/ui

protected void drawDot(final Color outline, final Color fill, final int x,
    final int y, final int w, final int h) {
  int dotX = cellX + x + 2;
  int dotY = cellY + y + 1;
  int dotW = w - 2;
  int dotH = h - 2;
  g.setBackground(fill);
  g.fillOval(dotX, dotY, dotW, dotH);
  g.setForeground(outline);
  g.setLineWidth(2);
  g.drawOval(dotX, dotY, dotW, dotH);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

@Override
public void draw(FigureDrawContext fdc) {
  Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
  fdc.gc.setForeground(foregroundColor);
  fdc.gc.setBackground(backgroundColor);
  fdc.gc.setLineStyle(lineStyle);
  fdc.gc.drawOval(r.x, r.y, r.width - 1, r.height - 1);
  fdc.gc.setLineStyle(SWT.LINE_SOLID);
}
@Override

代码示例来源:origin: BiglySoftware/BiglyBT

public static void drawPie(GC gc,int x, int y,int width,int height,int percent) {
  Color background = gc.getBackground();
  gc.setForeground(Colors.blue);
  int angle = (percent * 360) / 100;
  if(angle<4)
    angle = 0; // workaround fillArc rendering bug
  gc.setBackground(Colors.white);
  gc.fillArc(x,y,width,height,0,360);
  gc.setBackground(background);
  gc.fillArc(x,y,width,height,90,angle*-1);
  gc.drawOval(x , y , width-1, height-1);
}

代码示例来源:origin: stackoverflow.com

gc.drawOval(centerX-radius/2, centerY-radius - radius/2, maxX, maxY);
gc.drawOval(centerX - 2*radius + radius/2, centerY - radius/2, maxX, maxY);
gc.drawOval(centerX+radius/2, centerY-radius/2, maxX, maxY);
gc.drawOval(centerX-radius/2, centerY + radius/2, maxX, maxY);
direction++;
direction %= 4;

代码示例来源:origin: org.xworker/xworker_swt

@ActionParams(names="canvas,gc,shape")
  public static void draw(Canvas canvas, GC gc, SimpleShape shape, ActionContext actionContext) {
    if(shape.getThing().getBoolean("fill")) {
      gc.fillOval(0, 0, shape.getWidth(), shape.getHeight());
    }else {
      gc.drawOval(0, 0, shape.getWidth(), shape.getHeight());
    }
  }
}

代码示例来源:origin: rinde/RinSim

if (useEncirclement) {
 gc.setForeground(gc.getBackground());
 gc.drawOval((int) (vp.origin.x + (p.x - vp.rect.min.x) * vp.scale)
  - outerRadius,
  (int) (vp.origin.y + (p.y - vp.rect.min.y)

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

gc.drawOval(x + xcoord, y + ycoord, 15, 15);
gc.drawOval(x + xcoord2, y + ycoord2, 15, 15);
gc.drawOval(x + xcoord3, y + ycoord3, 15, 15);

代码示例来源:origin: com.github.rinde/rinsim-example

gc.drawOval(
 xpx - vp.scale(r), ypx - vp.scale(r),
 2 * vp.scale(r), 2 * vp.scale(r));

代码示例来源:origin: rinde/RinSim

gc.drawOval(
 xpx - vp.scale(r), ypx - vp.scale(r),
 2 * vp.scale(r), 2 * vp.scale(r));

代码示例来源:origin: rinde/RinSim

igc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE));
igc.fillOval(width / 2 - 2, length / 2 - 2, DOT_SIZE_PX, DOT_SIZE_PX);
igc.drawOval(width / 2 - 2, length / 2 - 2, DOT_SIZE_PX, DOT_SIZE_PX);

代码示例来源:origin: BiglySoftware/BiglyBT

e.gc.drawOval(clientArea.x + INDENT_OVAL, iconY, WIDTH_OVAL,
    HEIGHT_OVAL);
e.gc.drawPolyline(new int[] {

代码示例来源:origin: BiglySoftware/BiglyBT

gc.drawOval(x , y , width-1, height-1);

代码示例来源:origin: org.eclipse.mylyn.wikitext/ui

case 2: // round empty bullet
  gc.setForeground(color);
  gc.drawOval(hcenter - 3, vcenter - 3, 5, 5);
  break;
default: // square bullet

相关文章

GC类方法