com.tensegrity.gui.swing
Class SwingKeyStrokeProvider

java.lang.Object
  extended bycom.tensegrity.gui.KeyStrokeProvider
      extended bycom.tensegrity.gui.swing.SwingKeyStrokeProvider

public class SwingKeyStrokeProvider
extends KeyStrokeProvider

This is a Swing based subclass of the KeyStrokeProvider abstract class.

Version:
$Id: SwingKeyStrokeProvider.java,v 1.8 2005/07/05 09:29:57 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
protected  SwingKeyStrokeBuilder keyStrokeBuilderInstance
          This is the local instance of SwingKeyStrokeBuilder
 
Fields inherited from class com.tensegrity.gui.KeyStrokeProvider
KEYCODE_VS_MODIFIERS_SEPARATOR, KEYSTROKE_DEFINITION_SUFFIX, map, uiManager
 
Constructor Summary
protected SwingKeyStrokeProvider(UIManager uiManager)
           This constructor initializes the local Map associating command Ids and KeyStrokes.
 
Method Summary
static SwingKeyStrokeProvider getInstance(UIManager uiManager)
          Returns the singleton instance
 KeyStroke getKeyStroke(java.lang.String commandId)
           Returns the KeyStrokeassociated with the passed command Id.
protected  KeyStrokeBuilder getKeyStrokeBuilderInstance()
          Returns the local instance of SwingKeyStrokeBuilder.
 javax.swing.KeyStroke getSwingKeyStroke(java.lang.String commandId)
           Returns the KeyStrokeassociated with the passed command Id.
protected  void initKeyStrokesFromPropertyFile()
           This method tries to overwrite all the command Id/KeyStroke associations programmatically set up in the constructor with other associations potentially defined into the property files.
protected  void initSubclassKeyStrokesFromPropertyFile()
           Subclasses of SwingKeyStrokeProvider should implement this method and call it at the end of their constructor in order to allow the keystokes to be changed through property files.
 
Methods inherited from class com.tensegrity.gui.KeyStrokeProvider
addToMap, dumpKeyStrokes, getCommandIds, initSingleKeyStroke, loadFromDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keyStrokeBuilderInstance

protected SwingKeyStrokeBuilder keyStrokeBuilderInstance
This is the local instance of SwingKeyStrokeBuilder

Constructor Detail

SwingKeyStrokeProvider

protected SwingKeyStrokeProvider(UIManager uiManager)

This constructor initializes the local Map associating command Ids and KeyStrokes.

Parameters:
uiManager - this is the application UIManager
Method Detail

getKeyStrokeBuilderInstance

protected KeyStrokeBuilder getKeyStrokeBuilderInstance()
Returns the local instance of SwingKeyStrokeBuilder.

Specified by:
getKeyStrokeBuilderInstance in class KeyStrokeProvider
Returns:
Returns the SwingKeyStrokeBuilder instance.

initKeyStrokesFromPropertyFile

protected final void initKeyStrokesFromPropertyFile()

This method tries to overwrite all the command Id/KeyStroke associations programmatically set up in the constructor with other associations potentially defined into the property files.

Specified by:
initKeyStrokesFromPropertyFile in class KeyStrokeProvider

initSubclassKeyStrokesFromPropertyFile

protected void initSubclassKeyStrokesFromPropertyFile()

Subclasses of SwingKeyStrokeProvider should implement this method and call it at the end of their constructor in order to allow the keystokes to be changed through property files. Typically, for each keystroke programmatically defined in the constructor, a call to KeyStrokeProvider.initSingleKeyStroke(String) should be made in this method.

Specified by:
initSubclassKeyStrokesFromPropertyFile in class KeyStrokeProvider

getKeyStroke

public KeyStroke getKeyStroke(java.lang.String commandId)

Returns the KeyStrokeassociated with the passed command Id.

Overrides:
getKeyStroke in class KeyStrokeProvider
Parameters:
commandId - this is a unique identifier for a command.
Returns:
KeyStrokeassociated with the passed command Id

getSwingKeyStroke

public javax.swing.KeyStroke getSwingKeyStroke(java.lang.String commandId)

Returns the KeyStrokeassociated with the passed command Id.

Parameters:
commandId - this is a command unique identifier.
Returns:
KeyStrokeassociated with the passed command Id

getInstance

public static SwingKeyStrokeProvider getInstance(UIManager uiManager)
Returns the singleton instance

Parameters:
uiManager - this is the application's UIManager.
Returns:
the SwingKeyStrokeProvider instance.


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