source: trunk/src_apollo/org/apollo/actions/ApolloActions.java@ 363

Last change on this file since 363 was 363, checked in by bjn8, 16 years ago

Lots of flaws in threading fixed. Several bad states gone - playback more interactive now

File size: 1.7 KB
Line 
1package org.apollo.actions;
2
3import org.apollo.items.FramePlaybackLauncher;
4import org.apollo.widgets.LinkedTrack;
5import org.apollo.widgets.SampleRecorder;
6import org.expeditee.gui.DisplayIO;
7import org.expeditee.gui.Frame;
8import org.expeditee.gui.FrameMouseActions;
9import org.expeditee.items.Text;
10
11/**
12 * Apollo's action set
13 *
14 * @author Brook Novak
15 *
16 */
17public 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}
Note: See TracBrowser for help on using the repository browser.