本文整理了Java中org.eclipse.swt.widgets.ScrollBar.getThumbTrackBounds()
方法的一些代码示例,展示了ScrollBar.getThumbTrackBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollBar.getThumbTrackBounds()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ScrollBar
类名称:ScrollBar
方法名:getThumbTrackBounds
[英]Returns a rectangle describing the size and location of the receiver's thumb track relative to its parent. This rectangle comprises the areas 2, 3, and 4 as described in ScrollBar.
[中]返回一个矩形,描述接收器拇指轨迹相对于其父轨迹的大小和位置。该矩形包括滚动条中描述的区域2、3和4。
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Computes the arrow heights of the vertical scroll bar.
*
* @param textWidget the StyledText
* @param bottomOffset y-coordinate of the bottom of the overview ruler area
* @return an array containing {topArrowHeight, bottomArrowHeight}
*
* @since 3.6
*/
private int[] computeScrollArrowHeights(StyledText textWidget, int bottomOffset) {
ScrollBar verticalBar= textWidget.getVerticalBar();
Rectangle thumbTrackBounds= verticalBar.getThumbTrackBounds();
if (thumbTrackBounds.height == 0) {
// SWT returns bogus values on Cocoa in this case, see https://bugs.eclipse.org/352990
// SWT returns bogus values on Windows when the control is too small, see https://bugs.eclipse.org/485540
return new int[] { 0, 0 };
}
int topArrowHeight= thumbTrackBounds.y;
int bottomArrowHeight= bottomOffset - (thumbTrackBounds.y + thumbTrackBounds.height);
return new int[] { topArrowHeight, bottomArrowHeight };
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Computes the arrow heights of the vertical scroll bar.
*
* @param textWidget the StyledText
* @param bottomOffset y-coordinate of the bottom of the overview ruler area
* @return an array containing {topArrowHeight, bottomArrowHeight}
*
* @since 3.6
*/
private int[] computeScrollArrowHeights(StyledText textWidget, int bottomOffset) {
ScrollBar verticalBar= textWidget.getVerticalBar();
Rectangle thumbTrackBounds= verticalBar.getThumbTrackBounds();
if (thumbTrackBounds.height == 0) {
// SWT returns bogus values on Cocoa in this case, see https://bugs.eclipse.org/352990
// SWT returns bogus values on Windows when the control is too small, see https://bugs.eclipse.org/485540
return new int[] { 0, 0 };
}
int topArrowHeight= thumbTrackBounds.y;
int bottomArrowHeight= bottomOffset - (thumbTrackBounds.y + thumbTrackBounds.height);
return new int[] { topArrowHeight, bottomArrowHeight };
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
width -= c.getVerticalBar().getThumbTrackBounds().width;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
width -= c.getVerticalBar().getThumbTrackBounds().width;
内容来源于网络,如有侵权,请联系作者删除!