java.awt

Class MenuShortcut

public class MenuShortcut extends Object implements Serializable

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
booleanequals(MenuShortcut obj)
Tests this object for equality against the specified object.
booleanequals(Object obj)
intgetKey()
Returns the virtual keycode for this shortcut.
inthashCode()
protected StringparamString()
Returns a debugging string for this object.
StringtoString()
Returns a string representation of this shortcut.
booleanusesShiftModifier()
Returns the shift setting for this shortcut.

Constructor Detail

MenuShortcut

public MenuShortcut(int key)
Initializes a new instance of MenuShortcut with the specified virtual key value.

Parameters: key The virtual keycode for the shortcut.

MenuShortcut

public MenuShortcut(int key, boolean usesShift)
Initializes a new instance of MenuShortcut with the specified virtual key value and shift setting.

Parameters: key The virtual keycode for the shortcut. usesShift true if the shift key was pressed, false otherwise.

Method Detail

equals

public boolean equals(MenuShortcut obj)
Tests this object for equality against the specified object. The two objects will be considered equal if and only if the specified object is an instance of MenuShortcut and has the same key value and shift setting as this object.

Parameters: obj The object to test for equality against.

Returns: true if the two objects are equal, false otherwise.

equals

public boolean equals(Object obj)

getKey

public int getKey()
Returns the virtual keycode for this shortcut.

Returns: The virtual keycode for this shortcut.

hashCode

public int hashCode()

paramString

protected String paramString()
Returns a debugging string for this object.

Returns: A debugging string for this object.

toString

public String toString()
Returns a string representation of this shortcut.

Returns: A string representation of this shortcut.

usesShiftModifier

public boolean usesShiftModifier()
Returns the shift setting for this shortcut.

Returns: true if the shift key was pressed, false otherwise.