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

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

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

JSlider.removeChangeListener介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

protected void setPositionSliderWithoutNotification(int value) {
  if (value == positionSlider.getValue()) return;
  ChangeListener[] listeners = positionSlider.getChangeListeners();
  for (ChangeListener listener : listeners) {
    positionSlider.removeChangeListener(listener);
  }
  positionSlider.setValue(value);
  for (ChangeListener listener : listeners) {
    positionSlider.addChangeListener(listener);
  }
}

代码示例来源:origin: 4thline/cling

protected void setVolumeSliderWithoutNotification(int value) {
    if (value == volumeSlider.getValue()) return;
    ChangeListener[] listeners = volumeSlider.getChangeListeners();
    for (ChangeListener listener : listeners) {
      volumeSlider.removeChangeListener(listener);
    }
    volumeSlider.setValue(value);
    for (ChangeListener listener : listeners) {
      volumeSlider.addChangeListener(listener);
    }
    // Mute button state depends on volume state
    muteButton.setSelected(value == 0);
  }
}

代码示例来源: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(JSlider component, ChangeListener listener) {
    component.removeChangeListener(listener);
  }
}

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

@Override
public void removeListener(SwingListener listener) {
  slider.removeChangeListener(listener);
}

代码示例来源:origin: nroduit/Weasis

public void removeChangeListener(ChangeListener listener) {
  slider.removeChangeListener(listener);
}

代码示例来源:origin: org.activecomponents.jadex/jadex-editor-bpmn

/**
   *  Sets the zoom text.
   *  @param scale The scale.
   */
  protected void setZoomText(double scale)
  {
    slider.removeChangeListener(changelistener);
    slider.setValue((int) Math.round(scale * 100.0));
    slider.addChangeListener(changelistener);
  }
}

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

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

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

/**
 * Updates the view, must be called in a GUI thread
 */
public void process(ImageGray disparity , BufferedImage color ) {
  view.process(disparity,color);
  tiltSlider.removeChangeListener(this);
  tiltSlider.setValue(view.tiltAngle);
  tiltSlider.addChangeListener(this);
}

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

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

代码示例来源:origin: senbox-org/snap-desktop

/**
 * Sets the slider value.
 * @param sliderValue the slider value
 */
public void setSliderValue(int sliderValue) {
  this.slider.removeChangeListener(this.localChangeListener);
  this.previousValue = sliderValue;
  this.slider.setValue(this.previousValue);
  refreshInputValue();
  this.slider.addChangeListener(this.localChangeListener);
}

代码示例来源:origin: palantir/Cinch

public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
    try {
      Integer val = (Integer)mutator.get();
      if (val == null) {
        val = -1;
      }
      if (!val.equals(slider.getValue())) {
        slider.removeChangeListener(changeListener);
        slider.setValue(val);
        slider.addChangeListener(changeListener);
      }
    } catch (Exception ex) {
      Wiring.logger.error("exception in JSlider binding", ex);
    }
  }
};

代码示例来源: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: org.netbeans.modules/org-netbeans-modules-vmd-game

private void clearImagePreview() {
  this.sliderWidth.removeChangeListener(this.sliderListener);
  this.sliderHeight.removeChangeListener(this.sliderListener);
  this.sliderWidth.setModel(new DefaultBoundedRangeModel());
  this.sliderHeight.setModel(new DefaultBoundedRangeModel());
  this.sliderWidth.setValue(0);
  this.sliderHeight.setValue(0);
  this.sliderWidth.addChangeListener(sliderListener);
  this.sliderHeight.addChangeListener(sliderListener);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-vmd-game

private void clearImagePreview() {
  this.sliderWidth.removeChangeListener(this.sliderListener);
  this.sliderHeight.removeChangeListener(this.sliderListener);
  
  this.sliderWidth.setModel(new DefaultBoundedRangeModel());
  this.sliderHeight.setModel(new DefaultBoundedRangeModel());
  this.sliderWidth.setValue(0);
  this.sliderHeight.setValue(0);
  
  this.sliderWidth.addChangeListener(sliderListener);
  this.sliderHeight.addChangeListener(sliderListener);
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public void datesChanged(ChangeEvent e) {
  if (slider != null) {
    slider.removeChangeListener(sliderChangeListener);
    slider.setValue(getDatesModel().getWidth());
    slider.addChangeListener(sliderChangeListener);
  }
  resizeAndRepaint();
}

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

@Override
public void stateChanged(ChangeEvent e) {
  if (campaign.getCampaignOptions().useLoanLimits()) {
    if (e.getSource() == sldInterest) {
      sldCollateral.removeChangeListener(this);
      sldCollateral.setValue(Loan.recalculateCollateralFromInterest(sldInterest.getValue(), rating));
      sldCollateral.addChangeListener(this);
    } else if (e.getSource() == sldCollateral) {
      sldInterest.removeChangeListener(this);
      sldInterest.setValue(Loan.recalculateInterestFromCollateral(sldCollateral.getValue(), rating));
      sldInterest.addChangeListener(this);
    }
  }
  refreshLoan(loan.getPrincipal());
}

代码示例来源:origin: palantir/Cinch

public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
    if (!BindingContext.isOn(onObject, changed)) {
      return;
    }
    try {
      int extent = (Integer) getter.getMethod().invoke(model1);
      slider.removeChangeListener(changeListener);
      slider.setExtent(extent);
      slider.addChangeListener(changeListener);
    } catch (Exception ex) {
      logger.error("could not invoke JSlider binding", ex);
    }
  }
};

代码示例来源:origin: com.synaptix/SynaptixSwing

public void datesDayWidthChanged() {
  dayWidthSlider.removeChangeListener(sliderPanelChangeListener);
  dayWidthSlider.setValue(getDayWidth());
  dayWidthSlider.addChangeListener(sliderPanelChangeListener);
  // internalTimelinePanel.revalidate();
  datesPanel.resizeAndRepaint();
  internalTimelinePanel.repaint();
  centerAtCurrentDay();
}

相关文章

JSlider类方法