Package org.eclipse.gef
Class KeyStroke
- java.lang.Object
-
- org.eclipse.gef.KeyStroke
-
public class KeyStroke extends java.lang.ObjectEncapsulates a Keyboard gesture (press or release) from the User. A KeyStroke is matched to a KeyEvent based theKeyEvent.stateMask,KeyEvent.keyCodeorKeyEvent.character, and whether that KeyEvent was dispatched as a result of a release or press by the User.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static KeyStrokegetPressed(char character, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a press event.static KeyStrokegetPressed(char character, int keyCode, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a press event.static KeyStrokegetPressed(int keyCode, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a press event.static KeyStrokegetReleased(char character, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a release event.static KeyStrokegetReleased(char character, int keyCode, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a release event.static KeyStrokegetReleased(int keyCode, int stateMask)Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a release event.inthashCode()
-
-
-
Method Detail
-
getPressed
public static KeyStroke getPressed(char character, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a press event.- Parameters:
character- the character to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getPressed
public static KeyStroke getPressed(int keyCode, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a press event.- Parameters:
keyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getPressed
public static KeyStroke getPressed(char character, int keyCode, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a press event.- Parameters:
character- the character to matchkeyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
public static KeyStroke getReleased(char character, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a release event.- Parameters:
character- the character to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
public static KeyStroke getReleased(int keyCode, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a release event.- Parameters:
keyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
public static KeyStroke getReleased(char character, int keyCode, int stateMask)
Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a release event.- Parameters:
character- the character to matchkeyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the Object being compared- Returns:
- true iff the Object is an equivalent KeyStroke
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
-