Last change
on this file since 1102 was 1102, checked in by davidb, 6 years ago |
Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING
|
File size:
1.4 KB
|
Line | |
---|
1 | package org.apollo.util;
|
---|
2 |
|
---|
3 | import java.io.BufferedReader;
|
---|
4 | import java.io.IOException;
|
---|
5 | import java.io.InputStreamReader;
|
---|
6 |
|
---|
7 | import org.apollo.audio.util.Timeline;
|
---|
8 | import org.apollo.gui.FrameLayoutDaemon;
|
---|
9 | import org.expeditee.gui.DisplayController;
|
---|
10 |
|
---|
11 | public class ProbeDaemon extends Thread {
|
---|
12 | public ProbeDaemon() {
|
---|
13 | super("ProbeDaemon");
|
---|
14 | super.setDaemon(true);
|
---|
15 | }
|
---|
16 |
|
---|
17 | public void run() {
|
---|
18 |
|
---|
19 | System.err.println("APOLLO PROBE DAEMON RUNNING - THIS IS NOT AN ERROR BUT DON'T FORGET TO REMOVE ME :)");
|
---|
20 |
|
---|
21 | BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
|
---|
22 |
|
---|
23 |
|
---|
24 | while (true) {
|
---|
25 |
|
---|
26 | try {
|
---|
27 | String line = rd.readLine();
|
---|
28 | if (line != null) {
|
---|
29 | procccessMessage(line);
|
---|
30 | }
|
---|
31 | } catch (IOException e) {
|
---|
32 | e.printStackTrace();
|
---|
33 | }
|
---|
34 |
|
---|
35 | }
|
---|
36 |
|
---|
37 | }
|
---|
38 |
|
---|
39 | private void procccessMessage(String message) {
|
---|
40 |
|
---|
41 | assert(message != null);
|
---|
42 |
|
---|
43 | String output = "";
|
---|
44 |
|
---|
45 | if (message.equalsIgnoreCase("tl") || message.equalsIgnoreCase("timeline")) {
|
---|
46 | String timeline = "none";
|
---|
47 | Timeline tl = FrameLayoutDaemon.getInstance().getLastComputedTimeline();
|
---|
48 | if (tl != null && DisplayController.getCurrentFrame() == FrameLayoutDaemon.getInstance().getTimelineOwner()) {
|
---|
49 | timeline = tl.toString();
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 | output = "Current timeline: " + timeline;
|
---|
54 |
|
---|
55 |
|
---|
56 | } else {
|
---|
57 | output = "I don't understand \"" + message + "\"";
|
---|
58 | }
|
---|
59 |
|
---|
60 | System.out.println("ProbeDaemon: " + output);
|
---|
61 |
|
---|
62 | }
|
---|
63 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.