本文整理汇总了Java中de.linearbits.swt.widgets.KnobRange.Double方法的典型用法代码示例。如果您正苦于以下问题:Java KnobRange.Double方法的具体用法?Java KnobRange.Double怎么用?Java KnobRange.Double使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.linearbits.swt.widgets.KnobRange
的用法示例。
在下文中一共展示了KnobRange.Double方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createKnobDouble
import de.linearbits.swt.widgets.KnobRange; //导入方法依赖的package包/类
/**
* Creates a double knob
* @param parent
* @param min
* @param max
* @return
*/
protected Knob<Double> createKnobDouble(Composite parent, double min, double max) {
Knob<Double> knob = new Knob<Double>(parent, SWT.NULL, new KnobRange.Double(min, max));
knob.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).align(SWT.CENTER, SWT.CENTER).hint(30, 30).create());
knob.setDefaultColorProfile(defaultColorProfile);
knob.setFocusedColorProfile(focusedColorProfile);
return knob;
}
示例2: createKnob
import de.linearbits.swt.widgets.KnobRange; //导入方法依赖的package包/类
/**
* Creates a knob
* @param root
* @param text
* @return
*/
private Knob<Double> createKnob(Composite root) {
Knob<Double> knob = new Knob<Double>(root, SWT.NULL, new KnobRange.Double(0d, 100d));
knob.setLayoutData(GridDataFactory.swtDefaults().grab(true, true).align(SWT.CENTER, SWT.CENTER).hint(MIN_KNOB, MIN_KNOB).create());
knob.setDefaultColorProfile(defaultColorProfile);
knob.setFocusedColorProfile(focusedColorProfile);
return knob;
}
示例3: build
import de.linearbits.swt.widgets.KnobRange; //导入方法依赖的package包/类
/**
* This Method builds the View and add all Attribut Weights
* @author Florian Wiedner
* @category ViewAttributeWeights
* @since 1.7
* @param parent The Parent Composite for adding
*/
private void build(Composite parent){
if(this.composite==null&&this.fields!=null){
// Create layout
this.composite = new Composite(parent, SWT.NONE);
this.composite.setLayout(GridLayoutFactory.swtDefaults().numColumns(fields.length).margins(0, 0).equalWidth(true).create());
// Create composites
for(int i=0; i<this.fields.length; i++){
Composite c = new Composite(this.composite, SWT.NONE);
c.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.CENTER).create());
c.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(2, 0).create());
//Create Label
Label label = new Label(c, SWT.CENTER);
label.setText(this.fields[i]);
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
//Create Knob
final Knob<Double> knob = new Knob<Double>(c, SWT.NULL, new KnobRange.Double(0d, 1d));
knob.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).align(SWT.CENTER, SWT.CENTER).hint(MIN_KNOB, MIN_KNOB).create());
knob.setDefaultColorProfile(defaultColorProfile);
knob.setFocusedColorProfile(focusedColorProfile);
//Create Text
final Text labelObject = new Text(c, SWT.CENTER);
labelObject.setText("0.0"); //$NON-NLS-1$
labelObject.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
labelObject.setEditable(false);
labelObject.setEnabled(true);
final ARXFields fieldObject=meta.getField(fields[i]);
knob.setValue(fieldObject.getAttributeWeight());
labelObject.setText(knob.getValue()+"");
knob.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent arg0) {
double value = knob.getValue();
labelObject.setText(value+"");
labelObject.setToolTipText(String.valueOf(value));
fieldObject.setAttributeWeight(value);
meta.setChanged(true);
}
});
}
}
}
示例4: createKnobDouble
import de.linearbits.swt.widgets.KnobRange; //导入方法依赖的package包/类
/**
* Creates a double knob
* @param parent The parent Composite
* @param min The Minimum Value
* @param max The Maximum Value
* @since 1.1
* @category Parameters
* @see <a href="http://arx.deidentifier.org">ARX Deidentifier Project
* Website</a>
* @return A new Knob for Doubles
*/
protected Knob<Double> createKnobDouble(Composite parent, double min, double max) {
Knob<Double> knob = new Knob<Double>(parent, SWT.NULL, new KnobRange.Double(min, max));
knob.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).align(SWT.CENTER, SWT.CENTER).hint(30, 30).create());
knob.setDefaultColorProfile(defaultColorProfile);
knob.setFocusedColorProfile(focusedColorProfile);
return knob;
}