182 }
183 }
184
185 /*
186 * Runnable for the ScrollEvent that performs the adjustment.
187 */
188 class Adjustor implements Runnable {
189 int orient; // selects scrollbar
190 int type; // adjustment type
191 int pos; // new position (only used for absolute)
192 boolean isAdjusting; // isAdjusting status
193
194 Adjustor(int orient, int type, int pos, boolean isAdjusting) {
195 this.orient = orient;
196 this.type = type;
197 this.pos = pos;
198 this.isAdjusting = isAdjusting;
199 }
200
201 @Override
202 public void run() {
203 if (getScrollChild() == null) {
204 return;
205 }
206 ScrollPane sp = (ScrollPane)WScrollPanePeer.this.target;
207 ScrollPaneAdjustable adj = null;
208
209 // ScrollPaneAdjustable made public in 1.4, but
210 // get[HV]Adjustable can't be declared to return
211 // ScrollPaneAdjustable because it would break backward
212 // compatibility -- hence the cast
213
214 if (orient == Adjustable.VERTICAL) {
215 adj = (ScrollPaneAdjustable)sp.getVAdjustable();
216 } else if (orient == Adjustable.HORIZONTAL) {
217 adj = (ScrollPaneAdjustable)sp.getHAdjustable();
218 } else {
219 if (log.isLoggable(PlatformLogger.Level.FINE)) {
220 log.fine("Assertion failed: unknown orient");
221 }
|
182 }
183 }
184
185 /*
186 * Runnable for the ScrollEvent that performs the adjustment.
187 */
188 class Adjustor implements Runnable {
189 int orient; // selects scrollbar
190 int type; // adjustment type
191 int pos; // new position (only used for absolute)
192 boolean isAdjusting; // isAdjusting status
193
194 Adjustor(int orient, int type, int pos, boolean isAdjusting) {
195 this.orient = orient;
196 this.type = type;
197 this.pos = pos;
198 this.isAdjusting = isAdjusting;
199 }
200
201 @Override
202 @SuppressWarnings("deprecation")
203 public void run() {
204 if (getScrollChild() == null) {
205 return;
206 }
207 ScrollPane sp = (ScrollPane)WScrollPanePeer.this.target;
208 ScrollPaneAdjustable adj = null;
209
210 // ScrollPaneAdjustable made public in 1.4, but
211 // get[HV]Adjustable can't be declared to return
212 // ScrollPaneAdjustable because it would break backward
213 // compatibility -- hence the cast
214
215 if (orient == Adjustable.VERTICAL) {
216 adj = (ScrollPaneAdjustable)sp.getVAdjustable();
217 } else if (orient == Adjustable.HORIZONTAL) {
218 adj = (ScrollPaneAdjustable)sp.getHAdjustable();
219 } else {
220 if (log.isLoggable(PlatformLogger.Level.FINE)) {
221 log.fine("Assertion failed: unknown orient");
222 }
|