org.eclipse.swt.widgets.Canvas.getBounds()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(108)

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

Canvas.getBounds介绍

暂无

代码示例

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

public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( fixedFont );
  Rectangle max = wFFont.getBounds();
  String name = fixedFontData.getName() + " - " + fixedFontData.getHeight();
  Point size = pe.gc.textExtent( name );
  pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true );
 }
} );

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

public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( graphFont );
  Rectangle max = wGFont.getBounds();
  String name = graphFontData.getName() + " - " + graphFontData.getHeight();
  Point size = pe.gc.textExtent( name );
  pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true );
 }
} );

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

public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( noteFont );
  Rectangle max = wNFont.getBounds();
  String name = noteFontData.getName() + " - " + noteFontData.getHeight();
  Point size = pe.gc.textExtent( name );
  pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true );
 }
} );

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

Rectangle bounds = canvas.getBounds();
if ( bounds.width <= 0 || bounds.height <= 0 ) {
 return;

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

private void updateCanvas() {
 Rectangle bounds = canvas.getBounds();
 if ( bounds.width <= 0 || bounds.height <= 0 ) {
  return;

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

private void updateCanvas() {
 Rectangle bounds = canvas.getBounds();
 if ( bounds.width <= 0 || bounds.height <= 0 ) {
  return;

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

Rectangle bounds = canvas.getBounds();
if ( bounds.width <= 0 || bounds.height <= 0 ) {
 return;

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

public void paintControl( final PaintEvent event ) {
  if ( transGraph.trans != null && transGraph.trans.isFinished() ) {
   refreshImage( event.gc );
   if ( image != null && !image.isDisposed() ) {
    event.gc.drawImage( image, 0, 0 );
   }
  } else {
   Rectangle bounds = canvas.getBounds();
   if ( bounds.width <= 0 || bounds.height <= 0 ) {
    return;
   }
   event.gc.setForeground( GUIResource.getInstance().getColorWhite() );
   event.gc.setBackground( GUIResource.getInstance().getColorWhite() );
   event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) );
   event.gc.setForeground( GUIResource.getInstance().getColorBlack() );
   String metricsMessage =
    BaseMessages.getString( PKG, "TransMetricsDelegate.TransformationIsNotRunning.Message" );
   org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage );
   event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 );
  }
 }
} );

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

public void paintControl( PaintEvent event ) {
  if ( jobGraph.job != null && ( jobGraph.job.isFinished() || jobGraph.job.isStopped() ) ) {
   refreshImage( event.gc );
   if ( image != null && !image.isDisposed() ) {
    event.gc.drawImage( image, 0, 0 );
   }
  } else {
   Rectangle bounds = canvas.getBounds();
   if ( bounds.width <= 0 || bounds.height <= 0 ) {
    return;
   }
   event.gc.setForeground( GUIResource.getInstance().getColorWhite() );
   event.gc.setBackground( GUIResource.getInstance().getColorWhite() );
   event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) );
   event.gc.setForeground( GUIResource.getInstance().getColorBlack() );
   String metricsMessage = BaseMessages.getString( PKG, "JobMetricsDelegate.JobIsNotRunning.Message" );
   org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage );
   event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 );
  }
 }
} );

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

/**
   * @return The bounds of the border's control.
   */
  public Rectangle getBounds() {
    return border.getBounds();
  }
}

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

@Override
public void getLocation(AccessibleControlEvent e) {
  Rectangle rect = parent.header.getBounds();
  rect.x = getX();
  Point pt = parent.toDisplay(rect.x, rect.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = width;
  e.height = rect.height;
}
@Override

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

protected void computeInformation() {
  if (fSelection != null) {
    Rectangle subjectArea= fSelection.canvas.getBounds();
    Annotation annotation= fSelection.fAnnotation;
    String msg;
    if (annotation != null)
      msg= annotation.getText();
    else
      msg= null;
    setInformation(msg, subjectArea);
  }
}

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

@Override
protected void computeInformation() {
  if (fSelection != null) {
    Rectangle subjectArea= fSelection.canvas.getBounds();
    Annotation annotation= fSelection.fAnnotation;
    String msg;
    if (annotation != null)
      msg= annotation.getText();
    else
      msg= null;
    setInformation(msg, subjectArea);
  }
}

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

@Override
protected void computeInformation() {
  if (fSelection != null) {
    Rectangle subjectArea= fSelection.canvas.getBounds();
    Annotation annotation= fSelection.fAnnotation;
    String msg;
    if (annotation != null)
      msg= annotation.getText();
    else
      msg= null;
    setInformation(msg, subjectArea);
  }
}

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

@Override
public void paint(GC gc, int width, int height) {
  Device device = gc.getDevice();
  Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png");

  Rectangle bounds = image.getBounds();
  Rectangle canvasBounds = example.canvas.getBounds();
  gc.drawImage(image, 0, 0, bounds.width, bounds.height, 0, 0, canvasBounds.width, canvasBounds.height);

  image.dispose();
}
}

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

GC gc = ev.gc;
Rectangle bounds = cell.getBounds();

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

Rectangle headerBounds= fHeader.getBounds();
boolean isOnTop= headerBounds.y + headerBounds.height <= fCanvas.getLocation().y;
boolean isTall= s.y > s.x + 2*ANNOTATION_HEIGHT;

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

Rectangle bb = border.getBounds();
Rectangle cr = clientControl.getClientArea();
Geometry.moveInside(bb,cr);

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

gc.setAntialias(SWT.ON);
Rectangle bounds = share_area.getBounds();

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

public void refresh(List<VivaldiPosition> vivaldiPositions) {
 if(canvas.isDisposed()) return;
 Rectangle size = canvas.getBounds();

相关文章

微信公众号

最新文章

更多

Canvas类方法