下面列出了java.awt.ScrollPane#getVAdjustable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}
public static Adjustable getAdjustableToScroll(ScrollPane sp) {
int policy = sp.getScrollbarDisplayPolicy();
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
}
else {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
}
}
}