當前位置: 首頁>>代碼示例>>Java>>正文


Java Spinner.setMinimum方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Spinner.setMinimum方法的典型用法代碼示例。如果您正苦於以下問題:Java Spinner.setMinimum方法的具體用法?Java Spinner.setMinimum怎麽用?Java Spinner.setMinimum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Spinner的用法示例。


在下文中一共展示了Spinner.setMinimum方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDialogArea

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {		
	
	Composite composite = new Composite(parent, SWT.NONE);
	
	Label labelDescription = new Label(composite, SWT.WRAP);
	labelDescription.setText("Limit chars logs");
	
	final Spinner spinnerBox = new Spinner(composite, SWT.WRAP);
	spinnerBox.setMaximum(MAX_LOG_CHARS);
	spinnerBox.setMinimum(MIN_LOG_CHARS);
	spinnerBox.setSelection(limitLogsChars);
	spinnerBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	
	spinnerBox.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			limitLogsChars = Integer.parseInt(spinnerBox.getText());
		}
	});
	
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	composite.setLayout(new GridLayout(2, false));
	
	return composite;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:27,代碼來源:LimitCharsLogsPreferenceDialog.java

示例2: createSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
 * @param parent
 * @param min
 * @param max
 * @param hspan
 * @param style
 * @return
 */
public static Spinner createSpinner(Composite parent, int min, int max, int hspan, int style)
{
	Spinner spinner = new Spinner(parent, SWT.BORDER | style);
	spinner.setMinimum(min);
	spinner.setMaximum(max);

	GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false, hspan, 1);
	PixelConverter pc = new PixelConverter(spinner);
	// See http://jira.appcelerator.org/browse/APSTUD-3215
	// We need to add some extra spacing to the MacOSX spinner in order to adjust the size to the way Mac draws
	// spinners.
	int extraWidth = Platform.OS_MACOSX.equals(Platform.getOS()) ? 25 : 0;
	gd.widthHint = pc.convertWidthInCharsToPixels(2) + extraWidth;
	spinner.setLayoutData(gd);
	return spinner;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:25,代碼來源:SWTFactory.java

示例3: createUI_Spinner_PositionSize

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Spinner createUI_Spinner_PositionSize(final Composite container) {

		final Spinner spinnerPositionSize = new Spinner(container, SWT.BORDER);
		GridDataFactory.fillDefaults() //
				.align(SWT.BEGINNING, SWT.FILL)
				.applyTo(spinnerPositionSize);

		spinnerPositionSize.setMinimum(TourTrackConfigManager.TRACK_POSITION_SIZE_MIN);
		spinnerPositionSize.setMaximum(TourTrackConfigManager.TRACK_POSITION_SIZE_MAX);
		spinnerPositionSize.setIncrement(1);
		spinnerPositionSize.setPageIncrement(50);
		spinnerPositionSize.addSelectionListener(_defaultSelectionListener);
		spinnerPositionSize.addMouseWheelListener(_defaultMouseWheelListener);

		return spinnerPositionSize;
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:17,代碼來源:DialogTourTrackConfig.java

示例4: createCommun_trigger

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
 * This method initializes commun_trigger	
 *
 */
private void createCommun_trigger() {
	commun_trigger = new Composite(this, SWT.NONE);
	
	GridData gridData1 = new GridData();
	gridData1.verticalAlignment = GridData.CENTER;
	gridData1.horizontalAlignment = GridData.FILL;
	gridData1.grabExcessHorizontalSpace = true;
	commun_trigger.setLayoutData(gridData1);
	
	GridLayout gridLayout = new GridLayout();
	gridLayout.makeColumnsEqualWidth = false;
	gridLayout.numColumns = 2;
	commun_trigger.setLayout(gridLayout);		

	type_trigger_label = new Label(commun_trigger, SWT.NONE);		
	type_trigger_label.setText("Type of synchronizer");		
	
	createType_trigger_combo();
	
	timeout_label = new Label(commun_trigger, SWT.NONE);
	timeout_label.setText("Timeout (ms)");
						
	timeout_spin = new Spinner(commun_trigger, SWT.BORDER);
	timeout_spin.setMinimum(0);
	timeout_spin.setMaximum(Integer.MAX_VALUE);
	timeout_spin.setSelection((int) trigger.getTimeout());
	
	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.verticalAlignment = GridData.CENTER;
	gridData.grabExcessHorizontalSpace = true;
	timeout_spin.setLayoutData(gridData);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:38,代碼來源:HttpTriggerEditorComposite.java

示例5: fillSynthPolyphonySpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
protected void fillSynthPolyphonySpinner( Spinner spinner ){
	int value = getIntegerValue( MidiSettings.SYNTH_POLYPHONY );
	int[] range = getSynth().getIntegerPropertyRange( MidiSettings.SYNTH_POLYPHONY );
	if( range.length == 2 && range[0] < range[1] ){
		spinner.setMinimum( range[0] );
		spinner.setMaximum( range[1] );
		spinner.setIncrement(1);
		spinner.setPageIncrement(1);
		if( value >= range[0] && value <= range[1] ){
			spinner.setSelection( value );
		}
	}
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:14,代碼來源:MidiOutputPortSettings.java

示例6: makeSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Spinner makeSpinner(Composite parent,String label,int value, int min, int max){
	this.newLabel(parent,label);
	Spinner spinner = new Spinner(parent,SWT.BORDER);
	spinner.setMinimum(min);
	spinner.setMaximum(max);
	spinner.setSelection(value);
	spinner.setLayoutData(getGridData());
	return spinner;
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:10,代碼來源:TGChordSettingsDialog.java

示例7: initScaleGroup

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void initScaleGroup(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;

    final Group scaleGroup = new Group(parent, SWT.NONE);
    scaleGroup.setLayoutData(gridData);
    scaleGroup.setText(ResourceString.getResourceString("label.page.scale.printing"));

    final GridLayout scaleGroupLayout = new GridLayout();
    scaleGroupLayout.marginWidth = 20;
    scaleGroupLayout.horizontalSpacing = 20;
    scaleGroupLayout.numColumns = 3;
    scaleGroup.setLayout(scaleGroupLayout);

    Label label = new Label(scaleGroup, SWT.NONE);
    label.setText(ResourceString.getResourceString("label.page.scale"));

    scaleSpinner = new Spinner(scaleGroup, SWT.BORDER);
    scaleSpinner.setIncrement(5);
    scaleSpinner.setMinimum(10);
    scaleSpinner.setMaximum(400);
    scaleSpinner.setSelection(100);

    label = new Label(scaleGroup, SWT.NONE);
    label.setText("%");

}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:29,代碼來源:PageSettingDialog.java

示例8: setMarginSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void setMarginSpinner(final Spinner spinner) {
    spinner.setDigits(1);
    spinner.setIncrement(5);
    spinner.setMinimum(0);
    spinner.setMaximum(1000);
    spinner.setSelection(20);
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:8,代碼來源:PageSettingDialog.java

示例9: createSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Spinner createSpinner(Composite parent, String label, boolean isFloat, String propertyName) {		
		Label l = new Label(parent, SWT.LEFT);
		l.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
		l.setText(label);
				
		Spinner sp = new Spinner(parent, SWT.BORDER);
		sp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		if (propertyName!=null && !propertyName.isEmpty())
			sp.setData("propertyName", propertyName);

	    // set the minimum value to 0.1
		sp.setMinimum(0);
	    // set the maximum value to 20
		sp.setMaximum((int) 1e6);
		
		if (isFloat) {
			// allow 3 decimal places
			sp.setDigits(FLOAT_DIGITS);
			sp.setIncrement(FLOAT_MULTIPLICATOR);
//			sp.setSelection(FLOAT_MULTIPLICATOR);
		} else {
			sp.setIncrement(0);
			sp.setIncrement(1);
//			sp.setSelection(1);			
		}
		sp.setSelection(0);
		sp.pack();
		
	    return sp;
		
	}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:32,代碼來源:TextStyleTypeWidget.java

示例10: initScaleGroup

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void initScaleGroup(Composite parent) {
	GridData gridData = new GridData();
	gridData.grabExcessHorizontalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;

	Group scaleGroup = new Group(parent, SWT.NONE);
	scaleGroup.setLayoutData(gridData);
	scaleGroup.setText(ResourceString
			.getResourceString("label.page.scale.printing"));

	GridLayout scaleGroupLayout = new GridLayout();
	scaleGroupLayout.marginWidth = 20;
	scaleGroupLayout.horizontalSpacing = 20;
	scaleGroupLayout.numColumns = 3;
	scaleGroup.setLayout(scaleGroupLayout);

	Label label = new Label(scaleGroup, SWT.NONE);
	label.setText(ResourceString.getResourceString("label.page.scale"));

	scaleSpinner = new Spinner(scaleGroup, SWT.BORDER);
	scaleSpinner.setIncrement(5);
	scaleSpinner.setMinimum(10);
	scaleSpinner.setMaximum(400);
	scaleSpinner.setSelection(100);

	label = new Label(scaleGroup, SWT.NONE);
	label.setText("%");

}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:30,代碼來源:PageSettingDialog.java

示例11: setMarginSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void setMarginSpinner(Spinner spinner) {
	spinner.setDigits(1);
	spinner.setIncrement(5);
	spinner.setMinimum(0);
	spinner.setMaximum(1000);
	spinner.setSelection(20);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:8,代碼來源:PageSettingDialog.java

示例12: createUI_20_ImageSize

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
 * spinner: thumb size
 */
private void createUI_20_ImageSize(final Composite parent) {

	_spinnerThumbSize = new Spinner(parent, SWT.BORDER);
	GridDataFactory.fillDefaults() //
			.align(SWT.BEGINNING, SWT.FILL)
			.applyTo(_spinnerThumbSize);
	_spinnerThumbSize.setMinimum(ImageGallery.MIN_GALLERY_ITEM_WIDTH);
	_spinnerThumbSize.setMaximum(ImageGallery.MAX_GALLERY_ITEM_WIDTH);
	_spinnerThumbSize.setIncrement(1);
	_spinnerThumbSize.setPageIncrement(50);
	_spinnerThumbSize.setToolTipText(UI.IS_OSX
			? Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip_OSX
			: Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip);
	_spinnerThumbSize.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(final SelectionEvent e) {
			_imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
		}
	});
	_spinnerThumbSize.addMouseWheelListener(new MouseWheelListener() {
		public void mouseScrolled(final MouseEvent event) {
			Util.adjustSpinnerValueOnMouseScroll(event);
			_imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
		}
	});
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:30,代碼來源:GalleryActionBar.java

示例13: initScaleGroup

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void initScaleGroup(Composite parent) {
    final GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;

    final Group scaleGroup = new Group(parent, SWT.NONE);
    scaleGroup.setLayoutData(gridData);
    scaleGroup.setBackground(ColorConstants.white);
    scaleGroup.setText(DisplayMessages.getMessage("label.page.scale.printing"));

    final GridLayout scaleGroupLayout = new GridLayout();
    scaleGroupLayout.marginWidth = 20;
    scaleGroupLayout.horizontalSpacing = 20;
    scaleGroupLayout.numColumns = 3;
    scaleGroup.setLayout(scaleGroupLayout);

    Label label = new Label(scaleGroup, SWT.NONE);
    label.setBackground(ColorConstants.white);
    label.setText(DisplayMessages.getMessage("label.page.scale"));

    scaleSpinner = new Spinner(scaleGroup, SWT.BORDER);
    scaleSpinner.setIncrement(5);
    scaleSpinner.setMinimum(10);
    scaleSpinner.setMaximum(400);
    scaleSpinner.setSelection(100);

    label = new Label(scaleGroup, SWT.NONE);
    label.setBackground(ColorConstants.white);
    label.setText("%");
}
 
開發者ID:dbflute-session,項目名稱:erflute,代碼行數:31,代碼來源:PageSettingDialog.java

示例14: setMarginSpinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void setMarginSpinner(Spinner spinner) {
    spinner.setDigits(1);
    spinner.setIncrement(5);
    spinner.setMinimum(0);
    spinner.setMaximum(1000);
    spinner.setSelection(20);
}
 
開發者ID:dbflute-session,項目名稱:erflute,代碼行數:8,代碼來源:PageSettingDialog.java

示例15: createUI_Spinner

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Spinner createUI_Spinner(final Composite parent, final int minValue, final int maxValue) {

		final Spinner spinner = new Spinner(parent, SWT.BORDER);
		GridDataFactory.fillDefaults()//
				.align(SWT.END, SWT.FILL)
				.applyTo(spinner);

		spinner.setMinimum(minValue);
		spinner.setMaximum(maxValue);

		spinner.addMouseWheelListener(_defaultMouseWheelListener);
		spinner.addSelectionListener(_defaultSelectionListener);

		return spinner;
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:16,代碼來源:SlideoutGraphMinMax.java


注:本文中的org.eclipse.swt.widgets.Spinner.setMinimum方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。