javax.swing.JSpinner.removeChangeListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(113)

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

JSpinner.removeChangeListener介绍

暂无

代码示例

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

protected static <K> void setValue(JSpinner spinner, K object){
  ChangeListener[] listeners = spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    spinner.removeChangeListener(listener);
  }
  spinner.setValue(object);
  if(listener != null) spinner.addChangeListener(listener);
}

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

protected static <K> void setValue(JSpinner spinner, K object){
  ChangeListener[] listeners = spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    spinner.removeChangeListener(listener);
  }
  spinner.setValue(object);
  if(listener != null) spinner.addChangeListener(listener);
}

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

protected static <K> void setValue(Slider slider, float value){
  ChangeListener[] listeners = slider.spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    slider.spinner.removeChangeListener(listener);
  }
  slider.setValue(value);
  if(listener != null) slider.spinner.addChangeListener(listener);
}

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

protected static <K> void setValue(Slider slider, float value){
  ChangeListener[] listeners = slider.spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    slider.spinner.removeChangeListener(listener);
  }
  slider.setValue(value);
  if(listener != null) slider.spinner.addChangeListener(listener);
}

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void close() throws IOException {
  if(cmpt!=null && l!=null ){
    cmpt.removeChangeListener(l);
    cmpt = null;
    l = null;
  }
}};

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
   * @see Disposable#dispose()
   */
  @Override
  public void dispose() {
    if (source != null) {
      source.removeChangeListener(sourceAdapter);
      source = null;
    }
  }
}

代码示例来源:origin: no.tornado.databinding/databinding

public void removeValueChangelistener(JSpinner component, ChangeListener listener) {
  component.removeChangeListener(listener);
}

代码示例来源:origin: org.boofcv/demonstrations

private void updateThresholdValue() {
  spinnerThreshold.removeChangeListener(this);
  if( type == ThresholdType.FIXED ) {
    spinnerThreshold.setValue(fixedThreshold);
  } else if( type == ThresholdType.BLOCK_MIN_MAX) {
    spinnerThreshold.setValue((int)minimumSpread);
  } else if( type == ThresholdType.BLOCK_OTSU ||
      type == ThresholdType.LOCAL_OTSU  ) {
    spinnerThreshold.setValue(otsuTuning);
  }
  spinnerThreshold.addChangeListener(this);
}

代码示例来源:origin: it.tidalwave.betterbeansbinding/betterbeansbinding-swingbinding

protected void listeningStopped() {
  spinner.removeChangeListener(handler);
  spinner.removePropertyChangeListener("model", handler);
  handler = null;
}

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

protected void listeningStopped() {
  spinner.removeChangeListener(handler);
  spinner.removePropertyChangeListener("model", handler);
  handler = null;
}

代码示例来源:origin: org.boofcv/demonstrations

@Override
  public void run() {
    selectPitch.removeChangeListener(RotationPanel.this);
    selectYaw.removeChangeListener(RotationPanel.this);
    selectRoll.removeChangeListener(RotationPanel.this);
    selectPitch.setValue(pitch);
    selectYaw.setValue(yaw);
    selectRoll.setValue(roll);
    selectPitch.addChangeListener(RotationPanel.this);
    selectYaw.addChangeListener(RotationPanel.this);
    selectRoll.addChangeListener(RotationPanel.this);
  }
});

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore

private void updateAnimationTime(float time, float maxTime) {
  currentTimeSpinner.removeChangeListener(changeListener);
  slider.removeChangeListener(changeListener);
  
  if (maxTime != -1) {
    slider.setMaximum(Math.round(maxTime / SLIDER_DEFAULT_STEP));
  }
  slider.setValue(Math.round(time / SLIDER_DEFAULT_STEP));
  time = Math.round(time * 10) / 10.0f;
  currentTimeSpinner.setValue(new Float(time));
  
  slider.addChangeListener(changeListener);
  currentTimeSpinner.addChangeListener(changeListener);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-tools

protected static <K> void setValue(JSpinner spinner, K object){
  ChangeListener[] listeners = spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    spinner.removeChangeListener(listener);
  }
  spinner.setValue(object);
  if(listener != null) spinner.addChangeListener(listener);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-visualizers

private final void update(Collection<TimeIntervalDataFilter> filters) {
  TimeIntervalDataFilter filter = null;
  if (filters != null && !filters.isEmpty()) {
    filter = filters.iterator().next();
  }
  synchronized (uiLock) {
    startTimeSpinner.removeChangeListener(startTimeChangeListener);
    endTimeSpinner.removeChangeListener(endTimeChangeListener);
    startTimeSpinner.setValue(filter == null ? 0L : filter.getInterval().getStart());
    endTimeSpinner.setValue(filter == null ? Long.MAX_VALUE : filter.getInterval().getEnd());
    startTimeSpinner.addChangeListener(startTimeChangeListener);
    endTimeSpinner.addChangeListener(endTimeChangeListener);
  }
}

代码示例来源:origin: org.boofcv/visualize

@Override
public void actionPerformed(ActionEvent e) {
  if( e.getSource() == homeButton ) {
    view.offsetX = 0;
    view.offsetY = 0;
    view.tiltAngle = 0;
    view.range = 1;
    tiltSlider.removeChangeListener(this);
    tiltSlider.setValue(view.tiltAngle);
    tiltSlider.addChangeListener(this);
    rangeSpinner.removeChangeListener(this);
    rangeSpinner.setValue(view.range);
    rangeSpinner.addChangeListener(this);
  }
  view.repaint();
}

代码示例来源:origin: MegaMek/megamek

private void recalcMaxValues() {
  double[] currentWeight = new double[spinners.size()];
  double remaining = tonnage;
  for (int i = 0; i < spinners.size(); i++) {
    currentWeight[i] += Math.ceil(munitions.get(i).getTonnage(entity)
        * ((Integer) spinners.get(i).getValue() / (double) munitions.get(i).getShots()));
    remaining -= currentWeight[i];
  }
  for (int i = 0; i < spinners.size(); i++) {
    int max = (int) Math.floor((currentWeight[i] + remaining)
        / munitions.get(i).getTonnage(entity) * munitions.get(i).getShots());
    spinners.get(i).removeChangeListener(this);
    ((SpinnerNumberModel) spinners.get(i).getModel()).setMaximum(max);
    spinners.get(i).addChangeListener(this);
  }
  lblTonnage.setText(String.format(Messages.getString("CustomMechDialog.formatAmmoTonnage"), //$NON-NLS-1$
      tonnage - remaining, tonnage));
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-tools

protected static <K> void setValue(Slider slider, float value){
  ChangeListener[] listeners = slider.spinner.getChangeListeners();
  ChangeListener listener = null;
  if(listeners != null && listeners.length >0){
    listener = listeners[0];
    slider.spinner.removeChangeListener(listener);
  }
  slider.setValue(value);
  if(listener != null) slider.spinner.addChangeListener(listener);
}

代码示例来源:origin: org.boofcv/demonstrations

public void setConfiguration(ConfigThreshold configuration) {
  comboType.removeActionListener(this);
  spinnerScale.removeChangeListener(this);
  buttonUpDown.removeActionListener(this);
  checkOtsu2.removeActionListener(this);
  comboType.setSelectedIndex(configuration.type.ordinal());
  controlWidth.setValue(configuration.width);
  spinnerScale.setValue(configuration.scale);
  buttonUpDown.setSelected(configuration.down);
  type = configuration.type;
  regionWidth = configuration.width.copy();
  scale = configuration.scale;
  down = configuration.down;
  if( type == ThresholdType.FIXED ) {
    fixedThreshold = (int)configuration.fixedThreshold;
  } else if( type == ThresholdType.BLOCK_MIN_MAX) {
    minimumSpread = ((ConfigThresholdBlockMinMax)configuration).minimumSpread;
  } else if( type == ThresholdType.BLOCK_OTSU ||
      type == ThresholdType.LOCAL_OTSU  ) {
    otsuTuning = (int)((ConfigThresholdLocalOtsu)configuration).tuning;
    useOtsu2 = ((ConfigThresholdLocalOtsu)configuration).useOtsu2;
  }
  comboType.addActionListener(this);
  spinnerScale.addChangeListener(this);
  buttonUpDown.addActionListener(this);
  checkOtsu2.addActionListener(this);
  updateThresholdValue();
}

代码示例来源:origin: com.github.waikato/fcms-widgets

/**
  * Removes a change listener from the specified component.
  *
  * @param comp    the component to remove the listener from
  */
 protected void removeChangeListenerFrom(Component comp) {
  if (comp instanceof AbstractChooserPanel)
   ((AbstractChooserPanel) comp).removeChangeListener(this);
  else if (comp instanceof JTextComponent)
   ((JTextComponent) comp).getDocument().removeDocumentListener(m_DocumentListener);
  else if (comp instanceof AbstractButton)
   ((AbstractButton) comp).removeActionListener(m_ActionListener);
  else if (comp instanceof JComboBox)
   ((JComboBox) comp).removeActionListener(m_ActionListener);
  else if (comp instanceof JSpinner)
   ((JSpinner) comp).removeChangeListener(this);
  else if (comp instanceof PropertyEditor)
   ((PropertyEditor) comp).removePropertyChangeListener(m_PropertyChangeListener);
  //else
  //  System.err.println("Failed to remove change listener from component type: " + Utils.classToString(comp));
 }
}

代码示例来源:origin: org.boofcv/boofcv-swing

private void updateValues( double fraction , double length ) {
  spinnerFraction.removeChangeListener(this);
  textLength.removePropertyChangeListener("value",this);
  if(modeRelative) {
    valueFraction.fraction = fraction;
    valueFraction.length = length;
    spinnerFraction.setEnabled(true);
    spinnerFraction.setValue(fraction);
  } else {
    valueFixed.length = length;
    spinnerFraction.setEnabled(false);
    spinnerFraction.setValue(0);
  }
  if( integerMode )
    textLength.setValue((int)length);
  else
    textLength.setValue(length);
  spinnerFraction.addChangeListener(this);
  textLength.addPropertyChangeListener("value",this);
}

相关文章