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

x33g5p2x  于2022-01-23 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(118)

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

List.setBounds介绍

暂无

代码示例

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

void layout() {
 Composite parent = canvas.getParent();
 Rectangle rect = parent.getClientArea();
 int width = 0;
 String[] items = list.getItems();
 GC gc = new GC( list );
 for ( int i = 0; i < objects.length; i++ ) {
  width = Math.max( width, gc.stringExtent( items[i] ).x );
 }
 gc.dispose();
 Point size1 = start.computeSize( SWT.DEFAULT, SWT.DEFAULT );
 Point size2 = stop.computeSize( SWT.DEFAULT, SWT.DEFAULT );
 Point size3 = check.computeSize( SWT.DEFAULT, SWT.DEFAULT );
 Point size4 = label.computeSize( SWT.DEFAULT, SWT.DEFAULT );
 width = Math.max( size1.x, Math.max( size2.x, Math.max( size3.x, width ) ) );
 width = Math.max( 64, Math.max( size4.x, list.computeSize( width, SWT.DEFAULT ).x ) );
 start.setBounds( 0, 0, width, size1.y );
 stop.setBounds( 0, size1.y, width, size2.y );
 check.setBounds( 0, size1.y + size2.y, width, size3.y );
 label.setBounds( 0, rect.height - size4.y, width, size4.y );
 int height = size1.y + size2.y + size3.y;
 list.setBounds( 0, height, width, rect.height - height - size4.y );
 text.setBounds( width, 0, rect.width - width, rect.height );
 canvas.setBounds( width, 0, rect.width - width, rect.height );
}

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

/**
 * Layout the list and text widgets according to the new
 * positions of the sashes..events.SelectionEvent
 */
void layout () {
  Rectangle clientArea = sashComp.getClientArea ();
  Rectangle hSashBounds = hSash.getBounds ();
  Rectangle vSashBounds = vSash.getBounds ();
  list1.setBounds (0, 0, vSashBounds.x, hSashBounds.y);
  list2.setBounds (vSashBounds.x + vSashBounds.width, 0, clientArea.width - (vSashBounds.x + vSashBounds.width), hSashBounds.y);
  text.setBounds (0, hSashBounds.y + hSashBounds.height, clientArea.width, clientArea.height - (hSashBounds.y + hSashBounds.height));
  /**
  * If the horizontal sash has been moved then the vertical
  * sash is either too long or too short and its size must
  * be adjusted.
  */
  vSashBounds.height = hSashBounds.y;
  vSash.setBounds (vSashBounds);
}
/**

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

list1.setBounds (list1Bounds);
list2.setBounds (list1Bounds.width + SASH_WIDTH, 0, clientArea.width - (list1Bounds.width + SASH_WIDTH), list1Bounds.height);

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

int itemHeight = list.getItemHeight () * itemCount;
Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
Rectangle displayRect = getMonitor ().getClientArea ();
list.setBounds (1, 1, Math.max (comboSize.x - 2, Math.min(listSize.x, displayRect.width - 2)), listSize.y);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
Rectangle displayRect = getMonitor ().getClientArea ();
list.setBounds (1, 1, Math.max (comboSize.x - 2, Math.min(listSize.x, displayRect.width - 2)), listSize.y);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
Rectangle displayRect = getMonitor ().getClientArea ();
list.setBounds (1, 1, Math.max (comboSize.x - 2, Math.min(listSize.x, displayRect.width - 2)), listSize.y);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
Rectangle displayRect = getMonitor ().getClientArea ();
list.setBounds (1, 1, Math.max (comboSize.x - 2, Math.min(listSize.x, displayRect.width - 2)), listSize.y);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
Rectangle displayRect = getMonitor ().getClientArea ();
list.setBounds (1, 1, Math.max (comboSize.x - 2, Math.min(listSize.x, displayRect.width - 2)), listSize.y);

相关文章

微信公众号

最新文章

更多

List类方法