ScrollPaneWheelScroller.java revision 1696
3563N/A * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. 3563N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3563N/A * This code is free software; you can redistribute it and/or modify it 3563N/A * under the terms of the GNU General Public License version 2 only, as 3563N/A * published by the Free Software Foundation. Sun designates this 3563N/A * particular file as subject to the "Classpath" exception as provided 3563N/A * by Sun in the LICENSE file that accompanied this code. 3563N/A * This code is distributed in the hope that it will be useful, but WITHOUT 3563N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3563N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3563N/A * version 2 for more details (a copy is included in the LICENSE file that 3563N/A * You should have received a copy of the GNU General Public License version 3563N/A * 2 along with this work; if not, write to the Free Software Foundation, 3563N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3563N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 3563N/A * CA 95054 USA or visit www.sun.com if you need additional information or 3563N/A * ScrollPaneWheelScroller is a helper class for implmenenting mouse wheel 3563N/A * scrolling on a java.awt.ScrollPane. It contains only static methods. 3563N/A * No objects of this class may be instantiated, thus it is declared abstract. 3563N/A * Called from ScrollPane.processMouseWheelEvent() * Given a ScrollPane, determine which Scrollbar should be scrolled by the // if policy is display always or never, use vert log.
finer(
"using vertical scrolling due to scrollbar policy");
// Check if scrollbar is showing by examining insets of the log.
finer(
"using vertical scrolling because scrollbar is present");
log.
finer(
"using horiz scrolling because scrollbar is present");
log.
finer(
"using NO scrollbar becsause neither is present");
* Given the info in a MouseWheelEvent and an Adjustable to scroll, return * the amount by which the Adjustable should be adjusted. This value may * be positive or negative. log.
fine(
"Assertion (adj != null) failed");
* Scroll the given Adjustable by the given amount. Checks the Adjustable's * bounds and sets the new value to the Adjustable. log.
fine(
"Assertion (adj != null) failed");
log.
fine(
"Assertion (amount != 0) failed");