本文整理汇总了Java中javax.swing.JSlider.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java JSlider.VERTICAL属性的具体用法?Java JSlider.VERTICAL怎么用?Java JSlider.VERTICAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.JSlider
的用法示例。
在下文中一共展示了JSlider.VERTICAL属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClickPoint
private Point getClickPoint(ComponentOperator oper, int direction, int orientation) {
int x, y;
boolean inverted = ((JSliderOperator) oper).getInverted();
int realDirection = ScrollAdjuster.DO_NOT_TOUCH_SCROLL_DIRECTION;
if (inverted) {
if (direction == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
realDirection = ScrollAdjuster.DECREASE_SCROLL_DIRECTION;
} else if (direction == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
realDirection = ScrollAdjuster.INCREASE_SCROLL_DIRECTION;
} else {
return null;
}
} else {
realDirection = direction;
}
if (orientation == JSlider.HORIZONTAL) {
if (realDirection == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
x = oper.getWidth() - 1;
} else if (realDirection == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
x = 0;
} else {
return null;
}
y = oper.getHeight() / 2;
} else if (orientation == JSlider.VERTICAL) {
if (realDirection == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
y = 0;
} else if (realDirection == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
y = oper.getHeight() - 1;
} else {
return null;
}
x = oper.getWidth() / 2;
} else {
return null;
}
return new Point(x, y);
}