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

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

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

GC.setLineDash介绍

[英]Sets the receiver's line dash style to the argument. The default value is null. If the argument is not null, the receiver's line style is set to SWT.LINE_CUSTOM, otherwise it is set to SWT.LINE_SOLID.
[中]将接收者的划线样式设置为参数。默认值为null。如果参数不是null,则接收器的线条样式设置为SWT.LINE_CUSTOM,否则设置为SWT.LINE_SOLID

代码示例

代码示例来源:origin: org.metawidget.modules/metawidget-all

public void paintControl( PaintEvent event ) {
    if ( event.count == 0 ) {
      buildWidgets();
    }
    // When used as part of an IDE builder tool, render as a dotted square so that we
    // can see something!
    if ( Beans.isDesignTime() ) {
      event.gc.setLineDash( new int[] { 5, 5 } );
      event.gc.drawRectangle( 0, 0, event.width - 1, event.height - 1 );
      Point textExtent = event.gc.textExtent( "Metawidget" );
      event.gc.drawText( "Metawidget", 10, ( event.height - textExtent.y ) / 2 );
    }
  }
} );

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

_gc.setLineCap(SWT.CAP_SQUARE);
  _gc.setLineJoin(SWT.JOIN_MITER);
  _gc.setLineDash(null);
  return;
  dashes[i] = (int) d[i];
_gc.setLineDash(dashes);

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

swtDashes[i] = (int) dashes[i];
this.gc.setLineDash(swtDashes);

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

if (linesVisible) {
  gc.setForeground (display.getSystemColor (SWT.COLOR_WIDGET_LIGHT_SHADOW));
  gc.setLineDash (lineDash);
  if (numColumns > 0 && startColumn != -1) {
      gc.setClipping (focusBounds);
      if (focusItem.isSelected ()) {
        gc.setLineDash (new int[] {2, 2});
      } else {
        gc.setLineDash (new int[] {1, 1});
    gc.setForeground (display.getSystemColor (SWT.COLOR_BLACK));
    gc.setClipping (1, y, width, height);
    gc.setLineDash (new int[] {1, 1});
    gc.drawFocus (1, y, width, height);

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

protected void drawBox(GC gc, StyledText textWidget, Color color, Rectangle bounds) {
    //clean bg:
    gc.setForeground(textWidget.getBackground());
    gc.setLineStyle(SWT.LINE_SOLID);
    int x= bounds.x;
    int y= bounds.y;
    int w= bounds.width - 1;
    int h= bounds.height - 1;
    gc.drawRectangle(x, y, w, h);
    
    gc.setForeground(color);
    gc.setLineDash(new int[] { 3 });
    
    // gc.drawRectangle(x, y, w, h) is platform-dependent and can look "animated"
    gc.drawLine(x, y, x + w, y);
    gc.drawLine(x, y + h, x + w, y + h);
    gc.drawLine(x, y, x, y + h);
    gc.drawLine(x + w, y, x + w, y + h);
    //RESET (same GC is passed around!):
    gc.setLineStyle(SWT.LINE_SOLID);
  }
}

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

gc.setAlpha(40);
gc.setForeground(origFG);
gc.setLineDash(new int[] { 1, 2 });
gc.drawRectangle(rowStartX, rowStartY,
    getViewPainted().getClientArea().width - 1, getHeight() - 1);

相关文章

GC类方法