本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}