MCPcopy Index your code
hub / github.com/processing/processing / handle

Method handle

core/src/processing/javafx/PSurfaceFX.java:86–112  ·  view source on GitHub ↗
(ActionEvent event)

Source from the content-addressed store, hash-verified

84 KeyFrame keyFrame = new KeyFrame(Duration.millis(1000),
85 new EventHandler<ActionEvent>() {
86 public void handle(ActionEvent event) {
87 long startNanoTime = System.nanoTime();
88 try {
89 sketch.handleDraw();
90 } catch (Throwable e) {
91 // Let exception handler thread crash with our exception
92 drawExceptionQueue.offer(e);
93 // Stop animating right now so nothing runs afterwards
94 // and crash frame can be for example traced by println()
95 animation.stop();
96 return;
97 }
98 long drawNanos = System.nanoTime() - startNanoTime;
99
100 if (sketch.exitCalled()) {
101 // using Platform.runLater() didn't work
102// Platform.runLater(new Runnable() {
103// public void run() {
104 // instead of System.exit(), safely shut down JavaFX this way
105 Platform.exit();
106// }
107// });
108 }
109 if (sketch.frameCount > 5) {
110 animation.setRate(-PApplet.min(1e9f / drawNanos, frameRate));
111 }
112 }
113 });
114 animation = new Timeline(keyFrame);
115 animation.setCycleCount(Animation.INDEFINITE);

Callers

nothing calls this directly

Calls 5

minMethod · 0.95
handleDrawMethod · 0.80
exitCalledMethod · 0.80
exitMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected