java.awt.Graphics2D.drawPolyline()方法的使用及代码示例

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

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

Graphics2D.drawPolyline介绍

暂无

代码示例

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

public void drawPolyline( int[] polyline ) {
 int nPoints = polyline.length / 2;
 int[] xPoints = new int[polyline.length / 2];
 int[] yPoints = new int[polyline.length / 2];
 for ( int i = 0; i < nPoints; i++ ) {
  xPoints[i] = polyline[2 * i + 0] + xOffset;
  yPoints[i] = polyline[2 * i + 1] + yOffset;
 }
 gc.drawPolyline( xPoints, yPoints, nPoints );
}

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

public void drawPolyline( int[] polyline ) {
 int nPoints = polyline.length / 2;
 int[] xPoints = new int[polyline.length / 2];
 int[] yPoints = new int[polyline.length / 2];
 for ( int i = 0; i < nPoints; i++ ) {
  xPoints[i] = polyline[2 * i + 0] + xOffset;
  yPoints[i] = polyline[2 * i + 1] + yOffset;
 }
 gc.drawPolyline( xPoints, yPoints, nPoints );
}

代码示例来源:origin: jersey/jersey

ys[i] = imageHeight - 3 - (int) ((v - limits.lower()) / d);
g.drawPolyline(xs, ys, data.size());

代码示例来源:origin: chewiebug/GCViewer

/**
 * @see com.tagtraum.perf.gcviewer.view.ChartRenderer#paintComponent(java.awt.Graphics2D)
 */
public void paintComponent(Graphics2D g2d) {
  if ((!drawPolygon) && (!isDrawLine())) return;
  if (polygon == null) {
    // don't recompute polygon for each paint event
    polygon = computePolygon(getModelChart(), getModelChart().getModel());
  }
  clippedPolygon = initClippedPolygon(polygon, g2d.getClip());
  if (drawPolygon) {
    // don't antialias the polygon, if we are going to antialias the bounding lines
    Object oldAAHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
    if (isDrawLine()) {
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    }
    g2d.setPaint(createPaint(polygon));
    g2d.fillPolygon(clippedPolygon);
    if (isDrawLine()) {
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAAHint);
    }
  }
  if (isDrawLine()) {
    g2d.setPaint(getLinePaint());
    g2d.drawPolyline(clippedPolygon.xpoints, clippedPolygon.ypoints, clippedPolygon.npoints-1);
  }
}

代码示例来源:origin: apache/pdfbox

@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
{
  groupG2D.drawPolyline(xPoints, yPoints, nPoints);
  alphaG2D.drawPolyline(xPoints, yPoints, nPoints);
}

代码示例来源:origin: geotools/geotools

public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
  delegate.drawPolyline(xPoints, yPoints, nPoints);
}

代码示例来源:origin: i2p/i2p.i2p

void drawPolyline(int[] x, int[] y, Paint paint, Stroke stroke) {
  gd.setStroke(stroke);
  gd.setPaint(paint);
  gd.drawPolyline(x, y, x.length);
}

代码示例来源:origin: 0opslab/opslabJutil

g2d.drawPolyline(xPoints, yPoints, nPoints);

代码示例来源:origin: 0opslab/opslabJutil

g2d.drawPolyline(xPoints, yPoints, nPoints);

代码示例来源:origin: i2p/i2p.i2p

void drawPolyline(double[] x, double[] y, Paint paint, Stroke stroke) {
  gd.setPaint(paint);
  gd.setStroke(stroke);
  PathIterator path = new PathIterator(y);
  for (int[] pos = path.getNextPath(); pos != null; pos = path.getNextPath()) {
    int start = pos[0], end = pos[1];
    int[] xDev = new int[end - start], yDev = new int[end - start];
    for (int i = start; i < end; i++) {
      xDev[i - start] = (int) x[i];
      yDev[i - start] = (int) y[i];
    }
    gd.drawPolyline(xDev, yDev, xDev.length);
  }
}

代码示例来源:origin: geotools/geotools

graphics.drawPolyline(coordGridX, coordGridY, coords.length);
break;

代码示例来源:origin: com.samskivert/samskivert

@Override
public void drawPolyline (int[] x, int[] y, int n)
{
  _copy.drawPolyline(x, y, n);
  _primary.drawPolyline(x, y, n);
}

代码示例来源:origin: org.apache.pdfbox/pdfbox

@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
{
  groupG2D.drawPolyline(xPoints, yPoints, nPoints);
  alphaG2D.drawPolyline(xPoints, yPoints, nPoints);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-graphics

@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
  delegate.drawPolyline(xPoints, yPoints, nPoints);
}

代码示例来源:origin: org.rrd4j/rrd4j

void drawPolyline(int[] x, int[] y, Paint paint, Stroke stroke) {
  g2d.setStroke(stroke);
  g2d.setPaint(paint);
  g2d.drawPolyline(x, y, x.length);
}

代码示例来源:origin: org.jrobin/jrobin

void drawPolyline(int[] x, int[] y, Paint paint, Stroke stroke) {
  gd.setStroke(stroke);
  gd.setPaint(paint);
  gd.drawPolyline(x, y, x.length);
}

代码示例来源:origin: org.fusesource.rrd4j/rrd4j

void drawPolyline(int[] x, int[] y, Paint paint, Stroke stroke) {
  g2d.setStroke(stroke);
  g2d.setPaint(paint);
  g2d.drawPolyline(x, y, x.length);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void drawPolyline
 (Graphics _g, int[] _xpoints, int[] _ypoints, int _npoints,
  DjaGraphics.BresenhamParams _bp)
{
 Graphics2D g2d=(Graphics2D)_g;
 Stroke old=g2d.getStroke();
 g2d.setStroke(getStroke(_bp));
 g2d.drawPolyline(_xpoints,_ypoints,_npoints);
 g2d.setStroke(old);
}

代码示例来源:origin: org.scijava/j3dcore

@Override
public final void drawPolyline(int xPoints[], int yPoints[],
        int nPoints) {
// XXXX: call validate with bounding box of primitive
validate();
offScreenGraphics2D.drawPolyline(xPoints,  yPoints, nPoints);
}

代码示例来源:origin: freeplane/freeplane

@Override
  protected void draw(final Graphics2D g) {
    final Color color = getColor();
    g.setColor(color);
    final Stroke stroke = getStroke();
    g.setStroke(stroke);
    final int xMiddle = Math.max(start.x, end.x) + getSource().getMap().getZoomed(10);
    xs = new int[] { start.x, xMiddle, xMiddle, end.x };
    ys = new int[] { start.y, start.y, end.y, end.y };
    g.drawPolyline(xs, ys, 4);
}

相关文章

Graphics2D类方法