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

x33g5p2x  于2022-01-30 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(174)

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

Spinner.setDigits介绍

[英]Sets the number of decimal places used by the receiver.

The digit setting is used to allow for floating point values in the receiver. For example, to set the selection to a floating point value of 1.37 call setDigits() with a value of 2 and setSelection() with a value of 137. Similarly, if getDigits() has a value of 2 and getSelection() returns 137 this should be interpreted as 1.37. This applies to all numeric APIs.
[中]设置接收器使用的小数位数。
数字设置用于允许接收器中的浮点值。例如,要将选择设置为浮点值1.37,请调用值为2的setDigits()和值为137的setSelection()。类似地,如果getDigits()的值为2,而getSelection()返回137,则应将其解释为1.37。这适用于所有数字API。

代码示例

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

/**
 * Sets the digits of the "Example" widgets.
 */
void setWidgetDigits () {
  spinner1.setDigits (digitsSpinner.getSelection ());
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private void createFontSizeGroup( Composite parent ) {
 Group result = new Group( parent, SWT.NONE );
 result.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
 result.setText( RWTMessages.getMessage( "RWT_FontDialogFontSizeTitle" ) );
 result.setLayout( new GridLayout() );
 spFontSize = new Spinner( result, SWT.BORDER );
 spFontSize.setDigits( 0 );
 spFontSize.setMinimum( 0 );
 spFontSize.setMaximum( 200 );
 GridData spinnerData = new GridData( SWT.FILL, SWT.FILL, true, true );
 spFontSize.setLayoutData( spinnerData );
}

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

scaleSpinnerX = new Spinner(comp, SWT.BORDER | SWT.WRAP);
scaleSpinnerX.setLayoutData(new GridData(width, SWT.DEFAULT));
scaleSpinnerX.setDigits(2);
scaleSpinnerX.setMinimum(1);
scaleSpinnerX.setMaximum(400);
scaleSpinnerY = new Spinner(comp, SWT.BORDER | SWT.WRAP);
scaleSpinnerY.setLayoutData(new GridData(width, SWT.DEFAULT));
scaleSpinnerY.setDigits(2);
scaleSpinnerY.setMinimum(1);
scaleSpinnerY.setMaximum(400);

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

spinner.setDigits(self.getInt("digits", 0));
spinner.setIncrement(self.getInt("increment", 1));
String maximum = self.getString("maximum");

代码示例来源:origin: eclipse-jetty/eclipse-jetty-plugin

createSpinner(configGroup, SWT.BORDER, Messages.advConfigTab_gracefulShutdownTimeoutTip, 32, -1, 1, 1,
    modifyDialogListener);
gracefulShutdownOverrideTimeoutSpinner.setDigits(1);
gracefulShutdownOverrideTimeoutSpinner.setMinimum(1);
gracefulShutdownOverrideTimeoutSpinner.setMaximum(3000);

相关文章