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

x33g5p2x  于2022-01-16 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(127)

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

Button.getBounds介绍

暂无

代码示例

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

public void paintControl( PaintEvent arg0 ) {
 checkBoxBounds = disable.getBounds();
}

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

protected Button buildPreviewButton() {
 wPreview = new Button( shell, SWT.PUSH | SWT.CENTER );
 updatePreviewButtonStatus();
 wPreview.setText( BaseMessages.getString( PKG, "System.Button.Preview" ) ); //$NON-NLS-1$
 wPreview.pack();
 props.setLook( wPreview );
 wPreview.setLayoutData( new FormDataBuilder().bottom().left( 50, -( wPreview.getBounds().width / 2 ) ).result() );
 wPreview.addListener( SWT.Selection, lsPreview );
 return wPreview;
}

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

checkBoxBounds = disable.getBounds();

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

for ( int i = 0; i < buttons.length; i++ ) {
 buttons[ i ].pack( true );
 Rectangle r = buttons[ i ].getBounds();
 if ( largest == null || r.width > largest.width ) {
  largest = r;

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

wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
wOK.pack( true );
Rectangle rOK = wOK.getBounds();
Rectangle rCancel = wCancel.getBounds();

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

fdGaProfile.left = new FormAttachment( middle, 0 );
fdGaProfile.top = new FormAttachment( wGaCustomProfile, margin );
fdGaProfile.right = new FormAttachment( 100, -wGetProfiles.getBounds().width - margin );
wGaProfile.setLayoutData( fdGaProfile );
fdQuSegment.left = new FormAttachment( middle, 0 );
fdQuSegment.top = new FormAttachment( wQuCustomSegment, margin );
fdQuSegment.right = new FormAttachment( 100, -wGetSegments.getBounds().width - margin );
wQuSegment.setLayoutData( fdQuSegment );

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

private void showActionMenu() {
  Rectangle rect = fMultiActionButton.getBounds();
  Point pt = new Point(rect.x - 1, rect.y + rect.height);
  pt = fMultiActionButton.toDisplay(pt);
  fActionMenu.setLocation(pt.x, pt.y);
  fActionMenu.setVisible(true);
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.pagedesigner

public void paintControl(PaintEvent e) {
    if (!_databindingButton.isEnabled()
        && getDisabledImage() != null) {
      Rectangle buttonBounds = _databindingButton.getBounds();
      Rectangle imageBounds = getDisabledImage().getBounds();
      e.gc.drawImage(getDisabledImage(),
          (buttonBounds.width - imageBounds.width) / 2,
          (buttonBounds.height - imageBounds.height) / 2);
    }
  }
});

代码示例来源:origin: pentaho/big-data-plugin

protected Control createFooter( Composite shell ) {
 wCancel = new Button( shell, SWT.PUSH );
 wCancel.setText( getMsg( "System.Button.Cancel" ) );
 wCancel.addListener( SWT.Selection, lsCancel );
 new FD( wCancel ).right( 100, 0 ).bottom( 100, 0 ).apply();
 // Some buttons
 wOK = new Button( shell, SWT.PUSH );
 wOK.setText( getMsg( "System.Button.OK" ) );
 wOK.addListener( SWT.Selection, lsOK );
 new FD( wOK ).right( wCancel, -FIELD_LABEL_SEP ).bottom( 100, 0 ).apply();
 lsPreview = getPreview();
 if ( lsPreview != null ) {
  wPreview = new Button( shell, SWT.PUSH );
  wPreview.setText( getBaseMsg( "BaseStepDialog.Preview" ) );
  wPreview.pack();
  wPreview.addListener( SWT.Selection, lsPreview );
  int offset = wPreview.getBounds().width / 2;
  new FD( wPreview ).left( 50, -offset ).bottom( 100, 0 ).apply();
 }
 return wCancel;
}

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

代码示例来源:origin: pentaho/big-data-plugin

protected Control createFooter( Composite shell ) {
 wCancel = new Button( shell, SWT.PUSH );
 wCancel.setText( getMsg( "System.Button.Cancel" ) );
 wCancel.addListener( SWT.Selection, lsCancel );
 new FD( wCancel ).right( 100, 0 ).bottom( 100, 0 ).apply();
 // Some buttons
 wOK = new Button( shell, SWT.PUSH );
 wOK.setText( getMsg( "System.Button.OK" ) );
 wOK.addListener( SWT.Selection, lsOK );
 new FD( wOK ).right( wCancel, -FIELD_LABEL_SEP ).bottom( 100, 0 ).apply();
 lsPreview = getPreview();
 if ( lsPreview != null ) {
  wPreview = new Button( shell, SWT.PUSH );
  wPreview.setText( getBaseMsg( "BaseStepDialog.Preview" ) );
  wPreview.pack();
  wPreview.addListener( SWT.Selection, lsPreview );
  int offset = wPreview.getBounds().width / 2;
  new FD( wPreview ).left( 50, -offset ).bottom( 100, 0 ).apply();
 }
 return wCancel;
}

代码示例来源:origin: pentaho/big-data-plugin

protected Control createFooter( Composite shell ) {
 wCancel = new Button( shell, SWT.PUSH );
 wCancel.setText( getMsg( "System.Button.Cancel" ) );
 wCancel.addListener( SWT.Selection, lsCancel );
 new FD( wCancel ).right( 100, 0 ).bottom( 100, 0 ).apply();
 // Some buttons
 wOK = new Button( shell, SWT.PUSH );
 wOK.setText( getMsg( "System.Button.OK" ) );
 wOK.addListener( SWT.Selection, lsOK );
 new FD( wOK ).right( wCancel, -FIELD_LABEL_SEP ).bottom( 100, 0 ).apply();
 lsPreview = getPreview();
 if ( lsPreview != null ) {
  wPreview = new Button( shell, SWT.PUSH );
  wPreview.setText( getBaseMsg( "BaseStepDialog.Preview" ) );
  wPreview.pack();
  wPreview.addListener( SWT.Selection, lsPreview );
  int offset = wPreview.getBounds().width / 2;
  new FD( wPreview ).left( 50, -offset ).bottom( 100, 0 ).apply();
 }
 return wCancel;
}

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

代码示例来源:origin: org.xworker/xworker_swt

public void openMenu() {
  //触发MenuDetect事件                    
  Event event = new Event();
  event.widget = this;
  this.notifyListeners(SWT.MenuDetect, event);
  Menu menu = getMenu();
  if(menu == null || menu.isDisposed() || event.doit == false) {
    event.doit = false;
    return;
  }
  
  Button button = (Button) event.widget;
  Rectangle rect = button.getBounds();
  Point p = button.toDisplay(rect.x, rect.y + rect.height);
  menu.setLocation(p.x-rect.x, p.y-rect.y);
  menu.setVisible(true);
}

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

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

final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);

代码示例来源:origin: be.yildiz-games/module-window-swt

gcBack.setBackground(bh.hover ? h : c);
gcBack.setAlpha(255);
gcBack.fillRectangle(0, 0, b.getBounds().width, b.getBounds().height);
gcBack.setForeground(t);
gcBack.setFont(font);

相关文章

Button类方法