1 | package org.apollo.actions;
|
---|
2 |
|
---|
3 | import org.apollo.items.FramePlaybackLauncher;
|
---|
4 | import org.apollo.widgets.LinkedTrack;
|
---|
5 | import org.apollo.widgets.SampleRecorder;
|
---|
6 | import org.expeditee.gui.DisplayIO;
|
---|
7 | import org.expeditee.gui.Frame;
|
---|
8 | import org.expeditee.gui.FrameMouseActions;
|
---|
9 | import org.expeditee.items.Text;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Apollo's action set
|
---|
13 | *
|
---|
14 | * @author Brook Novak
|
---|
15 | *
|
---|
16 | */
|
---|
17 | public class ApolloActions {
|
---|
18 |
|
---|
19 | private ApolloActions() {} // Util construction
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Attatches a new recorder to the cursor
|
---|
23 | */
|
---|
24 | public static void spawnRecorder() {
|
---|
25 |
|
---|
26 | Frame target = DisplayIO.getCurrentFrame();
|
---|
27 | if (target == null) return;
|
---|
28 |
|
---|
29 | // Create the widget
|
---|
30 | Text source = new Text(target.getNextItemID());
|
---|
31 | source.setParent(target);
|
---|
32 | source.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY);
|
---|
33 | SampleRecorder recWidget = new SampleRecorder(source, null);
|
---|
34 |
|
---|
35 | // Pick it up
|
---|
36 | FrameMouseActions.pickup(recWidget.getItems());
|
---|
37 | }
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Attatches a new linked track to the cursor
|
---|
41 | */
|
---|
42 | public static void spawnLinkedTrack() {
|
---|
43 |
|
---|
44 | Frame target = DisplayIO.getCurrentFrame();
|
---|
45 | if (target == null) return;
|
---|
46 |
|
---|
47 | // Create the widget
|
---|
48 | Text source = new Text(target.getNextItemID());
|
---|
49 | source.setParent(target);
|
---|
50 | source.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY);
|
---|
51 |
|
---|
52 | LinkedTrack ltWidget = new LinkedTrack(source, null);
|
---|
53 |
|
---|
54 | // Pick it up
|
---|
55 | FrameMouseActions.pickup(ltWidget.getItems());
|
---|
56 | }
|
---|
57 |
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Attatches a new FramePlaybackLauncher to the cursor
|
---|
61 | */
|
---|
62 | public static void spawnFramePlayLauncher() {
|
---|
63 |
|
---|
64 | // Create the launcher
|
---|
65 | FramePlaybackLauncher launcher = new FramePlaybackLauncher(null);
|
---|
66 | launcher.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY);
|
---|
67 |
|
---|
68 | // Pick it up
|
---|
69 | FrameMouseActions.pickup(launcher);
|
---|
70 | }
|
---|
71 |
|
---|
72 | }
|
---|