com.ibm.eNetwork.beans.HOD
Class KeyRemap

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.eNetwork.HOD.common.gui.HPanel
                                |
                                +--com.ibm.eNetwork.beans.HOD.HODPanelBean
                                      |
                                      +--com.ibm.eNetwork.beans.HOD.KeyRemap
All Implemented Interfaces:
javax.accessibility.Accessible, java.lang.Cloneable, java.util.EventListener, java.io.Externalizable, com.ibm.eNetwork.HOD.common.HODConstants, java.awt.image.ImageObserver, java.awt.event.KeyListener, com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, TraceProducer

public class KeyRemap
extends HODPanelBean
implements com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf, java.awt.event.KeyListener

The primary purpose of KeyRemap is to listen to KeyEvents (keystrokes) fired by the Terminal bean or Screen bean, remap those keystrokes to SendKey Mnemonics, generate a SendKeyEvent containing those SendKey Mnemonics, and fire that SendKeyEvent back to the Terminal bean or Screen bean for processing.

KeyRemap provides a Graphical User Interface (GUI) to control the process of remapping keystrokes to functions. Through the GUI you can view the mappings of keystrokes to functions, reassign which keystrokes get remapped to which functions, restore the default mappings for keystrokes, and search the current mappings for a specified keystroke.

KeyRemap also provides an API which supports all the operations performed by the GUI as well as additional advanced operations. The API allows you to define and add custom functions to KeyRemap. Once a custom function is added to KeyRemap both the API and GUI can interact with the custom function assigning keystrokes to it. KeyRemap uses the ActionListener interface of Java to notify interested code when a custom function has been activated.

KeyRemap additionally provides support for controlling the repetition of keys. KeyRemap normally processes keys when they are pressed. When a key is pressed and held, KeyRemap will continue to process the held key over and over until the key is released. You can designate a key to be processed only when it is released by adding the key as a non-repeating key. Both the API and GUI support this operation.

KeyRemap organizes functions into categories. Each category maintains a set of ActionListeners registered to receive ActionEvents from that category. You can register to receive ActionEvents from a specific category by calling the addActionListener(String category, ActionListener listener) method. When a keystroke remaps to a function in that category, an ActionEvent is generated and fired to registered ActionListeners for that category. The getActionCommand() method of ActionEvent will return the function of the remapped keystroke. You can also register to receive ActionEvents from all categories by calling the addActionListener(ActionListener listener) method.

All of the default functions of KeyRemap are assigned to one of two predefined function categories, named by the variables HOST_FUNCTIONS and CHARACTERS. The HOST_FUNCTIONS category contains only SendKey Mnemonics, which are documented in Appendix A. SendKey Mnemonics of the Host Access Class Library Reference. You can add custom functions to the HOST_FUNCTIONS category but they must conform to the SendKey interface. The CHARACTERS category contains special characters that may or may not appear on a keyboard. You can add additional characters to the CHARACTERS category but they must also conform to the SendKey interface. When a keystroke remaps to a function in one of these two categories, a SendKeyEvent in addition to an ActionEvent is generated and fired to registered SendKeyListeners. Only the HOST_FUNCTIONS and CHARACTERS categories cause an ActionEvent/SendKeyEvent pair to be fired from KeyRemap.

KeyRemap is sensitive to both the session type and codepage. It remaps different sets of default functions for 3270, 5250, VT, and CICS sessions and for single-byte, double-byte, bi-directional, Thai, Hindi, and Euro codepages.

The KeyRemap Bean has a set of public properties that can be accessed through the standard bean accessor methods. For example, KeyRemap has a sessionType property that affects the set of functions to which keystrokes can be remapped. SessionType is a read/write property and correspondingly has a getSessionType() method and a setSessionType() method that provide access to the property.

The properties can also be initialized when the bean is constructed using a Properties object with the appropriate keyword/value pairs. In the Properties object, the keyword for properties is the same as the property name. For example, the keyword for the sessionType property is "sessionType"--the constant, SESSION_TYPE, is provided for convenience.

Properties

* - Properties with type "enum" are String types that accept a specific set of string values. The valid values for an enum property can be obtained by calling the list <property name> method. The set method for enum properties validates the value before any changes are accepted, and a PropertyVetoException will be thrown if an incorrect value is given.

Note: All properties are bound and vetoable. A PropertyChangeEvent is fired to all PropertyChangeListeners after a property is changed. A vetoable PropertyChangeEvent is fired to all VetoableChangeListeners before a property is changed. VetoableChangeListeners can veto a property change by throwing a PropertyVetoException.

Property Name Type Default Access
sessionType enum* ECLSession.SESSION_TYPE_3270_STR read/write
codePage enum* ECLSession.SESSION_CODE_PAGE_US read/write
autoApply boolean true read/write

Events Fired

Event Type Fired To Event Handler Method
ActionEvent - Fired when a keystroke remaps to a function. Any ActionListener actionPerformed(ActionEvent)
SendKeyEvent - Fired when a keystroke remaps to a function within the HOST_FUNCTIONS or CHARACTERS category. Also fired when a keystroke produces a printable character and does not remap to any function. Terminal, Screen, Session sendKeys(SendKeyEvent)
PropertyChangeEvent - Fired after a bound property of the Bean is changed. Any PropertyChangeListener propertyChange(propertyChangeEvent)
Vetoable PropertyChangeEvent - Fired before a vetoable property of the Bean is changed. Any VetoableChangeListener vetoableChange(PropertyChangeEvent)

Events Accepted

Event Type Fired From Event Handler Method
KeyEvent - Standard Java key event fired when keystrokes are typed while a Component has focus. Terminal, Screen keyPressed(KeyEvent),
keyTyped(KeyEvent),
keyReleased(KeyEvent)
PropertyChangeEvent - Fired when a property of the source Bean is changed. Because KeyRemap is sensitive to the sessionType and codePage properties, it can listen to Property change events of other Beans and sync its own properties to correspond to those of the source Bean. Terminal, Session propertyChange(propertyChangeEvent)

Class Inheritance

The libraries containing this class are available in two versions: java2 and jdk1.1.8. This class document represents a compilation using Java 2 and its core libraries. The class inheritance scheme is shown above.

The alternative library was compiled with JDK 1.1.8. The result is a slightly different derivation, illustrated in this following class inheritance fragment.

         |
         +--java.awt.Container
               |
               +--java.awt.Panel
                     |
                     +--com.ibm.eNetwork.HOD.common.gui.HPanel
                           |
                           +--
 

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String AUTO_APPLY
          autoApply property keyword
static java.lang.String CHARACTERS
          Characters category definition string
static java.lang.String CODE_PAGE
          codePage property keyword
static java.lang.String FIELD_SEPARATOR
          Field separator character
static java.lang.String HOST_FUNCTIONS
          Host Functions category definition string
static java.lang.String SESSION_TYPE
          sessionType property keyword
 
Fields inherited from class com.ibm.eNetwork.beans.HOD.HODPanelBean
BEAN_VERSION_STRING, TRACE_LEVEL, TRACE_MAXIMUM, TRACE_MINIMUM, TRACE_NONE, TRACE_NORMAL
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.ibm.eNetwork.HOD.common.HODConstants
DEFAULT_WIN_FONT, HOD_ICON_EVENT, HOD_MSG_FILE, HOD_RAS_COMPID_ADVMACRO, HOD_RAS_COMPID_ASSOC_PRT, HOD_RAS_COMPID_BLINKREMAP, HOD_RAS_COMPID_CODEPAGE, HOD_RAS_COMPID_COLORREMAP, HOD_RAS_COMPID_CONFIG, HOD_RAS_COMPID_FILETRANSFER, HOD_RAS_COMPID_FTP_SCREEN, HOD_RAS_COMPID_FTP_SESSION, HOD_RAS_COMPID_FTP_TERMINAL, HOD_RAS_COMPID_FUDOMA, HOD_RAS_COMPID_HOD_API, HOD_RAS_COMPID_IMPEXP, HOD_RAS_COMPID_JNILOAD, HOD_RAS_COMPID_KEYPAD, HOD_RAS_COMPID_KEYREMAP, HOD_RAS_COMPID_MACRO, HOD_RAS_COMPID_MACROMANGR, HOD_RAS_COMPID_PRT_TERMINAL, HOD_RAS_COMPID_SCREEN, HOD_RAS_COMPID_SESSION, HOD_RAS_COMPID_SESSION_MGR, HOD_RAS_COMPID_SLP, HOD_RAS_COMPID_TERMINAL, HOD_RAS_COMPID_ZIPPRINT, HOD_RAS_FUNC_NAME, HOD_START_UP, HOD_TRANSFER_FILE_INFO, MOUSE_DOUBLE_CLICK_THRESHOLD, XFER_ASCII_GET_OPTIONS, XFER_ASCII_GET_OPTIONS_DEFAULT, XFER_ASCII_PUT_OPTIONS, XFER_ASCII_PUT_OPTIONS_DEFAULT, XFER_BINARY_GET_OPTIONS, XFER_BINARY_GET_OPTIONS_DEFAULT, XFER_BINARY_PUT_OPTIONS, XFER_BINARY_PUT_OPTIONS_DEFAULT, XFER_DEFAULT_OPTIONS, XFER_FILETYPE_DTA, XFER_FILETYPE_SAVF, XFER_FILETYPE_SRC, XFER_HOST_TYPE, XFER_HOST_TYPE_CICS, XFER_HOST_TYPE_CMS, XFER_HOST_TYPE_DEFAULT, XFER_HOST_TYPE_OS400, XFER_HOST_TYPE_TSO, XFER_PACKET_SIZE, XFER_PACKET_SIZE_DEFAULT, XFER_TIME_OUT_VALUE, XFER_TIME_OUT_VALUE_DEFAULT, XFER_TRANSFER_MODE, XFER_TRANSFER_MODE_ASCII, XFER_TRANSFER_MODE_BINARY, XFER_TRANSFER_MODE_DEFAULT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
KeyRemap()
          Constructor that uses the default values for all properties.
KeyRemap(java.util.Properties properties)
          Constructor that takes a Properties object containing the initial property settings.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Registers the specified ActionListener to receive ActionEvents from all categories.
 void addActionListener(java.lang.String category, java.awt.event.ActionListener listener)
          Registers the specified ActionListener to receive ActionEvents from the specified category.
 void addButton(java.awt.Component b, int panel)
          Deprecated.  
 void addButton(com.ibm.eNetwork.HOD.common.gui.HButton button)
          Adds a user defined button to the bottom row of the Graphical User Interface.
 void addFunction(java.lang.String function, java.lang.String codePageFlags, java.lang.String category, java.lang.String description, boolean isDefault)
          Adds a Function.
 void addMapping(java.lang.String keystroke, java.lang.String function, boolean isDefault)
          Adds a mapping.
 void addNonRepeatingKey(int keyCode, boolean isDefault)
          Adds a non-repeating key.
 void addSendKeyListener(SendKeyListener l)
          Registers the specified SendKeyListener to receive SendKeyEvents.
 void apply()
          Applies all non-default changes.
 void cancel()
          Cancels all non-default changes made since the apply() method was last invoked.
static java.util.Properties defaults()
          Obtains a Properties object containing the default properties for this Bean.
 java.lang.String getCategory(java.lang.String function)
          Obtains the Category the specified function belongs to.
 java.lang.String getCodePage()
          Accessor method for the codePage property.
 java.lang.String getCodePageFlags()
          Obtains the current Codepage Flags.
 com.ibm.eNetwork.beans.HOD.keyremap.DefaultKeyboardRemap getDefaultKeyboardRemap()
          Obtains the default keyboard remap
 java.lang.String getDescription(java.lang.String function)
          Obtains the Description associated with the specified function.
static java.lang.String getKeystroke(java.awt.event.KeyEvent evt)
          Obtains the Keystroke associated with the specified KeyEvent.
 java.lang.String getMapping(java.lang.String keystroke)
          Obtains the function that the specified Keystroke remaps too.
 java.util.Properties getProperties()
          Obtains a Properties object containing the current properties of the Bean.
 int getSelectedPanelIndex()
          Obtains the index of the currently displayed panel.
 java.lang.String getSessionType()
          Accessor method for the sessionType property.
 java.lang.String getTraceName()
          Obtains a trace identifier for this bean
 boolean isAutoApply()
          Accessor method for the autoApply property.
 boolean isDefaultFunction(java.lang.String function)
          Determines if the specified function is a default function.
 boolean isDefaultMapping(java.lang.String keystroke)
          Determines if the specified Keystroke is currently mapped to its default.
 boolean isDefaultNonRepeatingKey(int keyCode)
          Determines if the specified key is a default non-repeating key.
 boolean isNonRepeatingKey(int keyCode)
          Determines if the specified key is a non-repeating key.
 void keyPressed(java.awt.event.KeyEvent evt)
          KeyListener interface method.
 void keyReleased(java.awt.event.KeyEvent evt)
          KeyListener interface method.
 void keyTyped(java.awt.event.KeyEvent evt)
          KeyListener interface method.
 java.util.Enumeration listCategories()
          Lists the categories currently defined in KeyRemap.
 java.util.Enumeration listCodePages()
          Lists valid codePages for the current session type.
static java.util.Enumeration listCodePages(java.lang.String sessionType)
          Lists valid codePages for the specified session type.
 java.util.Enumeration listFunctions()
          Lists the functions currently available in KeyRemap.
 java.util.Enumeration listMappings(java.lang.String function)
          Lists the Keystrokes that remap to the specified function.
 java.util.Enumeration listNonRepeatingKeys()
          Lists the non-repeating keys added to KeyRemap.
 java.util.Enumeration listSessionTypes()
          Lists the valid sessionTypes.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          PropertyChangeListener interface method.
 void removeActionListener(java.awt.event.ActionListener listener)
          Unregisters the specified ActionListener so that it no longer receives ActionEvents from any category.
 void removeButton(java.awt.Component b, int panel)
          Deprecated.  
 void removeButton(com.ibm.eNetwork.HOD.common.gui.HButton button)
          Removes a user defined button from the bottom row of the Graphical User Interface
 void removeFunction(java.lang.String function)
          Removes a function.
 void removeMapping(java.lang.String keystroke)
          Removes a mapping.
 void removeNonRepeatingKey(int keyCode)
          Removes a non-repeating key.
 void removeSendKeyListener(SendKeyListener l)
          Unregisters the specified SendKeyListener so that it no longer receives SendKeyEvents.
 void requestFocus()
          Transfers focus to the bean.
 void reset()
          Resets KeyRemap to default functions, mappings, and non-repeating keys.
 void resetMapping(java.lang.String keystroke)
          Resets the specified Keystroke to its default mapping.
 void setAutoApply(boolean autoApply)
          Sets the autoApply property.
 void setCodePage(java.lang.String codePage)
          Sets the codePage property.
 void setParentFrame(java.awt.Window parentFrame)
          Set the parent Window of KeyRemap to update the reference for centering subsequent windows.
 void setProperties(java.util.Properties properties)
          Sets the Bean properties using a Properties object containing the appropriate keyword/value pairs.
 void setSessionType(java.lang.String type)
          Sets the sessionType property.
 void setTraceLevel(int traceLevel)
          Sets the current tracing level for this object
 
Methods inherited from class com.ibm.eNetwork.beans.HOD.HODPanelBean
addPropertyChangeListener, addTraceListener, addVetoableChangeListener, clone, dispose, getComponent, getFunction, getTraceLevel, readExternal, removePropertyChangeListener, removeTraceListener, removeVetoableChangeListener, toString, writeExternal
 
Methods inherited from class com.ibm.eNetwork.HOD.common.gui.HPanel
add, createAssociation, paintComponent, setAccessDesc, setAccessibleName
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, repaint, repaint, requestDefaultFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
dispose
 

Field Detail

SESSION_TYPE

public static final java.lang.String SESSION_TYPE
sessionType property keyword

CODE_PAGE

public static final java.lang.String CODE_PAGE
codePage property keyword

AUTO_APPLY

public static final java.lang.String AUTO_APPLY
autoApply property keyword

HOST_FUNCTIONS

public static final java.lang.String HOST_FUNCTIONS
Host Functions category definition string

CHARACTERS

public static final java.lang.String CHARACTERS
Characters category definition string

FIELD_SEPARATOR

public static final java.lang.String FIELD_SEPARATOR
Field separator character
See Also:
getProperties()
Constructor Detail

KeyRemap

public KeyRemap()
Constructor that uses the default values for all properties.

KeyRemap

public KeyRemap(java.util.Properties properties)
         throws java.beans.PropertyVetoException
Constructor that takes a Properties object containing the initial property settings. Any properties that are not specified in the Properties object are defaulted.
Parameters:
properties - Properties for the Bean.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect property value is given.
Method Detail

setParentFrame

public void setParentFrame(java.awt.Window parentFrame)
Set the parent Window of KeyRemap to update the reference for centering subsequent windows.
Parameters:
parentFrame - the parent Window

addButton

public void addButton(java.awt.Component b,
                      int panel)
Deprecated.  

See Also:
addButton(HButton)

addButton

public void addButton(com.ibm.eNetwork.HOD.common.gui.HButton button)
Adds a user defined button to the bottom row of the Graphical User Interface. The calling class must handle adding listeners to the button if it wants to react to the events generated by it.
Parameters:
button - HButton to be added.
See Also:
removeButton(HButton)

removeButton

public void removeButton(java.awt.Component b,
                         int panel)
Deprecated.  

See Also:
removeButton(HButton)

removeButton

public void removeButton(com.ibm.eNetwork.HOD.common.gui.HButton button)
Removes a user defined button from the bottom row of the Graphical User Interface
Parameters:
button - HButton to be removed.
See Also:
addButton(HButton)

setProperties

public void setProperties(java.util.Properties properties)
                   throws java.beans.PropertyVetoException
Sets the Bean properties using a Properties object containing the appropriate keyword/value pairs. This method resets KeyRemap to its default functions and mappings before processing the new properties object.
Specified by:
setProperties in interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
Overrides:
setProperties in class HODPanelBean
Parameters:
properties - Properties for the Bean.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect property value is given.
See Also:
getProperties()

getProperties

public java.util.Properties getProperties()
Obtains a Properties object containing the current properties of the Bean. The properties of the KeyRemap Bean are SESSION_TYPE, CODE_PAGE, AUTO_APPLY, and changes made to defaults in the following keyword/value pair formats:

Key Value Effect
| Codepage Flags | Category | Description Function Adds a non-default function
XF:Function Function Removes a default function
TKeycode Keycode Adds a non-default non-repeating key
XT:Keycode Keycode Removes a default non-repeating key
Keystroke Function Adds a non-default mapping
XM:Keystroke Keystroke Removes a default mapping

Note: The FIELD_SEPARATOR character is used to delimit the Codepage Flags, Category, and Description fields.

Codepage Flags
The Codepage Flags field specifies the codepages which the function is valid for. If the codepage of the KeyRemap bean does not match any of the codepage flags the function will not be added. If Codepage Flags field is blank the function will be added for all codepages. You can include more than one codepage flag. Multiple codepage flags are valid.
Example. BD = Bidi or DBCD codepages.

Flag Codepages
blank
All codepages
B
Bidi codepages
D
DBCS codepages
T
Thai codepages
H
Hindi codepages
E
Euro codepages

Category
The Category field specifies the category which the function will be added to. If the Category field is blank the function will either be added to the HOST_FUNCTIONS category or the CHARACTERS category. If the Function is one character in length the function will be added to the CHARACTERS category otherwise it will be added to the HOST_FUNCTIONS category.

Description
The Description field specifies the text that will appear in the Graphical User Interface for this function. If the Description field is blank the Function will appear in the Graphical User Interface as is.

Function
The Function field can start with the FIELD_SEPARATOR character , or the "[" character. If the Function field starts with FIELD_SEPARATOR all characters after the first FIELD_SEPARATOR character are considered part of the function. If the Function field starts with the "[" character, all of the characters including the first "[" are considered part of the function. If the Function function does not start with either the FIELD_SEPARATOR character or the "[" character then the Function must be a String representation of a base 10 integer. The Function is then converted into a single character based on the Unicode point represented by that integer.

Keycode
The Keycode field specifies the Java keycode obtained by invoking the getKeyCode() method of a KeyEvent. Java keycodes can be found in the JDK documentation under the KeyEvent class.

Keystroke
The Keystroke field is defined as Modifiers + Keycode. Modifiers is a single character that represents the state of the modifier keys. The Keycode is the same as described above. The table below lists valid values for the Modifiers character:

Modifiers character Description
B
base state, no modifiers
C
Ctrl modifier
A
Alt modifier
S
Shift modifier
D
Ctrl+Shift modifier
H
Alt+Shift modifier
I
Ctrl+Alt modifier
J
Ctrl+Alt+Shift modifier

Examples:

Key Value Effect
||host|Logon |username[tab]password[enter] Adds a function with the description "Logon"
to the HOST_FUNCTIONS category
for all codepages
|B|host| [bidilayer] Adds a function with the description "[bidilayer]"
to the HOST_FUNCTIONS category for
BiDi codepages only
|||Exclamation Mark 33 Adds a function with the description "Exclamation Mark"
to the CHARACTERS category for all codepages
||char|Exclamation Mark |! Adds a function with the description "Exclamation Mark"
to the CHARACTERS category for all codepages.
(Same as above)
XF:[bidilayer] [bidilayer] Removes the [bidilayer] function
T10 10 Adds the Enter key to the non-repeating key list
XT:65 65 Removes the A key from the non-repeating key list
A65 [altcsr] Maps the Alt-A key combination to the function [altcsr]
XM:B10 B10 Unmaps the Enter key
B112 |username[tab]password[enter] Maps the F1 key to the "Logon" function added above
C113 33 Maps the Ctl-F2 key combination to the "Exclamation Mark"
function added above

Specified by:
getProperties in interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
Overrides:
getProperties in class HODPanelBean
See Also:
setProperties(java.util.Properties)

defaults

public static java.util.Properties defaults()
Obtains a Properties object containing the default properties for this Bean. The properties do not include default functions, mappings, or non-repeating keys.
See Also:
setProperties(java.util.Properties), getProperties()

setSessionType

public void setSessionType(java.lang.String type)
                    throws java.beans.PropertyVetoException
Sets the sessionType property. Changing the value of this property resets KeyRemap to its default functions and mappings and may change the value of the CODE_PAGE property.
Parameters:
type - The session type to use.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect parameter is specified or the vetoable PropertyChangeEvent is vetoed.
See Also:
getSessionType(), listSessionTypes()

getSessionType

public java.lang.String getSessionType()
Accessor method for the sessionType property.
Returns:
The value of the sessionType property.
See Also:
setSessionType(java.lang.String), listSessionTypes()

listSessionTypes

public java.util.Enumeration listSessionTypes()
Lists the valid sessionTypes.
Returns:
Returns an Enumeration of valid sessionType Strings.
See Also:
setSessionType(java.lang.String), getSessionType()

setCodePage

public void setCodePage(java.lang.String codePage)
                 throws java.beans.PropertyVetoException
Sets the codePage property. Changing the value of this property resets KeyRemap to its default functions and mappings.
Parameters:
codePage - The code page to use.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect parameter is specified or the vetoable PropertyChangeEvent is vetoed.
See Also:
getCodePage(), listCodePages(), listCodePages(java.lang.String)

getCodePage

public java.lang.String getCodePage()
Accessor method for the codePage property.
Returns:
The value of the codePage property.
See Also:
setCodePage(java.lang.String), listCodePages(), listCodePages(java.lang.String)

listCodePages

public java.util.Enumeration listCodePages()
Lists valid codePages for the current session type.
Returns:
Enumeration of valid codePage Strings for the current session type.
See Also:
setCodePage(java.lang.String), getCodePage()

listCodePages

public static java.util.Enumeration listCodePages(java.lang.String sessionType)
Lists valid codePages for the specified session type.
Parameters:
sessionType - The session type for which to generate the list.
Returns:
Enumeration of valid codePage Strings for the specified session type.
See Also:
setCodePage(java.lang.String), getCodePage()

setAutoApply

public void setAutoApply(boolean autoApply)
                  throws java.beans.PropertyVetoException
Sets the autoApply property. If set to true the apply() method will be invoked after each change made in the Graphical User Interface. If set to false changes made in the Graphical User Interface will not be applied until the apply() method is called.
Parameters:
autoApply - The value for the autoApply property.
Throws:
java.beans.PropertyVetoException - Thrown if the PropertyChangeEvent is vetoed.
See Also:
isAutoApply(), apply()

isAutoApply

public boolean isAutoApply()
Accessor method for the autoApply property.
Returns:
The value of the autoApply property.
See Also:
setAutoApply(boolean), apply()

setTraceLevel

public void setTraceLevel(int traceLevel)
                   throws java.beans.PropertyVetoException
Sets the current tracing level for this object
Overrides:
setTraceLevel in class HODPanelBean
Parameters:
traceLevel - One of the trace level constants.
Throws:
java.beans.PropertyVetoException - Thrown if the PropertyChangeEvent is vetoed.

addSendKeyListener

public void addSendKeyListener(SendKeyListener l)
Registers the specified SendKeyListener to receive SendKeyEvents.
Specified by:
addSendKeyListener in interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
Parameters:
listener - The SendKeyListener to be added.
See Also:
removeSendKeyListener(com.ibm.eNetwork.beans.HOD.event.SendKeyListener)

removeSendKeyListener

public void removeSendKeyListener(SendKeyListener l)
Unregisters the specified SendKeyListener so that it no longer receives SendKeyEvents.
Parameters:
listener - The SendKeyListener to be removed.
See Also:
addSendKeyListener(com.ibm.eNetwork.beans.HOD.event.SendKeyListener)

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Registers the specified ActionListener to receive ActionEvents from all categories. When a keystroke remaps to any function an ActionEvent is generated and fired to registered ActionListeners. The getActionCommand() method of ActionEvent returns the function the keystroke was remapped to.
Parameters:
listener - The ActionListener to be added.
See Also:
addActionListener(java.lang.String, java.awt.event.ActionListener), removeActionListener(java.awt.event.ActionListener)

addActionListener

public void addActionListener(java.lang.String category,
                              java.awt.event.ActionListener listener)
Registers the specified ActionListener to receive ActionEvents from the specified category. When a keystroke remaps to a function in the specified category an ActionEvent is generated and fired to registered ActionListeners on that category. The getActionCommand() method of ActionEvent returns the function the keystroke was remapped to.
Parameters:
category - The category to receive ActionEvents from.
listener - The ActionListener to be added.
See Also:
addActionListener(java.awt.event.ActionListener), removeActionListener(java.awt.event.ActionListener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Unregisters the specified ActionListener so that it no longer receives ActionEvents from any category.
Parameters:
listener - The ActionListener to be removed.
See Also:
addActionListener(java.awt.event.ActionListener), addActionListener(java.lang.String, java.awt.event.ActionListener)

addNonRepeatingKey

public void addNonRepeatingKey(int keyCode,
                               boolean isDefault)
Adds a non-repeating key. KeyRemap normally processes keys when they are pressed. When a key is pressed and held KeyRemap will continue to process the held key over and over until the key is released. You can designate a key to be processed only when it is released by adding the key to KeyRemap list of non-repeating keys.
Parameters:
keyCode - The key-code for the non-repeating key to be added.
isDefault - Specifies whether the non-repeating key is a default non-repeating key.
See Also:
removeNonRepeatingKey(int), isNonRepeatingKey(int), isDefaultNonRepeatingKey(int), listNonRepeatingKeys()

removeNonRepeatingKey

public void removeNonRepeatingKey(int keyCode)
Removes a non-repeating key.
Parameters:
keyCode - The key-code for the non-repeating key to be removed.
See Also:
addNonRepeatingKey(int, boolean), isNonRepeatingKey(int), isDefaultNonRepeatingKey(int), listNonRepeatingKeys()

isNonRepeatingKey

public boolean isNonRepeatingKey(int keyCode)
Determines if the specified key is a non-repeating key.
Parameters:
keyCode - The key-code for the key to be checked.
Returns:
True - If the specified key is a non-repeating key.
False - If the specified key is a repeating key.
See Also:
addNonRepeatingKey(int, boolean), removeNonRepeatingKey(int), isNonRepeatingKey(int), isDefaultNonRepeatingKey(int), listNonRepeatingKeys()

isDefaultNonRepeatingKey

public boolean isDefaultNonRepeatingKey(int keyCode)
Determines if the specified key is a default non-repeating key.
Parameters:
keyCode - The key-code for the key to be checked.
Returns:
True - If the specified key is a default non-repeating key.
False - If the specified key is a repeating key or the specified key is a non-default non-repeating key.
See Also:
addNonRepeatingKey(int, boolean), removeNonRepeatingKey(int), isNonRepeatingKey(int), isDefaultNonRepeatingKey(int), listNonRepeatingKeys()

listNonRepeatingKeys

public java.util.Enumeration listNonRepeatingKeys()
Lists the non-repeating keys added to KeyRemap.
Returns:
Enumeration of Integer keycodes for the current non-repeating keys.
See Also:
addNonRepeatingKey(int, boolean), removeNonRepeatingKey(int), isNonRepeatingKey(int), isDefaultNonRepeatingKey(int), listNonRepeatingKeys()

addFunction

public void addFunction(java.lang.String function,
                        java.lang.String codePageFlags,
                        java.lang.String category,
                        java.lang.String description,
                        boolean isDefault)
Adds a Function.
Parameters:
function - Any String. Note: The function is not processed as described above in Function. The function is exactly the specified string.
codePageFlags - The Codepage Flags for the specified function.
category - The Category for the specified function.
description - The Description for the specified function.
isDefault - Specifies whether the function is a default function.
See Also:
removeFunction(java.lang.String), listFunctions(), getDescription(java.lang.String), getCategory(java.lang.String), getCodePageFlags()

removeFunction

public void removeFunction(java.lang.String function)
Removes a function.
Parameters:
function - The function to be removed.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean), listFunctions()

listFunctions

public java.util.Enumeration listFunctions()
Lists the functions currently available in KeyRemap.
Returns:
Enumeration of current function Strings.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean), removeFunction(java.lang.String)

getDescription

public java.lang.String getDescription(java.lang.String function)
Obtains the Description associated with the specified function. This is the text that appears in the Graphical User Interface.
Parameters:
function - The specified function.
Returns:
The Description associated with the specified function.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)

getCategory

public java.lang.String getCategory(java.lang.String function)
Obtains the Category the specified function belongs to.
Parameters:
function - The specified function.
Returns:
The Category the specified function belongs to.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean), listCategories()

getCodePageFlags

public java.lang.String getCodePageFlags()
Obtains the current Codepage Flags.
Returns:
The current Codepage Flags.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)

isDefaultFunction

public boolean isDefaultFunction(java.lang.String function)
Determines if the specified function is a default function.
Parameters:
function - The specified function.
Returns:
True - If the specified function is a default function.
False - If the specified function is not defined or not a default function.
See Also:
addFunction(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean), listCategories()

listCategories

public java.util.Enumeration listCategories()
Lists the categories currently defined in KeyRemap.
Returns:
Enumeration of category Strings currently defined.
See Also:
getCategory(java.lang.String)

addMapping

public void addMapping(java.lang.String keystroke,
                       java.lang.String function,
                       boolean isDefault)
Adds a mapping. Remaps the specified Keystroke to the specified function.
Parameters:
keystroke - The Keystroke to be remapped.
function - The function the Keystroke is remapped to.
isDefault - Specifies whether this mapping is a default mapping.
See Also:
removeMapping(java.lang.String), getMapping(java.lang.String), listMappings(java.lang.String), resetMapping(java.lang.String), isDefaultMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

removeMapping

public void removeMapping(java.lang.String keystroke)
Removes a mapping.
Parameters:
keystroke - The Keystroke to be unmapped.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), getMapping(java.lang.String), listMappings(java.lang.String), resetMapping(java.lang.String), isDefaultMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

getMapping

public java.lang.String getMapping(java.lang.String keystroke)
Obtains the function that the specified Keystroke remaps too.
Parameters:
keystroke - The key pressed.
Returns:
The function that the specified Keystroke remaps too.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), removeMapping(java.lang.String), listMappings(java.lang.String), resetMapping(java.lang.String), isDefaultMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

listMappings

public java.util.Enumeration listMappings(java.lang.String function)
Lists the Keystrokes that remap to the specified function.
Parameters:
function - The specified function.
Returns:
Enumeration of Keystrokes that remap to the specified function.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), removeMapping(java.lang.String), getMapping(java.lang.String), resetMapping(java.lang.String), isDefaultMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

resetMapping

public void resetMapping(java.lang.String keystroke)
Resets the specified Keystroke to its default mapping.
Parameters:
keystroke - The specified Keystroke.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), removeMapping(java.lang.String), getMapping(java.lang.String), listMappings(java.lang.String), isDefaultMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

isDefaultMapping

public boolean isDefaultMapping(java.lang.String keystroke)
Determines if the specified Keystroke is currently mapped to its default.
Parameters:
function - The specified Keystroke.
Returns:
True - If the specified Keystroke is mapped to its default function.
False - If the specified Keystroke is not mapped or is not mapped to its default function.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), removeMapping(java.lang.String), getMapping(java.lang.String), listMappings(java.lang.String), resetMapping(java.lang.String), getKeystroke(java.awt.event.KeyEvent)

getKeystroke

public static java.lang.String getKeystroke(java.awt.event.KeyEvent evt)
Obtains the Keystroke associated with the specified KeyEvent.
Parameters:
evt - A KeyEvent.
Returns:
The Keystroke associated with the specified KeyEvent.
Returns null if the specified KeyEvent is not a KEY_PRESSED KeyEvent.
See Also:
addMapping(java.lang.String, java.lang.String, boolean), removeMapping(java.lang.String), getMapping(java.lang.String), resetMapping(java.lang.String), isDefaultMapping(java.lang.String)

apply

public void apply()
Applies all non-default changes. All changes made through the Graphical User Interface or API are persisted and reflected in the Properties object returned when getProperties() is invoked.
See Also:
cancel(), reset(), setAutoApply(boolean), isAutoApply(), getProperties()

cancel

public void cancel()
Cancels all non-default changes made since the apply() method was last invoked. Default changes are not affected by invoking this method.
See Also:
apply(), reset()

reset

public void reset()
Resets KeyRemap to default functions, mappings, and non-repeating keys. The cancel() method can be invoked to restore the prior settings of KeyRemap before this method was invoked. The apply() method must be called before changes made by invoking this method are persisted and reflected in the Properties object returned by invoking getProperties().
Specified by:
reset in interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
See Also:
apply(), cancel(), getProperties()

requestFocus

public void requestFocus()
Transfers focus to the bean.
Specified by:
requestFocus in interface com.ibm.eNetwork.beans.HOD.intf.KeyRemapIntf
Overrides:
requestFocus in class javax.swing.JComponent

getSelectedPanelIndex

public int getSelectedPanelIndex()
Obtains the index of the currently displayed panel. The Graphical User Interface consists of several panels with tabs. The first panel with the left most tab is the zero index panel.
Returns:
A zero based index of the currently displayed panel.

getTraceName

public java.lang.String getTraceName()
Obtains a trace identifier for this bean
Overrides:
getTraceName in class HODPanelBean

getDefaultKeyboardRemap

public com.ibm.eNetwork.beans.HOD.keyremap.DefaultKeyboardRemap getDefaultKeyboardRemap()
Obtains the default keyboard remap

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
PropertyChangeListener interface method. This method is called when other Beans that KeyRemap is listening to fire PropertyChangeEvents. KeyRemap is sensitive to both sessionType and codePage properties of other Beans such as the Terminal or Session Beans. When the sessionType or codePage changes on a Bean that KeyRemap is listening to, KeyRemap will change its own property to match. This may cause KeyRemap to reset itself based on the new properties.
Overrides:
propertyChange in class HODPanelBean
Following copied from class: com.ibm.eNetwork.beans.HOD.HODPanelBean
Parameters:
evt - the PropertyChangeEvent for the property that was changed.

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
KeyListener interface method.
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
KeyListener interface method.
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
KeyListener interface method.
Specified by:
keyTyped in interface java.awt.event.KeyListener