KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > MenuShortcut


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4  
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7  
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9  
10    $Log: MenuShortcut.java,v $
11    Revision 1.2 2004/04/21 07:10:46 bobintetley
12    Fixes to native build script and a few code tweaks. Removal of AWT
13    native lib for compilation purposes.
14
15
16  */

17
18 package swingwt.awt;
19
20 public class MenuShortcut {
21
22     protected int key = 0;
23     protected boolean useShiftModifier = false;
24     
25     public MenuShortcut(int key) {
26         this(key, false);
27     }
28     
29     public MenuShortcut(int key, boolean useShiftModifier) {
30         this.key = key;
31         this.useShiftModifier = useShiftModifier;
32     }
33     
34     public boolean equals(MenuShortcut s) {
35         return (s.getKey() == key && useShiftModifier == s.usesShiftModifier());
36     }
37     
38     public boolean usesShiftModifier() { return useShiftModifier; }
39     public int getKey() { return key; }
40     
41 }
42
Popular Tags