1 /*
2 * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
147 // do nothing. in this case we return null
148 }
149 return child;
150 }
151
152 /*
153 * Called from Windows in response to WM_VSCROLL/WM_HSCROLL message
154 */
155 private void postScrollEvent(int orient, int type,
156 int pos, boolean isAdjusting)
157 {
158 Runnable adjustor = new Adjustor(orient, type, pos, isAdjusting);
159 WToolkit.executeOnEventHandlerThread(new ScrollEvent(target, adjustor));
160 }
161
162 /*
163 * Event that executes on the Java dispatch thread to move the
164 * scroll bar thumbs and paint the exposed area in one synchronous
165 * operation.
166 */
167 class ScrollEvent extends PeerEvent {
168 ScrollEvent(Object source, Runnable runnable) {
169 super(source, runnable, 0L);
170 }
171
172 @Override
173 public PeerEvent coalesceEvents(PeerEvent newEvent) {
174 if (log.isLoggable(PlatformLogger.Level.FINEST)) {
175 log.finest("ScrollEvent coalesced: " + newEvent);
176 }
177 if (newEvent instanceof ScrollEvent) {
178 return newEvent;
179 }
180 return null;
181 }
182 }
183
184 /*
185 * Runnable for the ScrollEvent that performs the adjustment.
186 */
|
1 h/*
2 * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
147 // do nothing. in this case we return null
148 }
149 return child;
150 }
151
152 /*
153 * Called from Windows in response to WM_VSCROLL/WM_HSCROLL message
154 */
155 private void postScrollEvent(int orient, int type,
156 int pos, boolean isAdjusting)
157 {
158 Runnable adjustor = new Adjustor(orient, type, pos, isAdjusting);
159 WToolkit.executeOnEventHandlerThread(new ScrollEvent(target, adjustor));
160 }
161
162 /*
163 * Event that executes on the Java dispatch thread to move the
164 * scroll bar thumbs and paint the exposed area in one synchronous
165 * operation.
166 */
167 @SuppressWarnings("serial") // JDK-implementation class
168 class ScrollEvent extends PeerEvent {
169 ScrollEvent(Object source, Runnable runnable) {
170 super(source, runnable, 0L);
171 }
172
173 @Override
174 public PeerEvent coalesceEvents(PeerEvent newEvent) {
175 if (log.isLoggable(PlatformLogger.Level.FINEST)) {
176 log.finest("ScrollEvent coalesced: " + newEvent);
177 }
178 if (newEvent instanceof ScrollEvent) {
179 return newEvent;
180 }
181 return null;
182 }
183 }
184
185 /*
186 * Runnable for the ScrollEvent that performs the adjustment.
187 */
|