aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/testrig/DemoMenu.java
diff options
context:
space:
mode:
authorMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
committerMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
commitd547f87da5f68c12dede7c9d45618cae11ff5699 (patch)
tree613aa95d94b363c72ba9a7be639c74f76edf81f8 /src/uk/org/ury/testrig/DemoMenu.java
parentc8bb324e757587e742df0824304144e1eb881cee (diff)
Mega-commit to the rescue! Added Javadoc snapshot (admittedly old); show UI now fixed-layout; UI uses system selection colours for accents; now uses bapsserver password and can thus talk to show database relations; removed member relation dependencies until further notice; attempted to get application and applet launchers working but having issues with the latter; started working on a server communicating via a minimal implementation of HTTP 1.1 (standardisation required eventually).
Diffstat (limited to 'src/uk/org/ury/testrig/DemoMenu.java')
-rw-r--r--src/uk/org/ury/testrig/DemoMenu.java100
1 files changed, 26 insertions, 74 deletions
diff --git a/src/uk/org/ury/testrig/DemoMenu.java b/src/uk/org/ury/testrig/DemoMenu.java
index bc4636b..19e68d9 100644
--- a/src/uk/org/ury/testrig/DemoMenu.java
+++ b/src/uk/org/ury/testrig/DemoMenu.java
@@ -1,13 +1,9 @@
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.AbstractFrontendModule;
+import uk.org.ury.frontend.FrontendMaster;
import uk.org.ury.frontend.FrontendModulePanel;
+import uk.org.ury.frontend.exceptions.LoadFailureException;
/**
@@ -17,23 +13,13 @@ import uk.org.ury.frontend.FrontendModulePanel;
*
*/
-public class DemoMenu
+public class DemoMenu extends AbstractFrontendModule
{
- 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 ();
- }
+ private static final long serialVersionUID = -5264235507636809476L;
+ private FrontendMaster master;
/**
@@ -43,70 +29,36 @@ public class DemoMenu
public void
loadModule (String module)
{
- frame.loadModule (module, "testrig.DemoControlPanel");
+ try
+ {
+ master.loadModule (module, "testrig.DemoControlPanel");
+ }
+ catch (LoadFailureException e)
+ {
+ master.fatalError (e.getMessage ());
+ }
}
+
/**
* 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);
- }
+
+ /**
+ * Run the demo menu in frontend mode.
+ */
-
- /**
- * @return the name of the module.
- */
-
- @Override
- public String
- getName ()
- {
- return "Demo Menu";
- }
- };
-
-
- frame = new FrontendFrame (panel);
+ @Override
+ public FrontendModulePanel
+ runFrontend (FrontendMaster master)
+ {
+ return new DemoMenuPanel (master);
}
}