com.ibm.eNetwork.beans.HOD
Class KeyPad

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.KeyPad
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.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, TraceProducer

public class KeyPad
extends HODPanelBean

KeyPad is a Bean that allows users to execute keyboard functions and send aid keys to the host with the click of a mouse. The KeyPad can be represented as either two horizontal rows of buttons or two vertical rows of buttons on a single panel depending upon how it is configured. The KeyPad is comprised of two pads that are both accessible via the 'NextPad' button on the pad itself. Clicking the 'NextPad' button swaps the current pad for the next one. The KeyPad can also be displayed with radio buttons for switching between the pads.

KeyPad is sensitive to both the session type and codepage and will display a different pad for 3270/5250/CICS and VT sessions and for single-byte, double-byte, and bi-directional codepages.

The KeyPad Bean has a set of public properties that can be accessed through the standard bean accessor methods. For example, KeyPad has a shape property that controls the appearance of the Bean. Shape is a read/write property and correspondingly has a getShape() method and a setShape() method that provide access to the property.

The properties can also be initialized when the bean is constructed using a java.util.Properties object with the appropriate keyword/value pairs. In the java.util.Properties object, the keyword for properties is the same as the property name. For example, the keyword for the shape property is "shape"--the constant, SHAPE, is provided for convenience. The shape property is an enumeration for which the valid values are S2X11 or S11X2.

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 will validate 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* See Session read/write
codePage enum* See Session read/write
shape enum* S2X11 read/write
radioButtonsVisible Boolean false read/write
pad enum* PAD_1 read/write

Events Fired

Event Type Fired To Event Handler Method
SendKeyEvent - Fired when a button on the KeyPad is clicked. Contains the keystroke or function specified by the button formatted as an ECLPS.SendKeys() style mnemonic keyword. Terminal, Screen, Session sendKeys(SendKeyEvent)
FocusEvent - Fired when the KeyPad Bean gains focus. Any FocusListener focusGained(FocusEvent)
PropertyChangeEvent - Fired when a property of the Bean is changed. Any PropertyChangeListener propertyChange(propertyChangeEvent)
Vetoable PropertyChangeEvent - Fired when a vetoable property of the Bean is changed. Any VetoableChangeListener vetoableChange(PropertyChangeEvent)

Events Accepted

Event Type Fired From Event Handler Method
PropertyChangeEvent 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 CODE_PAGE
          codePage property keyword
static java.lang.String FONT_SIZE
          font size property keyword
static java.lang.String PAD
          pad property keyword
static java.lang.String PAD_1
          pad property value - key pad 1
static java.lang.String PAD_2
          pad property value - key pad 2
static java.lang.String RADIO_BUTTONS_VISIBLE
          radioButtonsVisible property keyword
static java.lang.String S11X2
          shape property value - 11 rows by 2 columns
static java.lang.String S2X11
          shape property value - 2 rows by 11 columns
static java.lang.String SESSION_TYPE
          sessionType property keyword
static java.lang.String SHAPE
          shape 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_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_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_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
KeyPad()
          Constructor that uses the default values for all properties.
KeyPad(java.util.Properties p)
          Constructor that takes a Properties object containing the initial property settings.
 
Method Summary
 void addSendKeyListener(SendKeyListener listener)
           
static java.util.Properties defaults()
          Returns a Properties object containing the default properties for this Bean.
 java.lang.String getCodePage()
          Returns the value of the codePage property.
 int getFontSize()
          Returns the current font size.
 java.lang.String getPad()
          Returns the value of the pad property.
 java.lang.String getSessionType()
          Returns the value of the sessionType property.
 java.lang.String getShape()
          Returns the value of the shape property.
 java.lang.String getTraceName()
          Returns the trace name for this object.
 boolean isRadioButtonsVisible()
          Returns the value of the radioButtonsVisible property.
static java.util.Enumeration listPads()
          Enumerates the list of pads.
static java.util.Enumeration listShapes()
          Enumerates the list of valid shapes.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          PropertyChangeListener interface method.
 void removeSendKeyListener(SendKeyListener listener)
          Removes the specified SendKeyListener so that it no longer receives SendKeyEvents.
 void setCodePage(java.lang.String codePage)
          Sets the codePage property.
 void setFont(java.awt.Font font)
          Sets the font property.
 void setFontSize(int size)
          Sets the font size.
 void setPad(java.lang.String pad)
          Sets the pad property.
 void setRadioButtonsVisible(boolean show)
          Sets the radioButtonsVisible property.
 void setSessionType(java.lang.String type)
          Sets the sessionType property.
 void setShape(java.lang.String shape)
          Sets the shape property.
 void setSize(java.awt.Dimension d)
          Sets the size of KeyPad.
 void setSize(int w, int h)
          Sets the size of KeyPad.
 
Methods inherited from class com.ibm.eNetwork.beans.HOD.HODPanelBean
addPropertyChangeListener, addTraceListener, addVetoableChangeListener, clone, dispose, getComponent, getFunction, getProperties, getTraceLevel, readExternal, removePropertyChangeListener, removeTraceListener, removeVetoableChangeListener, setProperties, setTraceLevel, 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, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, 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, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

SHAPE

public static final java.lang.String SHAPE
shape property keyword

S2X11

public static final java.lang.String S2X11
shape property value - 2 rows by 11 columns

S11X2

public static final java.lang.String S11X2
shape property value - 11 rows by 2 columns

PAD

public static final java.lang.String PAD
pad property keyword

PAD_1

public static final java.lang.String PAD_1
pad property value - key pad 1

PAD_2

public static final java.lang.String PAD_2
pad property value - key pad 2

RADIO_BUTTONS_VISIBLE

public static final java.lang.String RADIO_BUTTONS_VISIBLE
radioButtonsVisible property keyword

FONT_SIZE

public static final java.lang.String FONT_SIZE
font size property keyword
Constructor Detail

KeyPad

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

KeyPad

public KeyPad(java.util.Properties p)
       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:
p - Properties for the Bean.
Throws:
java.beans.PropertyVetoException - Fired if an incorrect property value is given.
Method Detail

setSessionType

public void setSessionType(java.lang.String type)
                    throws java.beans.PropertyVetoException
Sets the sessionType property.
Parameters:
type - The session type to use. Valid values for sessionType are the same as those for the Session Bean.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect parameter is specified.
See Also:
getSessionType()

getSessionType

public java.lang.String getSessionType()
Returns the value of the sessionType property.
See Also:
setSessionType(java.lang.String)

setCodePage

public void setCodePage(java.lang.String codePage)
                 throws java.beans.PropertyVetoException
Sets the codePage property.
Parameters:
codePage - The code page to use. Valid values for codePage are the same as those for the Session Bean.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect value is specified.
See Also:
getCodePage()

getCodePage

public java.lang.String getCodePage()
Returns the value of the codePage property.
See Also:
setCodePage(java.lang.String)

setShape

public void setShape(java.lang.String shape)
              throws java.beans.PropertyVetoException
Sets the shape property.
Parameters:
shape - The shape to use. The valid values are S2X11 for a KeyPad with 2 rows and 11 columns or S11X2 for one with 11 rows and 2 columns.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect value is specified.
See Also:
getShape(), listShapes(), S2X11, S11X2

getShape

public java.lang.String getShape()
Returns the value of the shape property.
See Also:
setShape(java.lang.String)

listShapes

public static java.util.Enumeration listShapes()
Enumerates the list of valid shapes.
See Also:
setShape(java.lang.String)

setPad

public void setPad(java.lang.String pad)
            throws java.beans.PropertyVetoException
Sets the pad property.
Parameters:
pad - The pad to display. The valid values are PAD_1 or PAD_2.
Throws:
java.beans.PropertyVetoException - Thrown if an incorrect value is specified.
See Also:
getPad(), listPads(), PAD_1, PAD_2

getPad

public java.lang.String getPad()
Returns the value of the pad property.
See Also:
setPad(java.lang.String)

listPads

public static java.util.Enumeration listPads()
Enumerates the list of pads.
See Also:
setPad(java.lang.String)

setSize

public void setSize(java.awt.Dimension d)
Sets the size of KeyPad.
Overrides:
setSize in class java.awt.Component

setSize

public void setSize(int w,
                    int h)
Sets the size of KeyPad.
Overrides:
setSize in class java.awt.Component

setRadioButtonsVisible

public void setRadioButtonsVisible(boolean show)
                            throws java.beans.PropertyVetoException
Sets the radioButtonsVisible property.
Parameters:
show - Whether the KeyPad will show the radio buttons for the different pads.
Throws:
java.beans.PropertyVetoException - Thrown if a VetoableChangeListener rejects the change.
See Also:
isRadioButtonsVisible()

isRadioButtonsVisible

public boolean isRadioButtonsVisible()
Returns the value of the radioButtonsVisible property.
See Also:
setRadioButtonsVisible(boolean)

setFontSize

public void setFontSize(int size)
Sets the font size.
Parameters:
size - The new font size.
See Also:
getFontSize()

getFontSize

public int getFontSize()
Returns the current font size.
See Also:
setFontSize(int)

setFont

public void setFont(java.awt.Font font)
Sets the font property. The size of the Font object will be ignored because the KeyPad Bean dynamically resizes the Font according to the amount of space provided. If the Font object was created with an invalid name, a default Font will be selected instead.
Overrides:
setFont in class javax.swing.JComponent
Parameters:
font - The new font.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
PropertyChangeListener interface method. This method is called when other Beans that KeyPad is listening to fire PropertyChangeEvents. KeyPad 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 KeyPad is listening to, KeyPad will change it's own property to match. This can cause KeyPad to re-initialize itself based on the new settings.
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.

getTraceName

public java.lang.String getTraceName()
Description copied from class: HODPanelBean
Returns the trace name for this object.
Overrides:
getTraceName in class HODPanelBean

defaults

public static java.util.Properties defaults()
Returns a Properties object containing the default properties for this Bean.

addSendKeyListener

public void addSendKeyListener(SendKeyListener listener)

removeSendKeyListener

public void removeSendKeyListener(SendKeyListener listener)
Removes 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)