aicas logoJamaica 3.2 release 62

java.awt
Class MenuShortcut

java.lang.Object
  extended by java.awt.MenuShortcut
All Implemented Interfaces:
Serializable

public class MenuShortcut
extends Object
implements Serializable

This class implements a keyboard accelerator for a menu item.

See Also:
Serialized Form

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

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

getKey

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

Returns:
The virtual keycode for this shortcut.

usesShiftModifier

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

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

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)
Description copied from class: Object
equals compares this object to another object.

Equals 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.

Overrides:
equals in class Object
Parameters:
obj - the other object.
Returns:
if this and other are considered equal.

toString

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

Overrides:
toString in class Object
Returns:
A string representation of this shortcut.

hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Overrides:
hashCode in class Object
Returns:
a hash code value.

paramString

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

Returns:
A debugging string for this object.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.