From 9b4647f1ae8c3f41163d0d4053504dab861d0c94 Mon Sep 17 00:00:00 2001 From: Matt Windsor Date: Mon, 7 Mar 2011 13:50:24 +0000 Subject: 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. --- src/uk/org/ury/testrig/DemoMenu.java | 112 +++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/uk/org/ury/testrig/DemoMenu.java (limited to 'src/uk/org/ury/testrig/DemoMenu.java') 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); + } +} -- cgit v1.2.3