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

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

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

Canvas.setBounds介绍

暂无

代码示例

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

  1. void layout() {
  2. Composite parent = canvas.getParent();
  3. Rectangle rect = parent.getClientArea();
  4. int width = 0;
  5. String[] items = list.getItems();
  6. GC gc = new GC( list );
  7. for ( int i = 0; i < objects.length; i++ ) {
  8. width = Math.max( width, gc.stringExtent( items[i] ).x );
  9. }
  10. gc.dispose();
  11. Point size1 = start.computeSize( SWT.DEFAULT, SWT.DEFAULT );
  12. Point size2 = stop.computeSize( SWT.DEFAULT, SWT.DEFAULT );
  13. Point size3 = check.computeSize( SWT.DEFAULT, SWT.DEFAULT );
  14. Point size4 = label.computeSize( SWT.DEFAULT, SWT.DEFAULT );
  15. width = Math.max( size1.x, Math.max( size2.x, Math.max( size3.x, width ) ) );
  16. width = Math.max( 64, Math.max( size4.x, list.computeSize( width, SWT.DEFAULT ).x ) );
  17. start.setBounds( 0, 0, width, size1.y );
  18. stop.setBounds( 0, size1.y, width, size2.y );
  19. check.setBounds( 0, size1.y + size2.y, width, size3.y );
  20. label.setBounds( 0, rect.height - size4.y, width, size4.y );
  21. int height = size1.y + size2.y + size3.y;
  22. list.setBounds( 0, height, width, rect.height - height - size4.y );
  23. text.setBounds( width, 0, rect.width - width, rect.height );
  24. canvas.setBounds( width, 0, rect.width - width, rect.height );
  25. }

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

  1. @Override
  2. public void setBounds(final int x, final int y, final int width, final int height) {
  3. super.setBounds(x, y, width, height);
  4. if( DEBUG ) {
  5. System.err.println("NewtCanvasSWT.setBounds: "+x+"/"+y+" "+width+"x"+height);
  6. }
  7. if( SWTAccessor.isOSX ) {
  8. // Force newtChild to update its size and position (OSX only)
  9. updatePosSizeCheck(x, y, width, height, true /* updatePos */);
  10. }
  11. }

代码示例来源:origin: org.eclipse.mylyn.commons/screenshots

  1. bounds.height = (int) Math.round(imageBounds.height * scaleFactor);
  2. canvas.setBounds(bounds);
  3. } else {
  4. bounds.height = (int) Math.round(imageBounds.height * scaleFactor);
  5. canvas.setBounds(bounds);

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

  1. fScrollCanvas.setBounds(x, y, scrollbarWidth, height-scrollbarHeight);
  2. fSummaryHeader.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, verticalScrollbarButtonHeight);
  3. y+= verticalScrollbarButtonHeight;
  4. fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(2*verticalScrollbarButtonHeight+horizontalScrollbarButtonHeight));

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

  1. int diff = event.y - oldSash.y;
  2. Rectangle bounds = imageCanvas.getBounds();
  3. imageCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);
  4. bounds = paletteCanvasBounds;
  5. paletteCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);
  6. bounds = dataLabelBounds;
  7. dataLabel.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height);

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

  1. fScrollCanvas.setBounds(x, y, scrollbarWidth, height-scrollbarHeight);
  2. fSummaryHeader.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, verticalScrollbarButtonHeight);
  3. y+= verticalScrollbarButtonHeight;
  4. fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(2*verticalScrollbarButtonHeight+horizontalScrollbarButtonHeight));

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

  1. border.setBounds(bb);

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

  1. case SWT.Resize:
  2. Rectangle rect = getClientArea();
  3. canvas.setBounds(rect.width - imgBounds.width - 1, 1, imgBounds.width, rect.height - 2);
  4. break;
  5. case SWT.Paint:

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

  1. header.setBounds (0, 0, 0, fontHeight + 2 * getHeaderPadding ());
  2. header.addListener (SWT.Paint, listener);
  3. header.addListener (SWT.MouseDown, listener);

相关文章

Canvas类方法