MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / scheduleScrolling

Method scheduleScrolling

src/org/albite/albite/BookCanvas.java:1332–1383  ·  view source on GitHub ↗
(final int scrollMode)

Source from the content-addressed store, hash-verified

1330 }
1331
1332 private void scheduleScrolling(final int scrollMode) {
1333 /*
1334 * Invalidate holding time. It's important for the situtations when
1335 * the canvas can't respond to pointerReleased eventes (e.g. when
1336 * loading pictures) and it may interpret the time wrongly.
1337 */
1338 holdingValid = false;
1339
1340 if (scrollingTimerTask == null) {
1341 scrollingTimerTask = new TimerTask() {
1342 private int dx;
1343 private boolean fullPage;
1344
1345 public void run() {
1346 switch(scrollMode) {
1347 case SCROLL_PREV:
1348 dx = scrollNextPagePixels;
1349 fullPage = true;
1350 break;
1351 case SCROLL_NEXT:
1352 dx = -scrollNextPagePixels;
1353 fullPage = true;
1354 break;
1355 case SCROLL_SAME_NEXT:
1356 dx = scrollSamePagePixels;
1357 fullPage = false;
1358 break;
1359 case SCROLL_SAME_PREV:
1360 dx = -scrollSamePagePixels;
1361 fullPage = false;
1362 break;
1363 case SCROLL_BOOK_END:
1364 dx = scrollStartBookPixels;
1365 fullPage = false;
1366 break;
1367 case SCROLL_BOOK_START:
1368 dx = -scrollStartBookPixels;
1369 fullPage = false;
1370 break;
1371 default:
1372 dx = 0;
1373 fullPage = false;
1374 break;
1375 }
1376
1377 scrollPages(dx, fullPage);
1378 }
1379 };
1380
1381 timer.schedule(scrollingTimerTask, frameTime, frameTime);
1382 }
1383 }
1384
1385 private synchronized void stopScrolling() {
1386 if (scrollingTimerTask != null) {

Callers 3

processKeysMethod · 0.95
handleDummyPageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected