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

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

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

GC.drawPolyline介绍

[英]Draws the polyline which is defined by the specified array of integer coordinates, using the receiver's foreground color. The array contains alternating x and y values which are considered to represent points which are the corners of the polyline. Lines are drawn between each consecutive pair, but not between the first pair and last pair in the array.
[中]使用接收器的前景色绘制由指定的整数坐标数组定义的多段线。阵列包含交替的x和y值,这些值被视为表示多段线角点的点。将在每个连续对之间绘制线,但不会在数组中的第一对和最后一对之间绘制线。

代码示例

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

public void drawPolyline( int[] polyline ) {
 gc.drawPolyline( polyline );
}

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

public void drawPolyline( int[] polyline ) {
 gc.drawPolyline( polyline );
}

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

/**
 * Draw a polyline from the specified double array of points.
 *
 * @param pts double array of points
 */
public void drawPolyline(final double[] pts) {
  final int[] intPts = SWTShapeManager.transform(pts, transform);
  gc.drawPolyline(intPts);
}

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

/** {@inheritDoc} */
public void drawPolyline(final int[] xPoints, final int[] yPoints, final int nPoints) {
  final int[] ptArray = new int[2 * nPoints];
  for (int i = 0; i < nPoints; i++) {
    TEMP_POINT.setLocation(xPoints[i], yPoints[i]);
    transform.transform(TEMP_POINT, TEMP_POINT);
    ptArray[2 * i] = xPoints[i];
    ptArray[2 * i + 1] = yPoints[i];
  }
  gc.setLineWidth(getTransformedLineWidth());
  gc.drawPolyline(ptArray);
}

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

void drawPolylineInPixels(int[] pointArray) {
  checkGC(DRAW);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, false);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_lines(data.drawable, handle, pointArray, pointArray.length / 2);
}

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

void drawPolylineInPixels(int[] pointArray) {
  checkGC(DRAW);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, false);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_lines(data.drawable, handle, pointArray, pointArray.length / 2);
}

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

void drawPolygonInPixels(int[] pointArray) {
  checkGC(DRAW);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 0, pointArray, pointArray.length / 2);
}

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

void drawPolygonInPixels(int[] pointArray) {
  checkGC(DRAW);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 0, pointArray, pointArray.length / 2);
}

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

void fillPolygonInPixels(int[] pointArray) {
  checkGC(FILL);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_fill(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 1, pointArray, pointArray.length / 2);
}

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

void drawPolygonInPixels(int[] pointArray) {
  checkGC(DRAW);
  long /*int*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 0, pointArray, pointArray.length / 2);
}

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

void drawPolylineInPixels(int[] pointArray) {
  checkGC(DRAW);
  long /*int*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, false);
    Cairo.cairo_stroke(cairo);
    return;
  }
  OS.gdk_draw_lines(data.drawable, handle, pointArray, pointArray.length / 2);
}

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

/**
 * Draws the message area composite with rounded corners.
 */
private void onPaint(PaintEvent e) {
  Rectangle carea = getClientArea();
  e.gc.setForeground(getForeground());
  // draws the polyline to be rounded in a 2 pixel squared area
  e.gc.drawPolyline(new int[] { carea.x, carea.y + carea.height - 1,
      carea.x, carea.y + 2, carea.x + 2, carea.y,
      carea.x + carea.width - 3, carea.y, carea.x + carea.width - 1,
      carea.y + 2, carea.x + carea.width - 1,
      carea.y + carea.height - 1 });
}

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

void drawBorder(GC gc, int[] shape) {
  gc.setForeground(parent.getDisplay().getSystemColor(BORDER1_COLOR));
  gc.drawPolyline(shape);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void drawBorder(GC gc, int[] shape) {
  gc.setForeground(parent.getDisplay().getSystemColor(BORDER1_COLOR));
  gc.drawPolyline(shape);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void drawBorder(GC gc, int[] shape) {

  gc.setForeground(parent.getDisplay().getSystemColor(BORDER1_COLOR));
  gc.drawPolyline(shape);
}

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

void fillPolygonInPixels(int[] pointArray) {
  checkGC(FILL);
  int /*long*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_fill(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 1, pointArray, pointArray.length / 2);
}

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

void fillPolygonInPixels(int[] pointArray) {
  checkGC(FILL);
  long /*int*/ cairo = data.cairo;
  if (cairo != 0) {
    drawPolyline(cairo, pointArray, true);
    Cairo.cairo_fill(cairo);
    return;
  }
  OS.gdk_draw_polygon(data.drawable, handle, 1, pointArray, pointArray.length / 2);
}

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

void drawBorder(GC gc, int[] shape) {
  gc.setForeground(parent.getDisplay().getSystemColor(BORDER1_COLOR));
  gc.drawPolyline(shape);
}

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

/**
 * Draws the message area composite with rounded corners.
 */
private void onPaint(PaintEvent e) {
  Rectangle carea = getClientArea();
  e.gc.setForeground(getForeground());
  // draws the polyline to be rounded in a 2 pixel squared area
  e.gc.drawPolyline(new int[] { carea.x, carea.y + carea.height - 1,
      carea.x, carea.y + 2, carea.x + 2, carea.y,
      carea.x + carea.width - 3, carea.y, carea.x + carea.width - 1,
      carea.y + 2, carea.x + carea.width - 1,
      carea.y + carea.height - 1 });
}

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

void drawBorder(GC gc, int[] shape) {
  gc.setForeground(parent.getDisplay().getSystemColor(BORDER1_COLOR));
  gc.drawPolyline(shape);
}

相关文章

GC类方法