org.eclipse.swt.widgets.Scale.getSelection()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.eclipse.swt.widgets.Scale.getSelection()方法的一些代码示例,展示了Scale.getSelection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scale.getSelection()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Scale
类名称:Scale
方法名:getSelection

Scale.getSelection介绍

[英]Returns the 'selection', which is the receiver's position.
[中]返回“选择”,即接收器的位置。

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void
  handleEvent(Event event)
  {
    if ( !slider_mouse_down[0]){
      int pos = privacy_scale.getSelection();
      int level = ((pos+5)/10);
      setPrivacyLevel( level );
    }
  }
});

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/** {@inheritDoc} */
  @Override
  public int getSelection() {
    return scale.getSelection();
  }
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/** {@inheritDoc} */
  public int getSelection() {
    return scale.getSelection();
  }
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/** {@inheritDoc} */
  public int getSelection() {
    return scale.getSelection();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

/**
 * Gets the default selection of the "Example" widgets.
 */
@Override
int getDefaultSelection () {
  return scale1.getSelection();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

@Override
int doGetIntValue(Object source) {
  return ((Scale) source).getSelection();
}

代码示例来源:origin: stefanhaustein/flowgrid

@Override
  public void widgetSelected(SelectionEvent e) {
    Double newValue = (double) scale.getSelection();
    if (!newValue.equals(value)){
      inputChangedTo((double) scale.getSelection(), false);
    }
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void
mouseUp(
  MouseEvent e )
{
  int	pos = privacy_scale.getSelection();
  int level = ((pos+5)/10);
  if ( level*10 != pos ){
    privacy_scale.setSelection( level*10 );
  }
  setPrivacyLevel( level );
  slider_mouse_down[0] = false;
}

代码示例来源:origin: stackoverflow.com

Scale scale = new Scale(shell, SWT.BORDER);
scale.setMaximum(10 * 10);

Label speedLabel = new Label(shell, SWT.NONE);
speedLabel.setText("time");
scale.addListener(SWT.Selection, new Listener()
{
  public void handleEvent(Event event)
  {
    speedLabel.setText((scale.getSelection() / 10f) + "");
  }
});

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public Map<IPreferenceGroup, Object> eventFired() {
  Sensitivity sensitivity = Sensitivity.fromOrd(slider.getSelection());
  Map<IPreferenceGroup, Object> preferenceControlMap = new HashMap<>();
  preferenceControlMap.put(PreferenceId.SamplingRate.SLIDER_ID, sensitivity);
  // get the actual selected divider mode button and set the specific id
  if (timeframeModeButton.getSelection()) {
    preferenceControlMap.put(PreferenceId.SamplingRate.DIVIDER_ID, PreferenceId.SamplingRate.TIMEFRAME_DIVIDER_ID);
  }
  return preferenceControlMap;
}

代码示例来源:origin: atdl4j/atdl4j

public String getControlValueRaw()
{
  return ( (SliderT) control ).getListItem().get( slider.getSelection() ).getEnumID();
}

代码示例来源:origin: Nodeclipse/EditBox

@Override
  public void widgetSelected(SelectionEvent e) {
    int alpha = scale.getSelection() * 255/100;
    spinner.setSelection(alpha);
    theme.setAlpha(alpha);
  }
});

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

private void writeSelection( final Scale scale ) throws IOException {
 Integer newValue = new Integer( scale.getSelection() );
 String prop = PROP_SELECTION;
 Integer defValue = DEFAULT_SELECTION;
 if( WidgetLCAUtil.hasChanged( scale, prop, newValue, defValue ) ) {
  JSWriter writer = JSWriter.getWriterFor( scale );
  writer.set( prop, newValue );
 }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
protected void doStore() {
  getPreferenceStore()
      .setValue(getPreferenceName(), scale.getSelection());
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
protected void doStore() {
  getPreferenceStore()
      .setValue(getPreferenceName(), scale.getSelection());
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

protected void doStore() {
  getPreferenceStore()
      .setValue(getPreferenceName(), scale.getSelection());
}

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

public EventBased(Composite parent, int initialValue) {
  super(parent, initialValue);
  this.value = initialValue;
  inputField.addListener(SWT.Modify, e -> {
    try {
      int parsed = Integer.parseInt(inputField.getText());
      setValue(parsed);
    } catch (Exception error) {
      outputField.setText(msgForError(error));
    }
  });
  scale.addListener(SWT.Selection, e -> {
    setValue(scale.getSelection());
  });
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
public void preserveValues( Scale scale ) {
 preserveProperty( scale, PROP_MINIMUM, scale.getMinimum() );
 preserveProperty( scale, PROP_MAXIMUM, scale.getMaximum() );
 preserveProperty( scale, PROP_SELECTION, scale.getSelection() );
 preserveProperty( scale, PROP_INCREMENT, scale.getIncrement() );
 preserveProperty( scale, PROP_PAGE_INCREMENT, scale.getPageIncrement() );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
public void renderChanges( Scale scale ) throws IOException {
 ControlLCAUtil.renderChanges( scale );
 WidgetLCAUtil.renderCustomVariant( scale );
 renderProperty( scale, PROP_MINIMUM, scale.getMinimum(), DEFAULT_MINIMUM );
 renderProperty( scale, PROP_MAXIMUM, scale.getMaximum(), DEFAULT_MAXIMUM );
 renderProperty( scale, PROP_SELECTION, scale.getSelection(), DEFAULT_SELECTION );
 renderProperty( scale, PROP_INCREMENT, scale.getIncrement(), DEFAULT_INCREMENT );
 renderProperty( scale, PROP_PAGE_INCREMENT, scale.getPageIncrement(), DEFAULT_PAGE_INCREMENT );
 renderListenSelection( scale );
 renderClientListeners( scale );
}

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

@Test
  public void testControl() {
    InteractiveTest.testCoat("Should show the YCbCr plane at various values of Y", cmp -> {
      Layouts.setGrid(cmp);

      Scale scale = new Scale(cmp, SWT.HORIZONTAL);
      scale.setMinimum(0);
      scale.setMaximum(255);
      scale.setSelection(128);
      Layouts.setGridData(scale).grabHorizontal();

      ColorPicker colors = new ColorPicker(cmp);
      Layouts.setGridData(colors).grabAll();

      scale.addListener(SWT.Selection, e -> {
        colors.setY(scale.getSelection());
      });
    });
  }
}

相关文章