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

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

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

GC.drawRoundRectangle介绍

[英]Draws the outline of the round-cornered rectangle specified by the arguments, using the receiver's foreground color. The left and right edges of the rectangle are at x and x + width. The top and bottom edges are at y and y + height. The roundness of the corners is specified by the arcWidth and arcHeight arguments, which are respectively the width and height of the ellipse used to draw the corners.
[中]使用接收器的前景色绘制参数指定的圆角矩形的轮廓。矩形的左边缘和右边缘分别位于xx + width。顶部和底部边缘分别位于yy + height。角点的圆度arcWidtharcHeight参数指定,这两个参数分别是用于绘制角点的椭圆的宽度和高度。

代码示例

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

public void drawRoundRectangle( int x, int y, int width, int height, int circleWidth, int circleHeight ) {
 gc.drawRoundRectangle( x, y, width, height, circleWidth, circleHeight );
}

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

public void drawRoundRectangle( int x, int y, int width, int height, int circleWidth, int circleHeight ) {
 gc.drawRoundRectangle( x, y, width, height, circleWidth, circleHeight );
}

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

protected void drawRect( GC gc, Rectangle rect ) {
 if ( rect == null ) {
  return;
 }
 gc.setLineStyle( SWT.LINE_DASHDOT );
 gc.setLineWidth( 1 );
 gc.setForeground( GUIResource.getInstance().getColorDarkGray() );
 // PDI-2619: SWT on Windows doesn't cater for negative rect.width/height so handle here.
 Point s = new Point( rect.x + offset.x, rect.y + offset.y );
 if ( rect.width < 0 ) {
  s.x = s.x + rect.width;
 }
 if ( rect.height < 0 ) {
  s.y = s.y + rect.height;
 }
 gc.drawRoundRectangle( s.x, s.y, Math.abs( rect.width ), Math.abs( rect.height ), 3, 3 );
 gc.setLineStyle( SWT.LINE_SOLID );
}

代码示例来源:origin: org.eclipse.neoscada.chart/org.eclipse.scada.chart.swt

@Override
public void drawRoundRectangle ( final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight )
{
  this.gc.drawRoundRectangle ( x, y, width, height, arcWidth, arcHeight );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.chart/org.eclipse.scada.chart.swt

@Override
public void drawRoundRectangle ( final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight )
{
  this.gc.drawRoundRectangle ( x, y, width, height, arcWidth, arcHeight );
}

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

public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) 
{
  gc.drawRoundRectangle(x + transX, y + transY, width, height, arcWidth, arcHeight);
}

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

/**
 * Draws a rectangle with rounded corners that fits within the specified
 * framing rectangle.
 *
 * @param x  the x-coordinate.
 * @param y  the y-coordinate.
 * @param width  the frame width.
 * @param height  the frame height.
 * @param arcWidth  the width of the arc defining the roundedness of the
 *         rectangle's corners.
 * @param arcHeight the height of the arc defining the roundedness of the
 *         rectangle's corners.
 *
 * @see #fillRoundRect(int, int, int, int, int, int)
 */
@Override
public void drawRoundRect(int x, int y, int width, int height,
    int arcWidth, int arcHeight) {
  this.gc.drawRoundRectangle(x, y, width - 1, height - 1, arcWidth,
      arcHeight);
}

代码示例来源:origin: Nodeclipse/EditBox

void drawRectangle(GC gc, int x, int y, int width, int height) {
  if (settings.getRoundBox())
    gc.drawRoundRectangle(x, y, width, height, ROUND_BOX_ARC, ROUND_BOX_ARC);
  else
    gc.drawRectangle(x, y, width, height);
}

代码示例来源:origin: rherrmann/eclipse-extras

private void drawBorder() {
 if( ( style & SWT.BORDER ) != 0 ) {
  int x = clientArea.x;
  int y = clientArea.y;
  int width = clientArea.width - 1;
  int height = clientArea.height - 1 - 1;
  gc.setAlpha( 255 );
  gc.setForeground( getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ) );
  gc.drawRoundRectangle( x, y, width, height, ARC_SIZE, ARC_SIZE );
 }
}

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

/**
 * Draws an outlined round-cornered rectangle using this graphics context's
 * current color. The left and right edges of the rectangle are at x and x +
 * width, respectively. The top and bottom edges of the rectangle are at y
 * and y + height.
 * 
 * @param x the x coordinate of the rectangle to be drawn.
 * @param y the y coordinate of the rectangle to be drawn.
 * @param width the width of the rectangle to be drawn.
 * @param height the height of the rectangle to be drawn.
 * @param arcWidth the horizontal diameter of the arc at the four corners.
 * @param arcHeight the vertical diameter of the arc at the four corners.
 */
public void drawRoundRect(final double x, final double y, final double width, final double height,
    final double arcWidth, final double arcHeight) {
  TEMP_RECT.setRect(x, y, width, height);
  SWTShapeManager.transform(TEMP_RECT, transform);
  final double tx = TEMP_RECT.getX();
  final double ty = TEMP_RECT.getY();
  final double twidth = TEMP_RECT.getWidth();
  final double theight = TEMP_RECT.getHeight();
  TEMP_RECT.setRect(0, 0, arcWidth, arcHeight);
  SWTShapeManager.transform(TEMP_RECT, transform);
  final double tarcWidth = TEMP_RECT.getWidth();
  final double tarcHeight = TEMP_RECT.getHeight();
  gc.setLineWidth(getTransformedLineWidth());
  gc.drawRoundRectangle((int) (tx + 0.5), (int) (ty + 0.5), (int) (twidth + 0.5), (int) (theight + 0.5),
      (int) (tarcWidth + 0.5), (int) (tarcHeight + 0.5));
}

代码示例来源: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.drawRoundRectangle(r.x, r.y, r.width - 1, r.height - 1, diameter, diameter);
  fdc.gc.setLineStyle(SWT.LINE_SOLID);
}
@Override

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

gcBack.setAlpha( 255 );
gcBack.drawRoundRectangle( 6, 6, 15, 15, 3, 3 );
gcBack.fillRoundRectangle( 6, 6, 15, 15, 3, 3 );

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

e.gc.fillRoundRectangle(0, 0, bounds.width - 1, bounds.height - 1,
        colorFillParams[0], colorFillParams[1]);
    e.gc.drawRoundRectangle(0, 0, bounds.width - 1, bounds.height - 1,
        colorFillParams[0], colorFillParams[1]);
 } else if (colorFillType == BORDER_ROUNDED) {
   Color oldFG = e.gc.getForeground();
   e.gc.setForeground(bgColor);
   e.gc.drawRoundRectangle(0, 0, bounds.width - 1, bounds.height - 1, colorFillParams[0],
       colorFillParams[1]);
   e.gc.setForeground(oldFG);
  e.gc.drawRectangle(bounds);
} else {
  e.gc.drawRoundRectangle(bounds.x, bounds.y, bounds.width,
      bounds.height, colorBorderParams[0], colorBorderParams[1]);

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

e.gc.setAlpha(0x80);
  e.gc.drawRoundRectangle(-curve, lineWidth - 1, width + curve, size.y - lineWidth, curve, curve);
  e.gc.drawLine(lineWidth - 1, lineWidth, lineWidth - 1, size.y - lineWidth);
} else {

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

gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, 6, 6);
gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
gc.drawRoundRectangle(1, 1, size.x - 3, size.y - 3, 6, 6);

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

arc);
e.gc.setAlpha(100);
e.gc.drawRoundRectangle(0, 0, bounds.width - 1, bounds.height - 1, arc,
    arc);

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

gc.drawRoundRectangle( 40, 40, width - 80, height - 80, 25, 25 );

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
if (!parent.getMinimized()) {
  gc.fillRectangle(x, y, 9, 3);
gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
if (!parent.getMinimized()) {
  gc.fillRectangle(x+1, y+1, 9, 3);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
if (!parent.getMinimized()) {
  gc.fillRectangle(x, y, 9, 3);
gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
if (!parent.getMinimized()) {
  gc.fillRectangle(x+1, y+1, 9, 3);

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

event.gc.setForegroundPattern(pattern);
event.gc.drawRoundRectangle(0, 0, area.width - 1, area.height - 1,
    20, 20);

相关文章

GC类方法