blob: 3520f2a1b9871ef718f58f71a8b688570eec48fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
package uk.org.ury.frontend.modules.menu;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import uk.org.ury.frontend.FrontendMaster;
import uk.org.ury.frontend.FrontendModulePanel;
import uk.org.ury.frontend.exceptions.LoadFailureException;
public class DemoMenuPanel extends FrontendModulePanel {
/**
*
*/
private static final long serialVersionUID = 5268978856289909262L;
/**
* Construct a new DemoMenuPanel.
*
* @param inMaster
* The new frontend master of the panel, if any.
*/
public DemoMenuPanel(FrontendMaster inMaster) {
super(null, inMaster);
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) {
try {
master.loadModule("library.LibraryViewer",
"menu.DemoControlPanel");
} catch (LoadFailureException e) {
master.fatalError(e.getMessage());
}
}
});
sb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
try {
master.loadModule("show.ShowViewer",
"menu.DemoControlPanel");
} catch (LoadFailureException e) {
master.fatalError(e.getMessage());
}
}
});
add(lb);
add(sb);
}
/**
* @return the name of the module.
*/
@Override
public String getModuleName() {
return "Demo Menu";
}
}
|