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

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

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

JSlider.isRequestFocusEnabled介绍

暂无

代码示例

代码示例来源:origin: igvteam/igv

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

代码示例来源:origin: org.gephi/ui-components

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

代码示例来源:origin: org.gephi/ui-components

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

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

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

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

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
@Override
public void mousePressed(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  if (slider.isRequestFocusEnabled()) {
    slider.requestFocus();
  }
  handle = getMouseHandle(e.getX(), e.getY());
  setMousePressed(handle);
  if (handle == MOUSE_HANDLE_MAX || handle == MOUSE_HANDLE_MIN || handle == MOUSE_HANDLE_MIDDLE || handle == MOUSE_HANDLE_BOTH) {
    handleOffset = (slider.getOrientation() == JSlider.VERTICAL) ?
        e.getY() - yPositionForValue(((RangeSlider) slider).getLowValue()) :
        e.getX() - xPositionForValue(((RangeSlider) slider).getLowValue());
    mouseStartLocation = (slider.getOrientation() == JSlider.VERTICAL) ? e.getY() : e.getX();
    slider.getModel().setValueIsAdjusting(true);
  }
  else if (handle == MOUSE_HANDLE_LOWER || handle == MOUSE_HANDLE_UPPER) {
    _listener.mousePressed(e);
    slider.putClientProperty(RangeSlider.CLIENT_PROPERTY_MOUSE_POSITION, null);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
@Override
public void mousePressed(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  if (slider.isRequestFocusEnabled()) {
    slider.requestFocus();
  }
  handle = getMouseHandle(e.getX(), e.getY());
  setMousePressed(handle);
  if (handle == MOUSE_HANDLE_MAX || handle == MOUSE_HANDLE_MIN || handle == MOUSE_HANDLE_MIDDLE) {
    handleOffset = (slider.getOrientation() == JSlider.VERTICAL) ?
        e.getY() - yPositionForValue(((RangeSlider) slider).getLowValue()) :
        e.getX() - xPositionForValue(((RangeSlider) slider).getLowValue());
    mouseStartLocation = (slider.getOrientation() == JSlider.VERTICAL) ? e.getY() : e.getX();
    slider.getModel().setValueIsAdjusting(true);
  }
  else if (handle == MOUSE_HANDLE_LOWER || handle == MOUSE_HANDLE_UPPER) {
    _listener.mousePressed(e);
    slider.putClientProperty(RangeSlider.CLIENT_PROPERTY_MOUSE_POSITION, null);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
@Override
public void mousePressed(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  if (slider.isRequestFocusEnabled()) {
    slider.requestFocus();
  }
  handle = getMouseHandle(e.getX(), e.getY());
  setMousePressed(handle);
  if (handle == MOUSE_HANDLE_MAX || handle == MOUSE_HANDLE_MIN || handle == MOUSE_HANDLE_MIDDLE || handle == MOUSE_HANDLE_BOTH) {
    handleOffset = (slider.getOrientation() == JSlider.VERTICAL) ?
        e.getY() - yPositionForValue(((RangeSlider) slider).getLowValue()) :
        e.getX() - xPositionForValue(((RangeSlider) slider).getLowValue());
    mouseStartLocation = (slider.getOrientation() == JSlider.VERTICAL) ? e.getY() : e.getX();
    slider.getModel().setValueIsAdjusting(true);
  }
  else if (handle == MOUSE_HANDLE_LOWER || handle == MOUSE_HANDLE_UPPER) {
    _listener.mousePressed(e);
    slider.putClientProperty(RangeSlider.CLIENT_PROPERTY_MOUSE_POSITION, null);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
@Override
public void mousePressed(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  if (slider.isRequestFocusEnabled()) {
    slider.requestFocus();
  }
  handle = getMouseHandle(e.getX(), e.getY());
  setMousePressed(handle);
  if (handle == MOUSE_HANDLE_MAX || handle == MOUSE_HANDLE_MIN || handle == MOUSE_HANDLE_MIDDLE || handle == MOUSE_HANDLE_BOTH) {
    handleOffset = (slider.getOrientation() == JSlider.VERTICAL) ?
        e.getY() - yPositionForValue(((RangeSlider) slider).getLowValue()) :
        e.getX() - xPositionForValue(((RangeSlider) slider).getLowValue());
    mouseStartLocation = (slider.getOrientation() == JSlider.VERTICAL) ? e.getY() : e.getX();
    slider.getModel().setValueIsAdjusting(true);
  }
  else if (handle == MOUSE_HANDLE_LOWER || handle == MOUSE_HANDLE_UPPER) {
    _listener.mousePressed(e);
    slider.putClientProperty(RangeSlider.CLIENT_PROPERTY_MOUSE_POSITION, null);
  }
}

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

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

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

currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
  slider.requestFocus();

相关文章

JSlider类方法