1 package org.wcb.gui.event;
2
3 import org.wcb.gui.LogbookFrame;
4 import org.wcb.gui.dialog.AboutDialog;
5 import org.wcb.resources.MessageResourceRegister;
6 import org.wcb.resources.MessageKey;
7
8 import javax.swing.*;
9 import java.awt.event.ActionListener;
10 import java.awt.event.ActionEvent;
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public class AboutListener implements ActionListener {
32
33 private LogbookFrame frame;
34 private AboutDialog dialog;
35
36 public AboutListener(LogbookFrame frame) {
37 this.frame = frame;
38 dialog = new AboutDialog();
39 dialog.addActionListener(this);
40 }
41
42 public void actionPerformed(ActionEvent evt) {
43 Object src = evt.getSource();
44 if (src instanceof JMenuItem) {
45 frame.showJDialogAsSheet(dialog);
46 }
47 if (evt.getActionCommand().equalsIgnoreCase(MessageResourceRegister.getInstance().getValue(MessageKey.BUTTON_CLOSE))) {
48 frame.hideSheet();
49 }
50 }
51 }