本文整理了Java中org.eclipse.swt.widgets.Canvas.setBounds()
方法的一些代码示例,展示了Canvas.setBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.setBounds()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名: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: ch.unibas.cs.gravis/scalismo-native-stub
@Override
public void setBounds(final int x, final int y, final int width, final int height) {
super.setBounds(x, y, width, height);
if( DEBUG ) {
System.err.println("NewtCanvasSWT.setBounds: "+x+"/"+y+" "+width+"x"+height);
}
if( SWTAccessor.isOSX ) {
// Force newtChild to update its size and position (OSX only)
updatePosSizeCheck(x, y, width, height, true /* updatePos */);
}
}
代码示例来源:origin: org.eclipse.mylyn.commons/screenshots
bounds.height = (int) Math.round(imageBounds.height * scaleFactor);
canvas.setBounds(bounds);
} else {
bounds.height = (int) Math.round(imageBounds.height * scaleFactor);
canvas.setBounds(bounds);
代码示例来源:origin: org.eclipse/org.eclipse.compare
fScrollCanvas.setBounds(x, y, scrollbarWidth, height-scrollbarHeight);
fSummaryHeader.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, verticalScrollbarButtonHeight);
y+= verticalScrollbarButtonHeight;
fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(2*verticalScrollbarButtonHeight+horizontalScrollbarButtonHeight));
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
int diff = event.y - oldSash.y;
Rectangle bounds = imageCanvas.getBounds();
imageCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);
bounds = paletteCanvasBounds;
paletteCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);
bounds = dataLabelBounds;
dataLabel.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height);
代码示例来源:origin: org.eclipse.platform/org.eclipse.compare
fScrollCanvas.setBounds(x, y, scrollbarWidth, height-scrollbarHeight);
fSummaryHeader.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, verticalScrollbarButtonHeight);
y+= verticalScrollbarButtonHeight;
fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(2*verticalScrollbarButtonHeight+horizontalScrollbarButtonHeight));
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
border.setBounds(bb);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
case SWT.Resize:
Rectangle rect = getClientArea();
canvas.setBounds(rect.width - imgBounds.width - 1, 1, imgBounds.width, rect.height - 2);
break;
case SWT.Paint:
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
header.setBounds (0, 0, 0, fontHeight + 2 * getHeaderPadding ());
header.addListener (SWT.Paint, listener);
header.addListener (SWT.MouseDown, listener);
内容来源于网络,如有侵权,请联系作者删除!