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

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

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

GC.drawPath介绍

[英]Draws the path described by the parameter.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.
[中]绘制由参数描述的路径。
此操作需要操作系统的高级图形子系统,该子系统在某些平台上可能不可用。

代码示例

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

return;
gc.drawPath( (Path) object );
return;

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

@Override
public void drawPath ( final Path path )
{
  this.gc.drawPath ( path );
}

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

@Override
public void drawPath ( final Path path )
{
  this.gc.drawPath ( path );
}

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

/**
 * Draws the provided path.
 * 
 * @param p path to draw
 */
public void drawPath(final Path p) {
  gc.setTransform(swtTransform);
  gc.drawPath(p);
  gc.setTransform(null);
}

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

/**
 * Draws the outline of the specified shape using the current stroke and
 * paint settings.
 *
 * @param shape  the shape ({@code null} not permitted).
 *
 * @see #getPaint()
 * @see #getStroke()
 * @see #fill(Shape)
 */
@Override
public void draw(Shape shape) {
  Path path = toSwtPath(shape);
  this.gc.drawPath(path);
  path.dispose();
}

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

void drawCurve(Point p1, Point p2, Point control) {
 final Path path = new Path(gc.get().getDevice());
 path.moveTo(vp.get().toCoordX(p1.x), vp.get().toCoordY(p1.y));
 path.quadTo(
  vp.get().toCoordX(control.x), vp.get().toCoordY(control.y),
  vp.get().toCoordX(p2.x), vp.get().toCoordY(p2.y));
 gc.get().drawPath(path);
 path.dispose();
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void dispatchDrawPath( JsonArray parameters ) {
 if( !parameters.isEmpty() ) {
  Path path = new Path( gc.getDevice() );
  createWayPoints( parameters, path );
  gc.drawPath( path );
 }
}

代码示例来源:origin: stackoverflow.com

gc.drawPath(path);

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

gc.setBackground(ballCollection.colors[0]);
gc.fillPath(path);
gc.drawPath(path);
path.dispose();

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

if (closeButton.getSelection()) path.close();
if (fillButton.getSelection()) gc.fillPath(path);
if (drawButton.getSelection()) gc.drawPath(path);
path.dispose();
if (closeButton.getSelection()) path.close();
if (fillButton.getSelection()) gc.fillPath(path);
if (drawButton.getSelection()) gc.drawPath(path);
path.dispose();
gc.setTransform(null);
if (closeButton.getSelection()) path.close();
if (fillButton.getSelection()) gc.fillPath(path);
if (drawButton.getSelection()) gc.drawPath(path);
path.dispose();

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

@Override
public void paint(GC gc, int width, int height) {
  if (!example.checkAdvancedGraphics()) return;
  Device device = gc.getDevice();

  Font font = new Font(device, getPlatformFontFace(fontFace), fontSize, fontStyle);
  gc.setFont(font);

  Point size = gc.stringExtent(text);
  textWidth = size.x;
  textHeight = size.y;

  Path path = new Path(device);
  path.addString(text, x, y, font);

  gc.setForeground(device.getSystemColor(foreGrdColor));
  gc.setBackground(device.getSystemColor(fillColor));

  gc.fillPath(path);
  gc.drawPath(path);
  font.dispose();
  path.dispose();
}

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

gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
gc.fillPath(path);
gc.drawPath(path);
tr.dispose();
path.dispose();

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

(height-diameter+50)/2, diameter-50, diameter-50,
    0, 360);
gc.drawPath(path);
gc.setBackground(device.getSystemColor(SWT.COLOR_RED));
gc.fillPath(path);

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

@Override
public void paint(GC gc, int width, int height) {
  if (!example.checkAdvancedGraphics()) return;
  Device device = gc.getDevice();
  if (image == null) {
    image = example.loadImage(device, "irmaos.jpg");
    Rectangle rect = image.getBounds();
    FontData fd = device.getSystemFont().getFontData()[0];
    font = new Font(device, fd.getName(), rect.height / 4, SWT.BOLD);
    gc.setFont(font);
    Point size = gc.stringExtent(text);
    textWidth = size.x;
    textHeight = size.y;
  }
  Path path = new Path(device);
  path.addString(text, x, y, font);
  gc.setClipping(path);
  Rectangle rect = image.getBounds();
  gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, width, height);
  gc.setClipping((Rectangle)null);
  gc.setForeground(device.getSystemColor(SWT.COLOR_BLUE));
  gc.drawPath(path);
  path.dispose();
}
}

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

gc.setBackgroundPattern(pattern);
gc.fillPath(path);
gc.drawPath(path);
path.dispose();
gc.setBackgroundPattern(pattern);
gc.fillPath(path);
gc.drawPath(path);
path.dispose();
gc.setBackgroundPattern(pattern);
gc.fillPath(path);
gc.drawPath(path);
path.dispose();
gc.setBackgroundPattern(pattern);
gc.fillPath(path);
gc.drawPath(path);
pattern.dispose();
path.dispose();

代码示例来源:origin: org.xworker/xworker_swt

@ActionParams(names="canvas,gc,shape")
public static void draw(Canvas canvas, GC gc, SimpleShape shape, ActionContext actionContext) {
  Thing thing = shape.getThing();
  Path path = (Path) shape.getData(PATH);        
  if(path != null && !path.isDisposed()) {
    float bounds[] = new float[4];
    path.getBounds(bounds);
    //System.out.println(bounds[0] + "," + bounds[1] + "," + bounds[2] + "," + bounds[3]);
    Transform oldTransform = new Transform(gc.getDevice());
    gc.getTransform(oldTransform);
    Transform transform = new Transform(gc.getDevice());
    transform.translate(shape.getX(), shape.getY());
    transform.scale(shape.getWidth() / (bounds[0] + bounds[2]), shape.getHeight() / (bounds[1] + bounds[3]));
    
    //transform.multiply(oldTransform);
    gc.setTransform(transform);
    if(thing.getBoolean("fill")) {
      gc.fillPath(path);
    }else {
      gc.drawPath(path);
    }
    
    gc.setTransform(oldTransform);
    transform.dispose();
    oldTransform.dispose();
  }
}

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

gc.drawPath(path);
path.dispose();
path.quadTo(100 + wDiffX1, 300 + wDiffY1, 100, 0);
path.quadTo(100+wDiffX2, 300+wDiffY2, 200, 0);
gc.drawPath(path);
path.dispose();
gc.drawPath(path);
path.dispose();
gc.drawPath(path);
path.dispose();

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

gc.drawPath(path);
path.dispose();
gc.drawPath(path);
path.dispose();

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

path.lineTo(width/2, 25);
path.close();
gc.drawPath(path);
path.dispose();

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

gc.drawPath( path_done );

相关文章

GC类方法