1 package org.wcb.gui.event;
2
3 import org.wcb.gui.LogbookFrame;
4 import org.wcb.gui.dialog.Faa8710Dialog;
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 import java.awt.*;
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 public class Faa8710DialogListener implements ActionListener {
42 private LogbookFrame frame;
43 private Faa8710Dialog dialog;
44
45 public Faa8710DialogListener(LogbookFrame frame) {
46 this.frame = frame;
47 dialog = new Faa8710Dialog();
48 dialog.addActionListener(this);
49 dialog.setMinimumSize(new Dimension(800,400));
50 }
51
52 public void actionPerformed(ActionEvent evt) {
53 Object src = evt.getSource();
54 if (src instanceof JMenuItem) {
55 dialog.refresh();
56 frame.showJDialogAsSheet(dialog);
57 }
58 if (evt.getActionCommand().equalsIgnoreCase(MessageResourceRegister.getInstance().getValue(MessageKey.BUTTON_CLOSE))) {
59 frame.hideSheet();
60 }
61 }
62 }