/Users/lyon/j4p/src/ip/gui/frames/ShortCutFrame.java
|
1 package ip.gui.frames;
2
3 import gui.PetriBean;
4
5 import java.awt.*;
6 import java.awt.event.ActionEvent;
7 import java.awt.event.KeyEvent;
8
9 /**
10 *
11 */
12
13 public class ShortCutFrame
14 extends ClosableFrame
15 implements ShortCutInterface {
16
17
18 private PetriBean petriBean = new PetriBean(this);
19
20
21 public ShortCutFrame(String title) {
22 super(title);
23 addKeyListener(this);
24 }
25
26 public ShortCutFrame() {
27 addKeyListener(this);
28 }
29
30 public String getPs() {
31 return petriBean.getPs();
32 }
33
34
35 public boolean match(AWTEvent e, MenuItem mi) {
36 return petriBean.matchEvent(e, mi);
37 }
38
39
40 public void keyPressed(KeyEvent e) {
41 petriBean.processEvent(e);
42 }
43
44
45 public void keyReleased(KeyEvent e) {
46 }
47
48
49 public void actionPerformed(ActionEvent e) {
50 }
51
52
53 public void keyTyped(KeyEvent e) {
54 }
55
56 public Menu getMenu(String s) {
57 return new Menu(s);
58 }
59
60 public MenuItem addMenuItem(Menu aMenu, String itemName) {
61 MenuItem mi = new MenuItem(itemName);
62 aMenu.add(mi);
63 mi.addActionListener(this);
64 return (mi);
65 }
66 }
67