本文整理了Java中org.eclipse.swt.widgets.Canvas.getParent()
方法的一些代码示例,展示了Canvas.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.getParent()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:getParent
暂无
代码示例来源: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: BiglySoftware/BiglyBT
@Override
public void runSupport() {
if (cHeaderArea != null && !cHeaderArea.isDisposed()) {
cHeaderArea.setVisible(visible);
FormData fd = Utils.getFilledFormData();
fd.height = visible ? headerHeight : 1;
fd.bottom = null;
cHeaderArea.setLayoutData(fd);
cHeaderArea.getParent().layout(true);
}
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public void renderInitialization( Canvas canvas ) throws IOException {
RemoteObject remoteObject = createRemoteObject( canvas, TYPE );
remoteObject.setHandler( new CanvasOperationHandler( canvas ) );
remoteObject.set( "parent", getId( canvas.getParent() ) );
remoteObject.set( "style", createJsonArray( getStyles( canvas, ALLOWED_STYLES ) ) );
RemoteObject remoteObjectForGC = createRemoteObject( getGcId( canvas ), TYPE_GC );
remoteObjectForGC.set( "parent", WidgetUtil.getId( canvas ) );
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
Widget widget = (event.widget instanceof Canvas)
? ((Canvas) event.widget).getParent() : event.widget;
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
int xOffset = 0;
if (numShowItems == 1) {//If there is a single item try to center it
Rectangle clientArea = canvas.getParent().getClientArea();
if (orientation == SWT.HORIZONTAL) {
int size1 = clientArea.height;
内容来源于网络,如有侵权,请联系作者删除!