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

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

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

GC.setLineCap介绍

[英]Sets the receiver's line cap style to the argument, which must be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.
[中]将接收方的线帽样式设置为参数,该参数必须是常量SWT.CAP_FLATSWT.CAP_ROUNDSWT.CAP_SQUARE之一。

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

/**
 * Sets the receiver's line attributes.
 * <p>
 * This operation requires the operating system's advanced
 * graphics subsystem which may not be available on some
 * platforms.
 * </p>
 * @param attributes the line attributes
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the attributes is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if any of the line attributes is not valid</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
 * </ul>
 *
 * @see LineAttributes
 */
public void setLineAttributes( LineAttributes attributes ) {
 checkDisposed();
 if( attributes == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 setLineWidth( ( int )attributes.width );
 setLineCap( attributes.cap );
 setLineJoin( attributes.join );
 advanced = true;
}

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

_gc.setLineCap(SWT.CAP_SQUARE);
  _gc.setLineJoin(SWT.JOIN_MITER);
  _gc.setLineDash(null);
  break;
_gc.setLineCap(gcCap);

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

this.gc.setLineWidth((int) bs.getLineWidth());
this.gc.setLineJoin(toSwtLineJoin(bs.getLineJoin()));
this.gc.setLineCap(toSwtLineCap(bs.getEndCap()));

代码示例来源:origin: org.eclipse.mylyn.commons/screenshots

private void captureScreenshotContent(Image image) {
  final Display display = getShell().getDisplay();
  disposeImageResources();
  originalImage = image;
  Rectangle displayBounds = originalImage.getBounds();
  workImage = new Image(display, displayBounds.width, displayBounds.height);
  GC gc = new GC(workImage);
  gc.drawImage(originalImage, 0, 0);
  gc.dispose();
  workImageGC = new GC(workImage);
  workImageGC.setLineCap(SWT.CAP_ROUND);
  scrolledComposite.setEnabled(true);
  clearSelection();
  refreshCanvasSize();
  stateChanged();
}

代码示例来源:origin: stefanhaustein/flowgrid

gc.setLineCap(SWT.CAP_ROUND);

代码示例来源:origin: com.miglayout/miglayout-swt

@Override
public final void paintDebugOutline(boolean useVisaualPadding)
{
  if (c.isDisposed())
    return;
  GC gc = new GC(c);
  gc.setLineJoin(SWT.JOIN_MITER);
  gc.setLineCap(SWT.CAP_SQUARE);
  gc.setLineStyle(SWT.LINE_DOT);
  gc.setForeground(DB_COMP_OUTLINE);
  gc.drawRectangle(0, 0, getWidth() - 1, getHeight() - 1);
  gc.dispose();
}

代码示例来源:origin: stefanhaustein/flowgrid

public static void drawBoolean(GC gc, boolean value, int x, int y, int size) {
 Device device = gc.getDevice();
 gc.setBackground(device.getSystemColor(value ? SWT.COLOR_GREEN : SWT.COLOR_RED));
 gc.fillOval(x, y, size, size);
 gc.setForeground(device.getSystemColor(SWT.COLOR_WHITE));
 gc.setLineWidth(Math.max(1, size / 8));
 gc.setLineCap(value ? SWT.CAP_ROUND : SWT.CAP_FLAT);
 int d = size / 4;
 int cx = x + size / 2;
 int cy = y + size / 2;
 if (value) {
  gc.drawLine(cx - d, cy, cx-d/4, cy + d);
  gc.drawLine(cx-d/4, cy + d, cx + d, cy - d);
 } else {
  gc.drawLine(cx - d, cy - d, cx + d, cy + d);
  gc.drawLine(cx - d, cy + d, cx + d, cy - d);
 }
}

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

e.gc.setLineCap(SWT.CAP_FLAT);
  int YADJ = (clientArea.height
      - (WIDTH_CLEAR + WIDTH_PADDING + WIDTH_PADDING)) / 2;
  e.gc.setLineCap(SWT.CAP_ROUND);

代码示例来源:origin: org.eclipse.mylyn.commons/screenshots

public void run() {
    disposeImageResources();
    Rectangle displayBounds = display.getBounds();
    originalImage = new Image(display, displayBounds.width, displayBounds.height);
    workImage = new Image(display, displayBounds.width, displayBounds.height);
    GC gc = new GC(display);
    gc.copyArea(originalImage, displayBounds.x, displayBounds.y);
    gc.copyArea(workImage, displayBounds.x, displayBounds.y);
    gc.dispose();
    workImageGC = new GC(workImage);
    workImageGC.setLineCap(SWT.CAP_ROUND);
    scrolledComposite.setEnabled(true);
    clearSelection();
    refreshCanvasSize();
    wizardShell.setVisible(true);
    stateChanged();
  }
});

代码示例来源:origin: org.eclipse.mylyn.commons/screenshots

private void captureScreenshotContentFromSelection() {
  Display display = getShell().getDisplay();
  Image image = new Image(display, currentSelection);
  GC gc = new GC(image);
  gc.drawImage(workImage, currentSelection.x, currentSelection.y, currentSelection.width,
      currentSelection.height, 0, 0, currentSelection.width, currentSelection.height);
  gc.dispose();
  disposeImageResources();
  originalImage = image;
  Rectangle displayBounds = originalImage.getBounds();
  workImage = new Image(display, displayBounds.width, displayBounds.height);
  gc = new GC(workImage);
  gc.drawImage(originalImage, 0, 0);
  gc.dispose();
  workImageGC = new GC(workImage);
  workImageGC.setLineCap(SWT.CAP_ROUND);
  scrolledComposite.setEnabled(true);
  clearSelection();
  refreshCanvasSize();
  stateChanged();
}

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

gc.setLineCap(SWT.CAP_FLAT);
gc.drawLine(3*width/16, 2*height/6, 13*width/16, 2*height/6);
gc.setLineCap(SWT.CAP_SQUARE);
gc.drawLine(3*width/16, 3*height/6, 13*width/16, 3*height/6);
gc.setLineCap(SWT.CAP_ROUND);
gc.drawLine(3*width/16, 4*height/6, 13*width/16, 4*height/6);

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

gc.setLineCap(lineCap); // round line ends

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

gc.setLineCap(SWT.CAP_ROUND);	// round line ends

相关文章

GC类方法