136
137 protected abstract Point getLocationOnScreen(Component com);
138
139 /**
140 * Returns the most specific, visible, heavyweight Component
141 * under the cursor. This method should return null iff the cursor is
142 * not over any Java Window.
143 *
144 * @param useCache If true, the implementation is free to use caching
145 * mechanisms because the Z-order, visibility, and enabled state of the
146 * Components has not changed. If false, the implementation should not
147 * make these assumptions.
148 */
149 protected abstract Component findHeavyweightUnderCursor(boolean useCache);
150
151 /**
152 * Updates the global cursor. We apply a three-step scheme to cursor
153 * updates:<p>
154 *
155 * (1) InputEvent updates which are outdated are discarded by
156 * <code>updateCursorImmediately(InputEvent)</code>.<p>
157 *
158 * (2) If 'useCache' is true, the native code is free to use a cached
159 * value to determine the most specific, visible, enabled heavyweight
160 * because this update is occurring in response to a mouse move. If
161 * 'useCache' is false, the native code must perform a new search given
162 * the current mouse coordinates.
163 *
164 * (3) Once we have determined the most specific, visible, enabled
165 * heavyweight, we use findComponentAt to find the most specific, visible,
166 * enabled Component.
167 */
168 private void _updateCursor(boolean useCache) {
169
170 synchronized (lastUpdateLock) {
171 lastUpdateMillis = System.currentTimeMillis();
172 }
173
174 Point queryPos = null, p = null;
175 Component comp;
176
|
136
137 protected abstract Point getLocationOnScreen(Component com);
138
139 /**
140 * Returns the most specific, visible, heavyweight Component
141 * under the cursor. This method should return null iff the cursor is
142 * not over any Java Window.
143 *
144 * @param useCache If true, the implementation is free to use caching
145 * mechanisms because the Z-order, visibility, and enabled state of the
146 * Components has not changed. If false, the implementation should not
147 * make these assumptions.
148 */
149 protected abstract Component findHeavyweightUnderCursor(boolean useCache);
150
151 /**
152 * Updates the global cursor. We apply a three-step scheme to cursor
153 * updates:<p>
154 *
155 * (1) InputEvent updates which are outdated are discarded by
156 * {@code updateCursorImmediately(InputEvent)}.<p>
157 *
158 * (2) If 'useCache' is true, the native code is free to use a cached
159 * value to determine the most specific, visible, enabled heavyweight
160 * because this update is occurring in response to a mouse move. If
161 * 'useCache' is false, the native code must perform a new search given
162 * the current mouse coordinates.
163 *
164 * (3) Once we have determined the most specific, visible, enabled
165 * heavyweight, we use findComponentAt to find the most specific, visible,
166 * enabled Component.
167 */
168 private void _updateCursor(boolean useCache) {
169
170 synchronized (lastUpdateLock) {
171 lastUpdateMillis = System.currentTimeMillis();
172 }
173
174 Point queryPos = null, p = null;
175 Component comp;
176
|