1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 import java.awt.event.KeyEvent;
13 /* Status: Complete, except for hashCode(). Untested. */
15 public class MenuShortcut implements java.io.Serializable
17 // Fields from the serialization spec. Decalare others "transient".
21 public MenuShortcut(int key)
26 public MenuShortcut(int key, boolean useShiftModifier)
29 this.usesShift = useShiftModifier;
37 public boolean usesShiftModifier()
42 public boolean equals(MenuShortcut ms)
44 return (ms.key == key && ms.usesShift == usesShift);
47 public boolean equals(Object obj)
49 if (obj instanceof MenuShortcut)
51 MenuShortcut ms = (MenuShortcut) obj;
52 return (ms.key == key && ms.usesShift == usesShift);
59 // FIXME: find/implement the correct algorithm for this
66 public String toString()
68 return paramString(); // ?
71 protected String paramString()
73 return KeyEvent.getKeyText(key);