Package org.pepstock.charba.client.enums
Enum ModifierKey
- java.lang.Object
-
- java.lang.Enum<ModifierKey>
-
- org.pepstock.charba.client.enums.ModifierKey
-
- All Implemented Interfaces:
Serializable
,Comparable<ModifierKey>
,Key
public enum ModifierKey extends Enum<ModifierKey> implements Key
A modifier key modifies the action of another key when the keys are pressed at the same time.- Author:
- Andrea "Stock" Stocchero
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALT
Used in combination with the numeric keypad for entering Alt codes, which output special characters;CTRL
Used for entering keyboard shortcuts.META
Used for entering keyboard shortcuts.SHIFT
Used for capitalizing letters and entering different types of symbols.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
arePressed(BaseNativeEvent event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.static boolean
arePressed(AbstractEvent event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.static boolean
arePressed(ChartEventContext event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.Div
getElement()
Returns theDiv
element which describes the modifier key.
It can be used in UI if needed.boolean
isPressed(BaseNativeEvent event)
Returnstrue
if the modifier key is pressed when the event was emitted.boolean
isPressed(AbstractEvent event)
Returnstrue
if the modifier key is pressed when the event was emitted.boolean
isPressed(ChartEventContext event)
Returnstrue
if the modifier key is pressed when the event was emitted.String
value()
Returns the name value of propertystatic ModifierKey
valueOf(String name)
Returns the enum constant of this type with the specified name.static ModifierKey[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ALT
public static final ModifierKey ALT
Used in combination with the numeric keypad for entering Alt codes, which output special characters;
-
CTRL
public static final ModifierKey CTRL
Used for entering keyboard shortcuts.
-
META
public static final ModifierKey META
Used for entering keyboard shortcuts.
-
SHIFT
public static final ModifierKey SHIFT
Used for capitalizing letters and entering different types of symbols.
-
-
Method Detail
-
values
public static ModifierKey[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ModifierKey c : ModifierKey.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ModifierKey valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
value
public String value()
Description copied from interface:Key
Returns the name value of property
-
getElement
public Div getElement()
Returns theDiv
element which describes the modifier key.
It can be used in UI if needed.- Returns:
- the
Div
element which describes the modifier key
-
isPressed
public boolean isPressed(AbstractEvent event)
Returnstrue
if the modifier key is pressed when the event was emitted.- Parameters:
event
- instance of CHARBA event to be checked- Returns:
true
if the modifier key is pressed when the event was emitted
-
isPressed
public boolean isPressed(ChartEventContext event)
Returnstrue
if the modifier key is pressed when the event was emitted.- Parameters:
event
- instance of CHARBA event to be checked- Returns:
true
if the modifier key is pressed when the event was emitted
-
isPressed
public boolean isPressed(BaseNativeEvent event)
Returnstrue
if the modifier key is pressed when the event was emitted.- Parameters:
event
- instance of native event to be checked- Returns:
true
if the modifier key is pressed when the event was emitted
-
arePressed
public static boolean arePressed(AbstractEvent event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.- Parameters:
event
- instance of CHARBA event to be checkedkeys
- array of keys to be checked against the event- Returns:
true
if the modifier key is pressed when the event was emitted
-
arePressed
public static boolean arePressed(ChartEventContext event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.- Parameters:
event
- instance of CHARBA event to be checkedkeys
- array of keys to be checked against the event- Returns:
true
if the modifier key is pressed when the event was emitted
-
arePressed
public static boolean arePressed(BaseNativeEvent event, ModifierKey... keys)
Returnstrue
if all modifier keys are pressed when the event was emitted.- Parameters:
event
- instance of native event to be checkedkeys
- array of keys to be checked against the event- Returns:
true
if the modifier key is pressed when the event was emitted
-
-