本文整理了Java中javax.swing.JSlider.requestFocus()
方法的一些代码示例,展示了JSlider.requestFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.requestFocus()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:requestFocus
暂无
代码示例来源:origin: igvteam/igv
slider.requestFocus();
代码示例来源:origin: org.gephi/ui-components
slider.requestFocus();
代码示例来源:origin: org.gephi/ui-components
slider.requestFocus();
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
slider.requestFocus();
代码示例来源:origin: org.java.net.substance/substance
slider.requestFocus();
代码示例来源:origin: com.github.insubstantial/substance
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
slider.requestFocus();
代码示例来源:origin: com.synaptix/SynaptixSwing
slider.requestFocus();
内容来源于网络,如有侵权,请联系作者删除!