|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.MenuShortcut
public class MenuShortcut
This class implements a keyboard accelerator for a menu item.
| Constructor Summary | |
|---|---|
MenuShortcut(int key)
Initializes a new instance of MenuShortcut with the
specified virtual key value. |
|
MenuShortcut(int key,
boolean usesShift)
Initializes a new instance of MenuShortcut with the
specified virtual key value and shift setting. |
|
| Method Summary | |
|---|---|
boolean |
equals(MenuShortcut obj)
Tests this object for equality against the specified object. |
boolean |
equals(Object obj)
equals compares this object to another object. |
int |
getKey()
Returns the virtual keycode for this shortcut. |
int |
hashCode()
hashCode returns a hash code for this object. |
protected String |
paramString()
Returns a debugging string for this object. |
String |
toString()
Returns a string representation of this shortcut. |
boolean |
usesShiftModifier()
Returns the shift setting for this shortcut. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MenuShortcut(int key)
MenuShortcut with the
specified virtual key value.
key - The virtual keycode for the shortcut.
public MenuShortcut(int key,
boolean usesShift)
MenuShortcut with the
specified virtual key value and shift setting.
key - The virtual keycode for the shortcut.usesShift - true if the shift key was pressed,
false otherwise.| Method Detail |
|---|
public int getKey()
public boolean usesShiftModifier()
true if the shift key was pressed, false
otherwise.public boolean equals(MenuShortcut obj)
MenuShortcut and has the same key value
and shift setting as this object.
obj - The object to test for equality against.
true if the two objects are equal, false
otherwise.public boolean equals(Object obj)
ObjectEquals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.
If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.
The default implementation of equals returns this==other.
equals in class Objectobj - the other object.
public String toString()
toString in class Objectpublic int hashCode()
ObjectThe default implementation returns System.identityHashCode(this).
hashCode in class Objectprotected String paramString()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||