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

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

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

JSlider.addMouseMotionListener介绍

暂无

代码示例

代码示例来源:origin: tulskiy/musique

progressSlider.addMouseMotionListener(new MouseMotionAdapter() {
  @Override
  public void mouseDragged(MouseEvent e) {
progressSlider.addMouseListener(progressMouseListener);
progressSlider.addMouseMotionListener(new MouseMotionAdapter() {
  @Override
  public void mouseDragged(MouseEvent e) {

代码示例来源:origin: Exslims/MercuryTrade

public JSlider getSlider(int min, int max, int value) {
    JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
    slider.setMajorTickSpacing(10);
    slider.setMinorTickSpacing(1);
//        slider.setPaintLabels(true);
//        slider.setUI(new WindowsSliderUI(slider));
    slider.setForeground(AppThemeColor.TEXT_DEFAULT);
    slider.setFont(REGULAR_FONT.deriveFont(15f));
    slider.setRequestFocusEnabled(false);
    slider.addMouseMotionListener(new MouseMotionAdapter() {
      @Override
      public void mouseDragged(MouseEvent e) {
        slider.getParent().repaint();
      }
    });
    slider.setBackground(AppThemeColor.FRAME);
    return slider;
  }

代码示例来源:origin: lbalazscs/Pixelitor

@Override
protected void installListeners(JSlider slider) {
  super.installListeners(slider);
  slider.removeMouseListener(trackListener);
  slider.removeMouseMotionListener(trackListener);
  slider.addMouseListener(myMouseListener);
  slider.addMouseMotionListener(myMouseListener);
  slider.setOpaque(false);
}

代码示例来源:origin: nz.ac.waikato.cms.moa/moa

speedSlider.setMinimumSize(new java.awt.Dimension(160, 68));
speedSlider.setPreferredSize(new java.awt.Dimension(170, 68));
speedSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
  @Override
  public void mouseDragged(java.awt.event.MouseEvent evt) {

代码示例来源:origin: nz.ac.waikato.cms.moa/moa

speedSlider.setMinimumSize(new java.awt.Dimension(150, 68));
speedSlider.setPreferredSize(new java.awt.Dimension(160, 68));
speedSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
  public void mouseDragged(java.awt.event.MouseEvent evt) {
    speedSliderMouseDragged(evt);

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

protected void installListeners(JSlider slider) {
  slider.addMouseListener(trackListener);
  slider.addMouseMotionListener(trackListener);
  slider.addFocusListener(focusListener);
  slider.addComponentListener(componentListener);
  slider.addPropertyChangeListener(propertyChangeListener);
  slider.getModel().addChangeListener(changeListener);
}

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

protected void installListeners(JSlider slider) {
  slider.addMouseListener(trackListener);
  slider.addMouseMotionListener(trackListener);
  slider.addFocusListener(focusListener);
  slider.addComponentListener(componentListener);
  slider.addPropertyChangeListener(propertyChangeListener);
  slider.getModel().addChangeListener(changeListener);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

slider.addMouseMotionListener(m);

代码示例来源:origin: com.github.insubstantial/substance

brightnessSlider.addChangeListener(this);
brightnessSlider.addMouseWheelListener(this);
brightnessSlider.addMouseMotionListener(this);
brightnessSlider.setToolTipText(getLabel("Xoetrope.ctrlDrag",
    "CTRL+drag to adjust the color wheel"));
saturationSlider.addChangeListener(this);
saturationSlider.addMouseWheelListener(this);
saturationSlider.addMouseMotionListener(this);
saturationSlider.setToolTipText(getLabel("Xoetrope.ctrlDrag",
    "CTRL+drag to adjust the color wheel"));

代码示例来源:origin: org.java.net.substance/substance

brightnessSlider.addChangeListener(this);
brightnessSlider.addMouseWheelListener(this);
brightnessSlider.addMouseMotionListener(this);
brightnessSlider.setToolTipText(getLabel("Xoetrope.ctrlDrag",
    "CTRL+drag to adjust the color wheel"));
saturationSlider.addChangeListener(this);
saturationSlider.addMouseWheelListener(this);
saturationSlider.addMouseMotionListener(this);
saturationSlider.setToolTipText(getLabel("Xoetrope.ctrlDrag",
    "CTRL+drag to adjust the color wheel"));

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

slider.addMouseMotionListener(m);
slider.addMouseWheelListener(m);

代码示例来源:origin: org.java.net.substance/substance

@Override
protected void installListeners(final JSlider slider) {
  super.installListeners(slider);
  this.substanceRolloverListener = new RolloverControlListener(this,
      this.thumbModel);
  slider.addMouseListener(this.substanceRolloverListener);
  slider.addMouseMotionListener(this.substanceRolloverListener);
  this.substancePropertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent evt) {
      if ("enabled".equals(evt.getPropertyName())) {
        thumbModel.setEnabled(slider.isEnabled());
      }
      if ("font".equals(evt.getPropertyName())) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            slider.updateUI();
          }
        });
      }
    }
  };
  this.slider
      .addPropertyChangeListener(this.substancePropertyChangeListener);
  this.stateTransitionTracker.registerModelListeners();
  this.stateTransitionTracker.registerFocusListeners();
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
protected void installListeners(final JSlider slider) {
  super.installListeners(slider);
  this.substanceRolloverListener = new RolloverControlListener(this,
      this.thumbModel);
  slider.addMouseListener(this.substanceRolloverListener);
  slider.addMouseMotionListener(this.substanceRolloverListener);
  this.substancePropertyChangeListener = new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if ("enabled".equals(evt.getPropertyName())) {
        thumbModel.setEnabled(slider.isEnabled());
      }
      if ("font".equals(evt.getPropertyName())) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            slider.updateUI();
          }
        });
      }
    }
  };
  this.slider
      .addPropertyChangeListener(this.substancePropertyChangeListener);
  this.stateTransitionTracker.registerModelListeners();
  this.stateTransitionTracker.registerFocusListeners();
}

代码示例来源:origin: org.java.net.substance/substance

@Override
protected void installListeners(final JSlider slider) {
  super.installListeners(slider);
  // fix for defect 109 - memory leak on changing skin
  this.substanceRolloverListener = new RolloverControlListener(this,
      this.thumbModel);
  slider.addMouseListener(this.substanceRolloverListener);
  slider.addMouseMotionListener(this.substanceRolloverListener);
  this.substancePropertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent evt) {
      if ("enabled".equals(evt.getPropertyName())) {
        SubstanceSliderUI.this.thumbModel.setEnabled(slider
            .isEnabled());
      }
      if ("font".equals(evt.getPropertyName())) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            slider.updateUI();
          }
        });
      }
    }
  };
  this.slider
      .addPropertyChangeListener(this.substancePropertyChangeListener);
  this.stateTransitionTracker.registerModelListeners();
  this.stateTransitionTracker.registerFocusListeners();
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
protected void installListeners(final JSlider slider) {
  super.installListeners(slider);
  // fix for defect 109 - memory leak on changing skin
  this.substanceRolloverListener = new RolloverControlListener(this,
      this.thumbModel);
  slider.addMouseListener(this.substanceRolloverListener);
  slider.addMouseMotionListener(this.substanceRolloverListener);
  this.substancePropertyChangeListener = new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if ("enabled".equals(evt.getPropertyName())) {
        SubstanceSliderUI.this.thumbModel.setEnabled(slider
            .isEnabled());
      }
      if ("font".equals(evt.getPropertyName())) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            slider.updateUI();
          }
        });
      }
    }
  };
  this.slider
      .addPropertyChangeListener(this.substancePropertyChangeListener);
  this.stateTransitionTracker.registerModelListeners();
  this.stateTransitionTracker.registerFocusListeners();
}

相关文章

JSlider类方法