com.ibm.eNetwork.beans.HOD
Class MacroScreens

java.lang.Object
  |
  +--com.ibm.eNetwork.beans.HOD.MacroScreens
All Implemented Interfaces:
com.ibm.eNetwork.HOD.common.HODConstants, com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable, java.io.Serializable

public class MacroScreens
extends java.lang.Object
implements java.io.Serializable, com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable, com.ibm.eNetwork.HOD.common.HODConstants

This class is the collection class for the MacroScreen objects associated with a particular macro. All the screens to be recognized by the Macro bean are contained here.

Generally, this class would be instantiated and the MacroScreen objects would be added. The MacroScreens object could then be added to the Macro bean and the macro played. When the screen appears in the presentation space that matches the MacroScreen object, the MacroAction objects in the MacroActions collection will be executed in sequence.

Note that the Macro bean does this all automatically when it parses a macro file or records user interaction when linked to a Terminal bean. However, if you want to control the contents of a macro at the internal object representation level of the macro, you would use the MacroScreens object and its contained objects.

See Also:ECLScreenDesc

See Also:
MacroActions, MacroAction, MacroScreen, Macro, Serialized Form

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
 
Constructor Summary
MacroScreens()
          Constructs an empty instance of a MacroScreens object.
MacroScreens(java.util.Vector argScreens)
          Constructs a MacroScreens object using the given vector.
 
Method Summary
 void add(int argIndex, MacroScreen argMS)
          Inserts the macro screen at the given index.
 void add(MacroScreen argMS)
          Appends the macro screen to the end of the collection.
 void clear()
          Removes all macro screens from the collection
 java.lang.Object clone()
          Returns a new instance of MacroScreens with the same state as the current MacroScreens object.
 boolean contains(MacroScreen argMS)
          Tests to see if the given macro screen is in the collection.
 boolean contains(java.lang.String argName)
          Tests to see if the given macro screen with given Name is in the collection.
 boolean containsStartScreen()
          Returns whether the macro screens collection contains at least one start screen.
 boolean containsStopScreen()
          Returns whether the macro screens collection contains at least one stop screen.
 void createVariableBoolean(java.lang.String name, java.lang.String initValue)
          Creates a boolean variable with the given name and initial value for the macro.
 void createVariableDouble(java.lang.String name, java.lang.String initValue)
          Creates a double variable with the given name and initial value for the macro.
 void createVariableField(java.lang.String name)
          Creates a field variable with the given name for the macro.
 void createVariableInteger(java.lang.String name, java.lang.String initValue)
          Creates an integer variable with the given name and initial value for the macro.
 void createVariableString(java.lang.String name, java.lang.String initValue)
          Creates a string variable with the given name and initial value for the macro.
 java.lang.String format(int argType, boolean displayAll)
          Formats the contents of the object into a readable string.
 MacroScreen get(int argIndex)
          Returns the macro screen at the given index
 java.lang.String getAuthor()
          Returns the author of the macro.
 MacroScreen getByName(java.lang.String argName)
          Convenience method that returns a macro screen that has the given Name.
 java.lang.String getDate()
          Returns the date the macro was created or changed.
 java.lang.String getDescription()
          Returns the description of the macro.
 java.lang.String getName()
          Returns the name of the macro.
 int getPauseTime()
          Returns the pause time for the macro.
 int getTimeout()
          Returns the default next screens timeout value for the macro.
 java.lang.String getUniqueName()
          Returns a unique screen Name string for a possible MacroScreen object to be added to the collection.
 int indexOf(MacroScreen argMS)
          Returns the index of the given macro screen.
 boolean isEmpty()
          Tests to see if the macro screen collection is empty.
 boolean isInitialPrompt()
          Returns whether the Macro bean should scan this macro for prompts at the beginning of play and fire them all at once to prompt listeners.
 boolean isSuppressClearEvent()
          Returns whether the system should ignore screen events when a host application sends a clear screen command immediately followed by an end of record indicator in the data stream.
 boolean isUseVars()
          Returns whether this macro should be scanned for variables and expressions
 void remove(int argIndex)
          Removes the macro screen at the given index from the collection.
 void remove(MacroScreen argMS)
          Removes the given macro screen from the collection.
 java.util.Enumeration screens()
          Returns an enumeration of the macro screens in the collection.
 void set(MacroScreen argMS, int argIndex)
          Replaces the macro screen object at the given index in the collection.
 void setAuthor(java.lang.String argAuthor)
          Sets the author of the macro.
 void setDate(java.lang.String argDate)
          Sets the date the macro was created or changed.
 void setDescription(java.lang.String argDesc)
          Sets the description of the macro.
 void setInitialPrompt(boolean argVal)
          Sets whether the Macro bean should scan this macro for prompts at the beginning of play and fire them all at once to prompt listeners.
 void setName(java.lang.String argName)
          Sets the name of the macro.
 void setOwner(Macro mac)
          Sets the owner of the action.
 void setPauseTime(int argPause)
          Sets the pause time for the macro.
 void setSuppressClearEvent(boolean argVal)
          Sets whether the system should ignore screen events when a host application sends a clear screen command immediately followed by an end of record indicator in the data stream.
 void setTimeout(int argTimeout)
          Sets the default next screens timeout value for the macro.
 void setUseVars(boolean argVal)
          Sets whether this macro should be scanned for variables and expressions
 int size()
          Returns the number of screens in the macro screen collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable
setAttributes, setError
 

Constructor Detail

MacroScreens

public MacroScreens()
Constructs an empty instance of a MacroScreens object.

MacroScreens

public MacroScreens(java.util.Vector argScreens)
Constructs a MacroScreens object using the given vector.
Parameters:
argScreens - Vector of MacroScreen objects
See Also:
MacroScreen
Method Detail

get

public MacroScreen get(int argIndex)
Returns the macro screen at the given index
Parameters:
argIndex - index for the MacroScreen object
Returns:
MacroScreen object at the given index

set

public void set(MacroScreen argMS,
                int argIndex)
Replaces the macro screen object at the given index in the collection.
Parameters:
argMS - MacroScreen object to place in collection
argIndex - index for the MacroScreen object The name of the screen must be set to use this method

add

public void add(MacroScreen argMS)
Appends the macro screen to the end of the collection.
Parameters:
argMS - MacroScreen object to place in collection

add

public void add(int argIndex,
                MacroScreen argMS)
Inserts the macro screen at the given index. All succeeding macro actions will be shifted down in the collection.
Parameters:
argMS - MacroScreen object to place in collection
argIndex - index for the MacroScreen object

contains

public boolean contains(MacroScreen argMS)
Tests to see if the given macro screen is in the collection.
Parameters:
argMS - MacroScreen object to search for
Returns:
true if MacroScreen object is in the collection, false otherwise

contains

public boolean contains(java.lang.String argName)
Tests to see if the given macro screen with given Name is in the collection.
Parameters:
argName - MacroScreen object Name
Returns:
true if MacroScreen object is in the collection, false otherwise

getUniqueName

public java.lang.String getUniqueName()
Returns a unique screen Name string for a possible MacroScreen object to be added to the collection.
Returns:
Name string that is unique for a new MacroScreen object

isEmpty

public boolean isEmpty()
Tests to see if the macro screen collection is empty.
Returns:
true if collection is empty, false otherwise

size

public int size()
Returns the number of screens in the macro screen collection.
Returns:
number of screens in the collection

clear

public void clear()
Removes all macro screens from the collection

remove

public void remove(MacroScreen argMS)
Removes the given macro screen from the collection. The name of the screen must be set to use this method
Parameters:
argMS - MacroScreen object to remove from the collection
See Also:
MacroScreen.setName(String)

remove

public void remove(int argIndex)
Removes the macro screen at the given index from the collection.
Parameters:
argIndex - index for the MacroScreen object to remove

indexOf

public int indexOf(MacroScreen argMS)
Returns the index of the given macro screen.
Parameters:
argMS - MacroScreen object to find index of
Returns:
index of the MacroScreen object, -1 if object is not in collection

screens

public java.util.Enumeration screens()
Returns an enumeration of the macro screens in the collection.
Returns:
macro screens enumeration

getByName

public MacroScreen getByName(java.lang.String argName)
Convenience method that returns a macro screen that has the given Name. Note that this Name string should be unique in the macro.
Parameters:
argName - string Name to search for
Returns:
macro screen with the given description

containsStartScreen

public boolean containsStartScreen()
Returns whether the macro screens collection contains at least one start screen. If there is a start screen in the MacroScreens collection, all non-start screens will be ignored until the start screen is recognized.
Returns:
if true, a start screen exists in the collection

containsStopScreen

public boolean containsStopScreen()
Returns whether the macro screens collection contains at least one stop screen. If there is a stop screen in the MacroScreens collection, the Macro bean will halt playing after a stop screen is recognized and its actions have been executed.
Returns:
if true, a stop screen exists in the collection

getName

public java.lang.String getName()
Returns the name of the macro.
Returns:
macro name

setName

public void setName(java.lang.String argName)
Sets the name of the macro.
Parameters:
argName - new name for the macro

getDescription

public java.lang.String getDescription()
Returns the description of the macro.
Returns:
macro description

setDescription

public void setDescription(java.lang.String argDesc)
Sets the description of the macro.
Parameters:
argDesc - new macro description

getAuthor

public java.lang.String getAuthor()
Returns the author of the macro.
Returns:
macro author

setAuthor

public void setAuthor(java.lang.String argAuthor)
Sets the author of the macro.
Parameters:
argAuthor - new macro author

getDate

public java.lang.String getDate()
Returns the date the macro was created or changed. This is not automatically set by the Macro bean. The user must call this method.
Returns:
macro date

setDate

public void setDate(java.lang.String argDate)
Sets the date the macro was created or changed. This is not automatically set by the Macro bean. The user must call this method.
Parameters:
argDate - new macro date

isInitialPrompt

public boolean isInitialPrompt()
Returns whether the Macro bean should scan this macro for prompts at the beginning of play and fire them all at once to prompt listeners.
Returns:
true if Macro bean should prescan for prompts

setInitialPrompt

public void setInitialPrompt(boolean argVal)
Sets whether the Macro bean should scan this macro for prompts at the beginning of play and fire them all at once to prompt listeners.
Parameters:
argVal - if true, Macro bean will prescan for prompts

isUseVars

public boolean isUseVars()
Returns whether this macro should be scanned for variables and expressions
Returns:
true if this macro should be scanned for variables and expressions

setUseVars

public void setUseVars(boolean argVal)
Sets whether this macro should be scanned for variables and expressions
Parameters:
argVal - if true, macro will be scanned for variables and expressions

isSuppressClearEvent

public boolean isSuppressClearEvent()
Returns whether the system should ignore screen events when a host application sends a clear screen command immediately followed by an end of record indicator in the data stream.

This is an advanced feature and the default is false. You may want to set this value to true if you have screens in your application flow that have all blanks in them. If there is a valid blank screen in the macro and clear events are not ignored, it is possible that an ill-behaved host application can send a clear then end of record, a screen recognition event is processed, and the valid blank screen matches when it shouldn't have.

Returns:
true if system ignores clear screen commands followed by end of record indicators

setSuppressClearEvent

public void setSuppressClearEvent(boolean argVal)
Sets whether the system should ignore screen events when a host application sends a clear screen command immediately followed by an end of record indicator in the data stream.

This is an advanced feature and the default is false. You may want to set this value to true if you have screens in your application flow that have all blanks in them. If there is a valid blank screen in the macro and clear events are not ignored, it is possible that an ill-behaved host application can send a clear then end of record, a screen recognition event is processed, and the valid blank screen matches when it shouldn't have.

Parameters:
argVal - if true, system ignores clear screen commands followed by end of record indicators

getTimeout

public int getTimeout()
Returns the default next screens timeout value for the macro. This value can be overridden in each MacroNextScreen object in each MacroScreens.
Returns:
default timeout value in milliseconds.

setTimeout

public void setTimeout(int argTimeout)
Sets the default next screens timeout value for the macro. This value can be overridden in each MacroScreen in each MacroNextScreens object.
Parameters:
argTimeout - new timeout value in milliseconds

getPauseTime

public int getPauseTime()
Returns the pause time for the macro. This pause is performed in between each screen and in between each action to ensure that the host system has quieted down. If your host system is slow, this value should be increased past the default of 300 milliseconds.
Returns:
pause time for the macro in milliseconds.

setPauseTime

public void setPauseTime(int argPause)
Sets the pause time for the macro. This pause is performed in between each screen and in between each action to ensure that the host system has quieted down. If your host system is slow, this value should be increased past the default of 300 milliseconds.
Parameters:
argPause - new pause time in milliseconds

createVariableString

public void createVariableString(java.lang.String name,
                                 java.lang.String initValue)
Creates a string variable with the given name and initial value for the macro. Note: This method must be called BEFORE any actions, descriptors, etc that refer to the variable are associated with the MacroScreens.
Parameters:
name - name of the variable, in $var_name$ format
initValue - initial value of the variable. if null, the default value of "''" will be used

createVariableInteger

public void createVariableInteger(java.lang.String name,
                                  java.lang.String initValue)
Creates an integer variable with the given name and initial value for the macro. Note: This method must be called BEFORE any actions, descriptors, etc that refer to the variable are associated with the MacroScreens.
Parameters:
name - name of the variable, in $var_name$ format
initValue - initial value of the variable. if null, the default value of 0 will be used

createVariableDouble

public void createVariableDouble(java.lang.String name,
                                 java.lang.String initValue)
Creates a double variable with the given name and initial value for the macro. Note: This method must be called BEFORE any actions, descriptors, etc that refer to the variable are associated with the MacroScreens.
Parameters:
name - name of the variable, in $var_name$ format
initValue - initial value of the variable. if null, the default value of 0.0 will be used

createVariableField

public void createVariableField(java.lang.String name)
Creates a field variable with the given name for the macro. Note: This method must be called BEFORE any actions, descriptors, etc that refer to the variable are associated with the MacroScreens.
Parameters:
name - name of the variable, in $var_name$ format

createVariableBoolean

public void createVariableBoolean(java.lang.String name,
                                  java.lang.String initValue)
Creates a boolean variable with the given name and initial value for the macro. Note: This method must be called BEFORE any actions, descriptors, etc that refer to the variable are associated with the MacroScreens.
Parameters:
name - name of the variable, in $var_name$ format
initValue - initial value of the variable. if null, the default value of false will be used

clone

public java.lang.Object clone()
Returns a new instance of MacroScreens with the same state as the current MacroScreens object.
Returns:
copy of current MacroScreens object

format

public java.lang.String format(int argType,
                               boolean displayAll)
Formats the contents of the object into a readable string. Intended for visual feedback, as with the MacroDebugActionEvent class. Note: this method will result in a complete string representation of the Macro. That is, it calls all the format methods for the screens, descriptions, next-screens, actions, etc.
Specified by:
format in interface com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable
Parameters:
argType - reserved, currently only XML strings are supported
displayAll - if true, optional parameters are formatted also
Returns:
formatted string that reflects the contents of the action

setOwner

public void setOwner(Macro mac)
Sets the owner of the action.
Parameters:
mac - new Macro bean owner of the action