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

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

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

Canvas.getParent介绍

暂无

代码示例

代码示例来源: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: BiglySoftware/BiglyBT

  1. @Override
  2. public void runSupport() {
  3. if (cHeaderArea != null && !cHeaderArea.isDisposed()) {
  4. cHeaderArea.setVisible(visible);
  5. FormData fd = Utils.getFilledFormData();
  6. fd.height = visible ? headerHeight : 1;
  7. fd.bottom = null;
  8. cHeaderArea.setLayoutData(fd);
  9. cHeaderArea.getParent().layout(true);
  10. }
  11. }
  12. });

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

  1. @Override
  2. public void renderInitialization( Canvas canvas ) throws IOException {
  3. RemoteObject remoteObject = createRemoteObject( canvas, TYPE );
  4. remoteObject.setHandler( new CanvasOperationHandler( canvas ) );
  5. remoteObject.set( "parent", getId( canvas.getParent() ) );
  6. remoteObject.set( "style", createJsonArray( getStyles( canvas, ALLOWED_STYLES ) ) );
  7. RemoteObject remoteObjectForGC = createRemoteObject( getGcId( canvas ), TYPE_GC );
  8. remoteObjectForGC.set( "parent", WidgetUtil.getId( canvas ) );
  9. }

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

  1. @Override
  2. public void handleEvent(Event event) {
  3. Widget widget = (event.widget instanceof Canvas)
  4. ? ((Canvas) event.widget).getParent() : event.widget;

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

  1. int xOffset = 0;
  2. if (numShowItems == 1) {//If there is a single item try to center it
  3. Rectangle clientArea = canvas.getParent().getClientArea();
  4. if (orientation == SWT.HORIZONTAL) {
  5. int size1 = clientArea.height;

相关文章

Canvas类方法