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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public void paintControl( final PaintEvent event ) {
  2. if ( transGraph.trans != null && transGraph.trans.isFinished() ) {
  3. refreshImage( event.gc );
  4. if ( image != null && !image.isDisposed() ) {
  5. event.gc.drawImage( image, 0, 0 );
  6. }
  7. } else {
  8. Rectangle bounds = canvas.getBounds();
  9. if ( bounds.width <= 0 || bounds.height <= 0 ) {
  10. return;
  11. }
  12. event.gc.setForeground( GUIResource.getInstance().getColorWhite() );
  13. event.gc.setBackground( GUIResource.getInstance().getColorWhite() );
  14. event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) );
  15. event.gc.setForeground( GUIResource.getInstance().getColorBlack() );
  16. String metricsMessage =
  17. BaseMessages.getString( PKG, "TransMetricsDelegate.TransformationIsNotRunning.Message" );
  18. org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage );
  19. event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 );
  20. }
  21. }
  22. } );

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

  1. public void paintControl( PaintEvent event ) {
  2. if ( jobGraph.job != null && ( jobGraph.job.isFinished() || jobGraph.job.isStopped() ) ) {
  3. refreshImage( event.gc );
  4. if ( image != null && !image.isDisposed() ) {
  5. event.gc.drawImage( image, 0, 0 );
  6. }
  7. } else {
  8. Rectangle bounds = canvas.getBounds();
  9. if ( bounds.width <= 0 || bounds.height <= 0 ) {
  10. return;
  11. }
  12. event.gc.setForeground( GUIResource.getInstance().getColorWhite() );
  13. event.gc.setBackground( GUIResource.getInstance().getColorWhite() );
  14. event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) );
  15. event.gc.setForeground( GUIResource.getInstance().getColorBlack() );
  16. String metricsMessage = BaseMessages.getString( PKG, "JobMetricsDelegate.JobIsNotRunning.Message" );
  17. org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage );
  18. event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 );
  19. }
  20. }
  21. } );

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

  1. /**
  2. * @return The bounds of the border's control.
  3. */
  4. public Rectangle getBounds() {
  5. return border.getBounds();
  6. }
  7. }

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

  1. @Override
  2. public void getLocation(AccessibleControlEvent e) {
  3. Rectangle rect = parent.header.getBounds();
  4. rect.x = getX();
  5. Point pt = parent.toDisplay(rect.x, rect.y);
  6. e.x = pt.x;
  7. e.y = pt.y;
  8. e.width = width;
  9. e.height = rect.height;
  10. }
  11. @Override

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

  1. protected void computeInformation() {
  2. if (fSelection != null) {
  3. Rectangle subjectArea= fSelection.canvas.getBounds();
  4. Annotation annotation= fSelection.fAnnotation;
  5. String msg;
  6. if (annotation != null)
  7. msg= annotation.getText();
  8. else
  9. msg= null;
  10. setInformation(msg, subjectArea);
  11. }
  12. }

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

  1. @Override
  2. protected void computeInformation() {
  3. if (fSelection != null) {
  4. Rectangle subjectArea= fSelection.canvas.getBounds();
  5. Annotation annotation= fSelection.fAnnotation;
  6. String msg;
  7. if (annotation != null)
  8. msg= annotation.getText();
  9. else
  10. msg= null;
  11. setInformation(msg, subjectArea);
  12. }
  13. }

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

  1. @Override
  2. protected void computeInformation() {
  3. if (fSelection != null) {
  4. Rectangle subjectArea= fSelection.canvas.getBounds();
  5. Annotation annotation= fSelection.fAnnotation;
  6. String msg;
  7. if (annotation != null)
  8. msg= annotation.getText();
  9. else
  10. msg= null;
  11. setInformation(msg, subjectArea);
  12. }
  13. }

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

  1. @Override
  2. public void paint(GC gc, int width, int height) {
  3. Device device = gc.getDevice();
  4. Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png");
  5. Rectangle bounds = image.getBounds();
  6. Rectangle canvasBounds = example.canvas.getBounds();
  7. gc.drawImage(image, 0, 0, bounds.width, bounds.height, 0, 0, canvasBounds.width, canvasBounds.height);
  8. image.dispose();
  9. }
  10. }

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

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

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

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

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

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

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

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

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

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

相关文章

Canvas类方法