public class HotkeyData
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Integer |
hashCode
Kept in runtime hotkey hash code.
|
protected boolean |
isAlt
Whether hotkey activation requires ALT modifier or not.
|
protected boolean |
isCtrl
Whether hotkey activation requires CTRL modifier or not.
|
protected boolean |
isShift
Whether hotkey activation requires SHIFT modifier or not.
|
protected java.lang.Integer |
keyCode
Key code required for the hotkey activation.
|
| Constructor and Description |
|---|
HotkeyData()
Constructs empty hotkey data.
|
HotkeyData(boolean isCtrl,
boolean isAlt,
boolean isShift,
java.lang.Integer keyCode)
Constructs hotkey using specified modifiers and key code.
|
HotkeyData(java.lang.Integer keyCode)
Constructs hotkey using specified key code without any modifiers.
|
HotkeyData(java.awt.event.KeyEvent keyEvent)
Constructs hotkey using the specified KeyEvent.
|
HotkeyData(javax.swing.KeyStroke keyStroke)
Constructs hotkey using the specified key stroke.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areControlsTriggered(java.awt.event.KeyEvent event)
Returns whether hotkey controls are triggered by the key event or not.
|
protected HotkeyData |
clone()
Returns cloned HotkeyData instance.
|
boolean |
equals(java.lang.Object obj)
Indicates whether other hotkey is equal to this one.
|
java.lang.Integer |
getKeyCode()
Returns key code required for the hotkey activation.
|
javax.swing.KeyStroke |
getKeyStroke()
Returns key stroke for this hotkey.
|
int |
getModifiers()
Returns hotkey modifiers.
|
int |
hashCode()
Returns hotkey hash code.
|
boolean |
isAlt()
Returns whether hotkey activation requires ALT modifier or not.
|
boolean |
isCtrl()
Returns whether hotkey activation requires CTRL modifier or not.
|
boolean |
isHotkeySet()
Returns whether key code is set or not.
|
boolean |
isKeyTriggered(java.awt.event.KeyEvent event)
Returns whether key is triggered by the key event or not.
|
boolean |
isShift()
Returns whether hotkey activation requires SHIFT modifier or not.
|
boolean |
isTriggered(java.awt.event.KeyEvent event)
Returns whether hotkey is triggered by the key event or not.
|
void |
setAlt(boolean alt)
Sets whether hotkey activation should require ALT modifier or not.
|
void |
setCtrl(boolean ctrl)
Sets whether hotkey activation should require CTRL modifier or not.
|
void |
setKeyCode(java.lang.Integer keyCode)
Sets key code required for the hotkey activation.
|
void |
setModifiers(int modifiers)
Sets hotkey modifiers.
|
void |
setShift(boolean shift)
Sets whether hotkey activation should require SHIFT modifier or not.
|
java.lang.String |
toString()
Returns hotkey text representation.
|
@XStreamAsAttribute protected boolean isCtrl
@XStreamAsAttribute protected boolean isAlt
@XStreamAsAttribute protected boolean isShift
@XStreamAsAttribute protected java.lang.Integer keyCode
protected transient java.lang.Integer hashCode
public HotkeyData()
public HotkeyData(java.awt.event.KeyEvent keyEvent)
keyEvent - KeyEvent to convertpublic HotkeyData(java.lang.Integer keyCode)
keyCode - key code required for the hotkey activationpublic HotkeyData(boolean isCtrl,
boolean isAlt,
boolean isShift,
java.lang.Integer keyCode)
isCtrl - whether hotkey activation requires CTRL modifier or notisAlt - whether hotkey activation requires ALT modifier or notisShift - whether hotkey activation requires SHIFT modifier or notkeyCode - key code required for the hotkey activationpublic HotkeyData(javax.swing.KeyStroke keyStroke)
keyStroke - key strokepublic boolean isCtrl()
public void setCtrl(boolean ctrl)
ctrl - whether hotkey activation should require CTRL modifier or notpublic boolean isAlt()
public void setAlt(boolean alt)
alt - whether hotkey activation should require ALT modifier or notpublic boolean isShift()
public void setShift(boolean shift)
shift - whether hotkey activation should require SHIFT modifier or notpublic java.lang.Integer getKeyCode()
public void setKeyCode(java.lang.Integer keyCode)
keyCode - key code required for the hotkey activationpublic boolean isHotkeySet()
public boolean isTriggered(java.awt.event.KeyEvent event)
event - processed key eventpublic boolean areControlsTriggered(java.awt.event.KeyEvent event)
event - processed key eventpublic boolean isKeyTriggered(java.awt.event.KeyEvent event)
event - processed key eventpublic javax.swing.KeyStroke getKeyStroke()
public int getModifiers()
public void setModifiers(int modifiers)
modifiers - modifierspublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - other hotkeypublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected HotkeyData clone()
clone in class java.lang.Object