当前位置: 首页>>代码示例>>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;未经允许,请勿转载。