本文整理了Java中org.eclipse.swt.widgets.Button.setBounds()
方法的一些代码示例,展示了Button.setBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setBounds()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名: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: pentaho/pentaho-kettle
/**
* Overridden to give the button the desired width.
*/
@Override
public void create() {
super.create();
final Button button = getButton( 0 );
final int newX = button.getBounds().x + button.getBounds().width - buttonWidth;
button.setBounds( newX, button.getBounds().y, buttonWidth, button.getBounds().height );
}
}
代码示例来源:origin: caoxinyu/RedisClient
btnNewButton.setBounds(0, 0, 75, 25);
btnNewButton.setText(RedisClient.i18nFile.getText(I18nFile.SUBSCRIBE));
代码示例来源:origin: caoxinyu/RedisClient
btnNewButton.setBounds(0, 0, 75, 25);
btnNewButton.setText(RedisClient.i18nFile.getText(I18nFile.PUBLISH));
btnNewButton.addSelectionListener(new SelectionAdapter() {
代码示例来源:origin: pentaho/pentaho-kettle
optForward.setBounds( 5, 15, 75, 15 );
Button optBackward = new Button( grpDir, SWT.RADIO );
optBackward.setBounds( 5, 33, 75, 15 );
optForward.setSelection( true );
optBackward.setText( BaseMessages.getString( PKG, "Widget.Styled.Comp.Backward" ) );
代码示例来源:origin: atdl4j/atdl4j
void resize() {
Point pt = computeSize(SWT.DEFAULT, SWT.DEFAULT);
int textWidth = pt.x - BUTTON_WIDTH;
int buttonHeight = pt.y / 2;
text.setBounds(0, 0, textWidth, pt.y);
up.setBounds(textWidth, -3, BUTTON_WIDTH, buttonHeight);
down.setBounds(textWidth, pt.y - buttonHeight - 3, BUTTON_WIDTH,
buttonHeight);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
public void layout(Composite editor, boolean force) {
Rectangle bounds = editor.getClientArea();
Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
if (contents != null) {
contents.setBounds(0, 0, bounds.width - size.x, bounds.height);
}
button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
public void layout(Composite editor, boolean force) {
Rectangle bounds = editor.getClientArea();
Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
if (contents != null) {
contents.setBounds(0, 0, bounds.width - size.x, bounds.height);
}
button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
public void layout(Composite editor, boolean force) {
Rectangle bounds = editor.getClientArea();
Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
if (contents != null) {
contents.setBounds(0, 0, bounds.width - size.x, bounds.height);
}
button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.pagedesigner
public void layout(Composite editor, boolean force) {
Rectangle bounds = editor.getClientArea();
Point size = _button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
// if (_wrapped != null)
_wrapped.getControl().setBounds(0, 0, bounds.width - size.x,
bounds.height);
_button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}
代码示例来源:origin: biz.aQute/aQute.bnd
wrap.setBounds(338, 105, 102, 28);
wrap.setText("Wrap");
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void internalLayout (boolean changed) {
if (isDropped ()) dropDown (false);
Rectangle rect = getClientArea ();
int width = rect.width;
int height = rect.height;
Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
text.setBounds (0, 0, width - arrowSize.x, height);
arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
}
void listEvent (Event event) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void internalLayout (boolean changed) {
if (isDropped ()) dropDown (false);
Rectangle rect = getClientArea ();
int width = rect.width;
int height = rect.height;
Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
text.setBounds (0, 0, width - arrowSize.x, height);
arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
}
void listEvent (Event event) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void internalLayout (boolean changed) {
if (isDropped ()) dropDown (false);
Rectangle rect = getClientArea ();
int width = rect.width;
int height = rect.height;
Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
text.setBounds (0, 0, width - arrowSize.x, height);
arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
}
void listEvent (Event event) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void internalLayout (boolean changed) {
if (isDropped ()) dropDown (false);
Rectangle rect = getClientArea ();
int width = rect.width;
int height = rect.height;
Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
text.setBounds (0, 0, width - arrowSize.x, height);
arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
}
void listEvent (Event event) {
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void internalLayout (boolean changed) {
if (isDropped ()) dropDown (false);
Rectangle rect = getClientArea ();
int width = rect.width;
int height = rect.height;
Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
text.setBounds (0, 0, width - arrowSize.x, height);
arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
}
void listEvent (Event event) {
代码示例来源:origin: org.eclipse/org.eclipse.compare
String tt= fCopyDiffRightToLeftItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);
fCenterButton.setVisible(true);
} else if (fRight.isEditable()) {
String tt= fCopyDiffLeftToRightItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);
fCenterButton.setVisible(true);
} else
代码示例来源:origin: stefanhaustein/flowgrid
topButtons[i].setBounds(
bounds.width - (buttonW + spacing) * (topButtons.length - i),
spacing,
代码示例来源:origin: org.eclipse.platform/org.eclipse.compare
fLeftToRightButton.setBounds(leftToRightBounds);
fLeftToRightButton.setVisible(true);
Rectangle rightToLeftBounds= new Rectangle(r.x, rightToLeftY, r.width, r.height);
fRightToLeftButton.setBounds(rightToLeftBounds);
fRightToLeftButton.setVisible(true);
} else if (leftEditable) {
fRightToLeftButton.setBounds(r);
fRightToLeftButton.setVisible(true);
fLeftToRightButton.setVisible(false);
} else if (rightEditable) {
fLeftToRightButton.setBounds(r);
fLeftToRightButton.setVisible(true);
fRightToLeftButton.setVisible(false);
代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls
@Override
protected void layout(Composite composite, boolean flushCache) {
Rectangle parentBounds = composite.getClientArea();
TableColumn[] columns = m_tableViewer.getTable().getColumns();
int[] colOrder = m_tableViewer.getTable().getColumnOrder();
int x = -m_tableViewer.getTable().getHorizontalBar().getSelection();
for (int i = 0; i < columns.length; i++) {
TableColumn column = columns[colOrder[i]];
if (i == NlsTable.AMOUNT_UTILITY_COLS) {
// layout button
m_resetButton.setBounds(1, 1, x - 2, parentBounds.height - 2);
}
if (i >= NlsTable.AMOUNT_UTILITY_COLS) {
Language lang = (Language) column.getData(NlsTable.LANGUAGE_COLUMN_ID);
Text text = m_filterFields.get(lang);
if (text != null) {
text.setBounds(x + 1, 1, column.getWidth() - 2, parentBounds.height - 2);
}
}
x += column.getWidth();
}
composite.update();
}
} // end P_FilterComponentLayout
内容来源于网络,如有侵权,请联系作者删除!