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


Java Spinner.getData方法代碼示例

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


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

示例1: onFieldSelectValue

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void onFieldSelectValue(final Widget widget) {

		if (_isInUIUpdate) {
			return;
		}

		final Spinner spinner = (Spinner) widget;
		final Integer vertexIndex = (Integer) spinner.getData(DATA_KEY_VERTEX_INDEX);
		final RGBVertex vertex = getRgbVertices().get(vertexIndex);

		// update model
		vertex.setValue(spinner.getSelection());

		updateModel_FromUI_Vertices();

		// update UI
		updateUI_FromModel_Vertices();

		onApply(false);
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:21,代碼來源:DialogMap3ColorEditor.java

示例2: onField_Select_Number_Float

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void onField_Select_Number_Float(final Widget widget) {

		final Spinner spinner = (Spinner) widget;

		final TourFilterProperty filterProperty = (TourFilterProperty) spinner.getData();
		final int fieldNo = (int) spinner.getData(FIELD_NO);

		final double selectedValue = spinner.getSelection();
		final TourFilterFieldConfig fieldConfig = filterProperty.fieldConfig;

		// remove spinner digits
		double fieldValue = selectedValue / Math.pow(10, fieldConfig.numDigits);

		if (fieldConfig.fieldValueConverter != null) {
			fieldValue = fieldConfig.fieldValueConverter.convert_UI_To_Model(fieldValue);
		}

		if (fieldNo == 1) {
			filterProperty.doubleValue1 = fieldValue;
		} else {
			filterProperty.doubleValue2 = fieldValue;
		}

		fireModifyEvent();
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:26,代碼來源:SlideoutTourFilter.java

示例3: onField_Select_Number_Integer

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void onField_Select_Number_Integer(final Widget widget) {

		final Spinner spinner = (Spinner) widget;

		final TourFilterProperty filterProperty = (TourFilterProperty) spinner.getData();
		final int fieldNo = (int) spinner.getData(FIELD_NO);

		final int selectedValue = spinner.getSelection();
		final TourFilterFieldConfig fieldConfig = filterProperty.fieldConfig;

		double fieldValue = selectedValue;

		if (fieldConfig.fieldValueConverter != null) {
			fieldValue = fieldConfig.fieldValueConverter.convert_UI_To_Model(fieldValue);
		}

		if (fieldNo == 1) {
			filterProperty.intValue1 = (int) (fieldValue + 0.5);
		} else {
			filterProperty.intValue2 = (int) (fieldValue + 0.5);
		}

		fireModifyEvent();
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:25,代碼來源:SlideoutTourFilter.java

示例4: onField_Select_SeasonDay

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void onField_Select_SeasonDay(final Widget widget) {

		final Spinner spinnerDay = (Spinner) widget;

		final TourFilterProperty filterProperty = (TourFilterProperty) spinnerDay.getData();
		final int fieldNo = (int) spinnerDay.getData(FIELD_NO);

		final int selectedDay = spinnerDay.getSelection();

		final MonthDay oldField = fieldNo == 1 //
				? filterProperty.monthDay1
				: filterProperty.monthDay2;
		final int oldMonth = oldField.getMonthValue();

		final MonthDay monthDay = MonthDay.of(oldMonth, selectedDay);

		if (fieldNo == 1) {
			filterProperty.monthDay1 = monthDay;
		} else {
			filterProperty.monthDay2 = monthDay;
		}

		fireModifyEvent();
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:25,代碼來源:SlideoutTourFilter.java

示例5: updateModel_FromUI_Vertices

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
 * Get vertices from UI and sorts them.
 */
private void updateModel_FromUI_Vertices() {

	final ArrayList<RGBVertex> rgbVertices = getRgbVertices();
	final int rgbVertexListSize = rgbVertices.size();
	final ArrayList<RGBVertex> newRgbVertices = new ArrayList<RGBVertex>();

	for (int vertexIndex = 0; vertexIndex < rgbVertexListSize; vertexIndex++) {

		/*
		 * create vertices from UI controls
		 */
		final Spinner spinnerOpacity = _spinnerOpacity[vertexIndex];
		final Spinner spinnerVertexValue = _spinnerVertexValue[vertexIndex];

		final int value = spinnerVertexValue.getSelection();
		final Integer sortId = (Integer) spinnerVertexValue.getData(DATA_KEY_SORT_ID);

		final RGB rgb = _lblVertexColor[vertexIndex].getBackground().getRGB();
		final float opacity = (float) (spinnerOpacity.getSelection() / Map3GradientColorManager.OPACITY_DIGITS_FACTOR);

		final RGBVertex rgbVertex = new RGBVertex(sortId);
		rgbVertex.setValue(value);
		rgbVertex.setRGB(rgb);
		rgbVertex.setOpacity(opacity);

		newRgbVertices.add(rgbVertex);
	}

	// sort vertices by value
	Collections.sort(newRgbVertices);

	// update model
	getProfileImage().setVertices(newRgbVertices);

	_isProntoColorEnabled = _chkProntoColor.getSelection();
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:40,代碼來源:DialogMap3ColorEditor.java

示例6: onFieldSelectElevation

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void onFieldSelectElevation(final Widget widget) {

		if (_isUIUpdated) {
			return;
		}

		final Spinner spinner = (Spinner) widget;
		final RGBVertex vertex = (RGBVertex) spinner.getData();

		vertex.setValue(spinner.getSelection());
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:12,代碼來源:DialogSelectSRTMColors.java


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