com.tensegrity.generic.util
Class ModifierConfig

java.lang.Object
  extended bycom.tensegrity.generic.util.ModifierConfig

public final class ModifierConfig
extends java.lang.Object

ModifierConfig

Author:
BurkhardWick

Nested Class Summary
static class ModifierConfig.OperationKey
          A singleton class representing the keys for the modifier configuration
 
Field Summary
static ModifierConfig.OperationKey COPY_ON_MOVE
          Constant for Copy-on-move operation
static int MODIFIER_MASK
          Mask for all key modifiers (e.g. for masking out mouse button modifiers)
static ModifierConfig.OperationKey TOGGLE_SELECTION
          Constant for Toggle-selection operation
static ModifierConfig.OperationKey ZOOM_TO_RECTANGLE
          Constant for Zoom-to-rectangle operation
 
Method Summary
static int getModifier(ModifierConfig.OperationKey operationKey)
          Retrieves the modifier of the given operation
static KeyStroke keyForModifier(int modifier)
          Returns a KeyStroke representing the modifier mask.
static boolean matches(ModifierConfig.OperationKey operationKey, int modifier)
          Returns true, if the given modifier is a valid trigger for the given operation
static int modifierForKey(KeyStroke key)
          Returns a modifier representing the SHIFT, CTRL and ALT components of a KeyStroke.
static void setModifier(ModifierConfig.OperationKey operationKey, int modifier)
          Sets the modifier for the given operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFIER_MASK

public static final int MODIFIER_MASK
Mask for all key modifiers (e.g. for masking out mouse button modifiers)

See Also:
Constant Field Values

COPY_ON_MOVE

public static final ModifierConfig.OperationKey COPY_ON_MOVE
Constant for Copy-on-move operation


TOGGLE_SELECTION

public static final ModifierConfig.OperationKey TOGGLE_SELECTION
Constant for Toggle-selection operation


ZOOM_TO_RECTANGLE

public static final ModifierConfig.OperationKey ZOOM_TO_RECTANGLE
Constant for Zoom-to-rectangle operation

Method Detail

matches

public static final boolean matches(ModifierConfig.OperationKey operationKey,
                                    int modifier)
Returns true, if the given modifier is a valid trigger for the given operation

Parameters:
operationKey - The key of the operation
modifier - The modifier of the pressed keys
Returns:
true, if the given modifier is a valid trigger for the given operation

getModifier

public static final int getModifier(ModifierConfig.OperationKey operationKey)
Retrieves the modifier of the given operation

Parameters:
operationKey - The operation to get the modifier for
Returns:
the modifier for the given operation

setModifier

public static final void setModifier(ModifierConfig.OperationKey operationKey,
                                     int modifier)
Sets the modifier for the given operation

Parameters:
operationKey - The operation to get the modifier for
modifier - The modifier to set

keyForModifier

public static KeyStroke keyForModifier(int modifier)
Returns a KeyStroke representing the modifier mask.

Parameters:
modifier - The modifier
Returns:
A KeyStroke representing the modifier mask.

modifierForKey

public static int modifierForKey(KeyStroke key)
Returns a modifier representing the SHIFT, CTRL and ALT components of a KeyStroke.

Parameters:
key - The key
Returns:
A modifier representing the KeyStroke.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.