aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/testrig/DemoMenu.java
diff options
context:
space:
mode:
authorMatt Windsor <mbw500@student.cs.york.ac.uk>2011-03-07 13:50:24 +0000
committerMatt Windsor <mbw500@student.cs.york.ac.uk>2011-03-07 13:50:24 +0000
commit9b4647f1ae8c3f41163d0d4053504dab861d0c94 (patch)
treeb621e8c0b75a5cadd69f938116b1637f7ad0c94d /src/uk/org/ury/testrig/DemoMenu.java
parentc33f098de8a43a2df778d4d694e0c07bbde59828 (diff)
Emergency impending hard drive failure dump - lots of changes on the frontend, but they're all potentially controversial so I'm not pushing to master yet. Beginnings of show viewer. Application now run through demo menu, which allows for the links between modules to be tested.
Diffstat (limited to 'src/uk/org/ury/testrig/DemoMenu.java')
-rw-r--r--src/uk/org/ury/testrig/DemoMenu.java112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/uk/org/ury/testrig/DemoMenu.java b/src/uk/org/ury/testrig/DemoMenu.java
new file mode 100644
index 0000000..bc4636b
--- /dev/null
+++ b/src/uk/org/ury/testrig/DemoMenu.java
@@ -0,0 +1,112 @@
+package uk.org.ury.testrig;
+
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+
+import uk.org.ury.frontend.FrontendFrame;
+import uk.org.ury.frontend.FrontendModulePanel;
+
+
+/**
+ * Application frontend, for testing early-stage frontend code.
+ *
+ * @author Matt Windsor
+ *
+ */
+
+public class DemoMenu
+{
+ private FrontendFrame frame;
+
+ /**
+ * Main method.
+ *
+ * @param args The command-line arguments to the program. These
+ * will be ignored.
+ */
+
+ public static void
+ main (String[] args)
+ {
+ DemoMenu dm = new DemoMenu ();
+ dm.run ();
+ }
+
+
+ /**
+ *
+ */
+
+ public void
+ loadModule (String module)
+ {
+ frame.loadModule (module, "testrig.DemoControlPanel");
+ }
+
+ /**
+ * Run the demo menu, creating a user interface.
+ */
+
+ public void
+ run ()
+ {
+ FrontendModulePanel panel = new FrontendModulePanel (null, frame)
+ {
+ private static final long serialVersionUID = 1L;
+
+ {
+ setLayout (new GridLayout (2, 1));
+
+ JButton lb = new JButton ("Library Viewer Demo");
+ JButton sb = new JButton ("Show Viewer Demo");
+
+ lb.addActionListener (new ActionListener ()
+ {
+
+ @Override
+ public void
+ actionPerformed (ActionEvent arg0)
+ {
+ loadModule ("library.viewer.LibraryViewer");
+ }
+
+ });
+
+
+ sb.addActionListener (new ActionListener ()
+ {
+
+ @Override
+ public void
+ actionPerformed (ActionEvent arg0)
+ {
+ loadModule ("show.viewer.ShowViewer");
+ }
+
+ });
+
+
+ add (lb);
+ add (sb);
+ }
+
+
+ /**
+ * @return the name of the module.
+ */
+
+ @Override
+ public String
+ getName ()
+ {
+ return "Demo Menu";
+ }
+ };
+
+
+ frame = new FrontendFrame (panel);
+ }
+}