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

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

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

GC.fillRoundRectangle介绍

[英]Fills the interior of the round-cornered rectangle specified by the arguments, using the receiver's background color.
[中]使用接收器的背景色填充参数指定的圆角矩形的内部。

代码示例

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

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

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

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

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

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

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

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

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

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

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

@Override
public void draw(FigureDrawContext fdc) {
  Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
  fdc.gc.setBackground(color);
  fdc.gc.fillRoundRectangle(r.x, r.y, r.width, r.height, diameter, diameter);
}
@Override

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

private void drawBar() {
 if( barColor != null ) {
  gc.setAlpha( 200 );
  gc.setBackground( barColor );
  gc.fillRoundRectangle( 1, 1, barWidth, clientArea.height - 2 - 1, ARC_SIZE, ARC_SIZE );
 }
}

代码示例来源: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 #drawRoundRect(int, int, int, int, int, int)
 */
@Override
public void fillRoundRect(int x, int y, int width, int height,
    int arcWidth, int arcHeight) {
  switchColors();
  this.gc.fillRoundRectangle(x, y, width - 1, height - 1, arcWidth,
      arcHeight);
  switchColors();
}

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

/**
 * Fills the specified rounded corner rectangle with the current color. The
 * left and right edges of the rectangle are at x and x + width - 1,
 * respectively. The top and bottom edges of the rectangle are at y and y +
 * height - 1.
 * 
 *@param x the x coordinate of the rectangle to be filled.
 *@param y the y coordinate of the rectangle to be filled.
 *@param width the width of the rectangle to be filled.
 *@param height the height of the rectangle to be filled.
 *@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 fillRoundRect(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.fillRoundRectangle((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.e4.ui.css.swt

@Override
public void doPaintControl(GC gc, Rectangle currClientArea, Scrollable scrollable) {
  if (fHandleDrawnRect != null) {
    StyledText styledText = (StyledText) scrollable;
    int lineWidth = getCurrentScrollBarWidth();
    int w = currClientArea.width;
    int h = currClientArea.height - (styledText.getTopMargin() + styledText.getBottomMargin());
    int borderRadius = Math.min(fScrollBarSettings.getScrollBarBorderRadius(), lineWidth);
    // Fill the background (same thing as the
    // getFullBackgroundRect).
    gc.fillRoundRectangle(w - lineWidth, styledText.getTopMargin(), lineWidth, h, borderRadius,
        borderRadius);
    // Fill the foreground.
    Color foreground = gc.getForeground();
    Color background = gc.getBackground();
    gc.setBackground(foreground);
    gc.fillRoundRectangle(fHandleDrawnRect.x, fHandleDrawnRect.y, fHandleDrawnRect.width,
        fHandleDrawnRect.height, borderRadius, borderRadius);
    gc.setBackground(background);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

@Override
public void doPaintControl(GC gc, Rectangle currClientArea, Scrollable scrollable) {
  if (fHandleDrawnRect != null) {
    StyledText styledText = (StyledText) scrollable;
    int lineWidth = getCurrentScrollBarWidth();
    int w = currClientArea.width - (styledText.getLeftMargin() + styledText.getRightMargin());
    int h = currClientArea.height;
    int borderRadius = Math.min(fScrollBarSettings.getScrollBarBorderRadius(), lineWidth);
    // Fill the background (same thing as the
    // getFullBackgroundRect).
    gc.fillRoundRectangle(styledText.getLeftMargin(), h - lineWidth, w, lineWidth, borderRadius,
        borderRadius);
    // Fill the foreground.
    Color foreground = gc.getForeground();
    Color background = gc.getBackground();
    gc.setBackground(foreground);
    gc.fillRoundRectangle(fHandleDrawnRect.x, fHandleDrawnRect.y, fHandleDrawnRect.width,
        fHandleDrawnRect.height, borderRadius, borderRadius);
    gc.setBackground(background);
  }
}

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

private void onPaint(PaintEvent e) {
  if (hoverState == STATE_NORMAL)
    return;
  GC gc = e.gc;
  Rectangle carea = getClientArea();
  gc.setBackground(getHoverBackground());
  int savedAntialias = gc.getAntialias();
  FormUtil.setAntialias(gc, SWT.ON);
  gc.fillRoundRectangle(carea.x + HMARGIN, carea.y + 2, carea.width
      - HMARGIN * 2, carea.height - 4, ARC_WIDTH, ARC_HEIGHT);
  FormUtil.setAntialias(gc, savedAntialias);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

private void onPaint(PaintEvent e) {
  if (hoverState == STATE_NORMAL)
    return;
  GC gc = e.gc;
  Rectangle carea = getClientArea();
  gc.setBackground(getHoverBackground());
  int savedAntialias = gc.getAntialias();
  FormUtil.setAntialias(gc, SWT.ON);
  gc.fillRoundRectangle(carea.x + HMARGIN, carea.y + 2, carea.width
      - HMARGIN * 2, carea.height - 4, ARC_WIDTH, ARC_HEIGHT);
  FormUtil.setAntialias(gc, savedAntialias);
}

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

gc.fillRoundRectangle(x - extent.x / 2, y - extent.y / 2,
 extent.x + 2, extent.y + 2, ROUND_RECT_ARC_HEIGHT,
 ROUND_RECT_ARC_HEIGHT);

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

gc.fillRoundRectangle(x - extent.x / 2, y - extent.y / 2,
 extent.x + 2, extent.y + 2, ROUND_RECT_ARC_HEIGHT,
 ROUND_RECT_ARC_HEIGHT);

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

void fillRectangle(Color c, GC gc, int x, int y, int width, int height) {
  if (c == null)
    return;
  
  gc.setBackground(c);
  if (settings.getRoundBox()){
    gc.fillRoundRectangle(x, y, width, height, ROUND_BOX_ARC, ROUND_BOX_ARC);
  }
  else {
    if (settings.getFillGradient() && settings.getFillGradientColor()!=null) {
      gc.setBackground(settings.getFillGradientColor());
      gc.setForeground(c);
      gc.fillGradientRectangle(x, y, width, height, false);
    }else {
      gc.fillRectangle(x, y, width, height);
    }
  }
}

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

e.gc.setAntialias(SWT.ON);
e.gc.fillRoundRectangle(0, 0, bounds.width - 1, bounds.height - 1, arc,
    arc);
e.gc.setAlpha(100);

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

if (colorFillParams != null) {
 if (colorFillType == BORDER_ROUNDED_FILL) {
    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,

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

event.gc.setBackgroundPattern(pattern);
event.gc.fillRoundRectangle(0, 0, area.width - 1, area.height - 1,
    20, 20);
event.gc.setAlpha(50);
event.gc.setBackground(event.gc.getForeground());
event.gc.fillRoundRectangle(ca.x + 10, ca.y + 5, ca.width - 21,
    ca.height - 11, 20, 20);

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

gc.setAntialias(SWT.ON);
gc.fillRoundRectangle(0, 0, size.x - 1, size.y - 1, 6, 6);
gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_DARK_SHADOW));
gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, 6, 6);

相关文章

微信公众号

最新文章

更多

GC类方法