com.ibm.eNetwork.beans.HOD
Class MacroScreen

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

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

This class contains the description, actions, and next-screen links for one screen in a macro. It corresponds to all the valid data contained in one screen element in a macro file or string. The MacroScreen class and its collection class, MacroScreens, are the core data objects for the internal representation of a macro in the Macro bean.

This object design keeps the Macro bean somewhat independent of the syntax used to represent macros in readable form. It is not totally dependant because the syntax used to represent a macro must still be a screen state machine. That is, the syntax must describe a series of valid screens in the macro and the actions assigned to those screens.

So, if you are not happy with the default XML representation of a macro by the Macro bean, and you understand that the language must be oriented around screens and their actions, you could implement your own macro language parser that constructs a valid MacroScreens collection and just have the Macro bean play it.

The other thing that you can do is serialize the MacroScreens object and save it to disk, which skips the parsing and is much more efficient for highly used macros. The MacroScreens collection can be retrieved from the Macro bean via the appropriate getMacro method. This collection object can then be serialized.

Any MacroScreen object must have three well constructed parts: the description, the actions, and the next-screen links. The description object used is the IBM Host Access Class Library ECLScreenDesc object. It contains all the functionality for providing a detailed description of what screen you want to assign actions to (strings, field count, cursor position, screen attributes). The actions are specified by the MacroActions collection and are executed in the sequence. Finally, the next-screens vector is a list of all the valid next-screens that will appear from the host after actions for the current screen are executed. If any other screens appear, an error occurs. If no next-screens are specified, all screens are valid.

See Also: ECLScreenDesc

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

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
 
Constructor Summary
MacroScreen()
          Constructs an empty instance of a macro screen.
MacroScreen(java.lang.String argName, com.ibm.eNetwork.ECL.ECLScreenDesc argSD, MacroActions argActs, MacroNextScreens argNext, int argRecoLimit)
          Constructs a functional instance of a macro screen with the given parameters.
MacroScreen(java.lang.String argName, com.ibm.eNetwork.ECL.ECLScreenDesc argSD, MacroActions argActs, MacroNextScreens argNext, int argRecoLimit, int argPauseTime)
          Constructs a functional instance of a macro screen with the given parameters.
 
Method Summary
 void addAction(MacroAction argMA)
          Convenience method to add a MacroAction object to the MacroActions collection object contained in this MacroScreen object.
 void addNextScreen(MacroScreen argNS)
          Convenience method to add a MacroScreen object to the vector of valid next-screens contained in this MacroScreen object.
 void appendComment(java.lang.String argText)
          Appends the given text to the comment text for the macro screen.
 boolean equals(java.lang.Object object)
          Determines whether the two MacroScreen objects have same contents.
 java.lang.String format(int argType, boolean displayAll)
          Formats the contents of the object into a readable string.
 MacroActions getActions()
          Returns the actions associated with the screen.
 java.lang.String getComment()
          Returns the comment text for the macro screen.
 com.ibm.eNetwork.ECL.ECLScreenDesc getDescription()
          Returns the ECLScreenDesc object for the screen.
 java.lang.String getName()
          Returns the unique identifier for the screen.
 MacroNextScreens getNextScreens()
          Returns the collection of valid next-screens.
 int getPauseTime()
          Returns the pause time for the screen.
 java.lang.String getPauseTimeRaw()
          Returns the expression form of the pause time for the screen.
 java.lang.String getRecoGoto()
          Returns the screen name of another screen to go to if the recognition limit is reached.
 java.lang.String getRecoGotoRaw()
          Returns the expression form of the screen name of another screen to go to if the recognition limit is reached.
 int getRecoIncrement()
          Returns the reco limit tracking value
 int getRecoLimit()
          Returns the reco limit of the macro screen.
 java.lang.String getRecoLimitRaw()
          Returns the expression form of the reco limit of the macro screen.
 boolean isStartScreen()
          Returns whether the macro screen is a start screen.
 java.lang.String isStartScreenRaw()
          Returns the expression form of whether the macro screen is a start screen.
 boolean isStopScreen()
          Returns whether the macro screen is a stop screen.
 java.lang.String isStopScreenRaw()
          Returns the expression form of whether the macro screen is a stop screen.
 boolean isTransient()
          Returns whether the macro screen as transient.
 java.lang.String isTransientRaw()
          Returns the expression form of whether the macro screen as transient.
 void removeAction(MacroAction argMA)
          Convenience method to remove a MacroAction object from the MacroActions collection object contained in this MacroScreen object.
 void removeNextScreen(MacroScreen argNS)
          Convenience method to remove a MacroScreen object from the vector of valid next-screens contained in this MacroScreen object.
 void setActions(MacroActions argActs)
          Sets the actions associated with the screen.
 void setComment(java.lang.String argText)
          Sets the comment text for the macro screen.
 void setDescription(com.ibm.eNetwork.ECL.ECLScreenDesc argSD)
          Sets the ECLScreenDesc object for the screen.
 void setName(java.lang.String argName)
          Sets the unique identifier for the screen.
 void setNextScreens(MacroNextScreens argNext)
          Sets the collection of valid next-screens.
 void setOwner(Macro mac)
          Sets the owner of the action.
 void setPauseTime(int time)
          Sets the pause time for the screen.
 void setPauseTime(java.lang.String time)
          Sets the pause time for the screen.
 void setRecoGoto(java.lang.String argScreenName)
          Sets the screen name of another screen to go to if the recognition limit is reached.
 void setRecoIncrement(int argIncrement)
          Sets the reco limit tracking value
 void setRecoLimit(int argRecoLimit)
          Sets the reco limit of the macro screen.
 void setRecoLimit(java.lang.String argRecoLimit)
          Sets the reco limit of the macro screen.
 void setStartScreen(boolean argVal)
          Sets the macro screen as a start screen.
 void setStartScreen(java.lang.String argVal)
          Sets the macro screen as a start screen.
 void setStopScreen(boolean argVal)
          Sets the macro screen as a stop screen.
 void setStopScreen(java.lang.String argVal)
          Sets the macro screen as a stop screen.
 void setTransient(boolean argVal)
          Sets the macro screen as transient.
 void setTransient(java.lang.String argVal)
          Sets the macro screen as transient.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable
setAttributes, setError
 

Constructor Detail

MacroScreen

public MacroScreen()
Constructs an empty instance of a macro screen.

If you use this constructor you must call all the set methods of this class to properly set up the action.


MacroScreen

public MacroScreen(java.lang.String argName,
                   com.ibm.eNetwork.ECL.ECLScreenDesc argSD,
                   MacroActions argActs,
                   MacroNextScreens argNext,
                   int argRecoLimit)
Constructs a functional instance of a macro screen with the given parameters.
Parameters:
argName - unique identifier for the screen
argSD - ECLScreenDesc object for the screen
argActs - actions to execute when Macro recognizes the screen
argNext - collection of valid next-screens, used to enforce screen sequence
argRecoLimit - number that the screen will be recognized by the Macro bean before going into error

MacroScreen

public MacroScreen(java.lang.String argName,
                   com.ibm.eNetwork.ECL.ECLScreenDesc argSD,
                   MacroActions argActs,
                   MacroNextScreens argNext,
                   int argRecoLimit,
                   int argPauseTime)
Constructs a functional instance of a macro screen with the given parameters.
Parameters:
argName - unique identifier for the screen
argSD - ECLScreenDesc object for the screen
argActs - actions to execute when Macro recognizes the screen
argNext - collection of valid next screens, used to enforce screen sequence
argRecoLimit - number that the screen will be recognized by the Macro bean before going into error
argPauseTime - pause time in milliseconds between plaing actions and recognizing next screen
Method Detail

getDescription

public com.ibm.eNetwork.ECL.ECLScreenDesc getDescription()
Returns the ECLScreenDesc object for the screen.
Returns:
ECLScreenDesc object associated with the screen

setDescription

public void setDescription(com.ibm.eNetwork.ECL.ECLScreenDesc argSD)
Sets the ECLScreenDesc object for the screen.
Parameters:
argSD - ECLScreenDesc object for the screen

getPauseTime

public int getPauseTime()
Returns the pause time for the screen. A pause time >= 0 will override Macro's global pause time. Default value is -1
Returns:
pause time

getPauseTimeRaw

public java.lang.String getPauseTimeRaw()
Returns the expression form of the pause time for the screen. A pause time >= 0 will override Macro's global pause time. Default value is -1
Returns:
expression form of the pause time

setPauseTime

public void setPauseTime(int time)
Sets the pause time for the screen. A pause time >= 0 will override Macro's global pause time. Default value is -1
Parameters:
time - pause time in milliseconds

setPauseTime

public void setPauseTime(java.lang.String time)
Sets the pause time for the screen. A pause time >= 0 will override Macro's global pause time. Default value is -1
Parameters:
expression - pause time in milliseconds

getActions

public MacroActions getActions()
Returns the actions associated with the screen.
Returns:
screen actions object

setActions

public void setActions(MacroActions argActs)
Sets the actions associated with the screen.
Parameters:
argActs - actions to execute when Macro recognizes the screen

getNextScreens

public MacroNextScreens getNextScreens()
Returns the collection of valid next-screens. The next-screens collection is intended for use by those who want to enforce a screen flow sequence and not just have the Macro bean recognized all screens in the macro at random.
Returns:
collection of MacroScreen objects that are valid next-screens

setNextScreens

public void setNextScreens(MacroNextScreens argNext)
Sets the collection of valid next-screens. The next-screens collection is intended for use by those who want to enforce a screen flow sequence and not just have the Macro bean recognized all screens in the macro at random.
Parameters:
argNext - collection of valid next MacroScreen objects

getName

public java.lang.String getName()
Returns the unique identifier for the screen. This Name must be unique for the current macro set in the Macro bean.
Returns:
unique string identifier for the screen

setName

public void setName(java.lang.String argName)
Sets the unique identifier for the screen. This Name must be unique for the current macro set in the Macro bean.
Parameters:
argName - unique identifier for the screen

addAction

public void addAction(MacroAction argMA)
Convenience method to add a MacroAction object to the MacroActions collection object contained in this MacroScreen object.

removeAction

public void removeAction(MacroAction argMA)
Convenience method to remove a MacroAction object from the MacroActions collection object contained in this MacroScreen object.

addNextScreen

public void addNextScreen(MacroScreen argNS)
Convenience method to add a MacroScreen object to the vector of valid next-screens contained in this MacroScreen object.

removeNextScreen

public void removeNextScreen(MacroScreen argNS)
Convenience method to remove a MacroScreen object from the vector of valid next-screens contained in this MacroScreen object.

setRecoLimit

public void setRecoLimit(int argRecoLimit)
Sets the reco limit of the macro screen. This is the number that the screen will be recognized by the Macro bean before going to the RecoGoto screen.
Parameters:
argRecoLimit - recognition limit

setRecoLimit

public void setRecoLimit(java.lang.String argRecoLimit)
Sets the reco limit of the macro screen. This is the number that the screen will be recognized by the Macro bean before going to the RecoGoto screen.
Parameters:
expression - recognition limit

getRecoLimit

public int getRecoLimit()
Returns the reco limit of the macro screen. This is the number that the screen will be recognized by the Macro bean before going into error.
Returns:
recognition limit

getRecoLimitRaw

public java.lang.String getRecoLimitRaw()
Returns the expression form of the reco limit of the macro screen. This is the number that the screen will be recognized by the Macro bean before going into error.
Returns:
expression form of the recognition limit

setRecoGoto

public void setRecoGoto(java.lang.String argScreenName)
Sets the screen name of another screen to go to if the recognition limit is reached. This screen must be in the macro.
Parameters:
argScreenName - screen name to got to when recolimit reached

getRecoGoto

public java.lang.String getRecoGoto()
Returns the screen name of another screen to go to if the recognition limit is reached. This screen must be in the macro.
Returns:
goto screen for recolimit

getRecoGotoRaw

public java.lang.String getRecoGotoRaw()
Returns the expression form of the screen name of another screen to go to if the recognition limit is reached. This screen must be in the macro.
Returns:
expression form of the goto screen for recolimit

setStartScreen

public void setStartScreen(boolean argVal)
Sets the macro screen as a 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.
Parameters:
argVal - if true, screen will be set to be a start screen

setStartScreen

public void setStartScreen(java.lang.String argVal)
Sets the macro screen as a 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.
Parameters:
expression - if true, screen will be set to be a start screen

isStartScreen

public boolean isStartScreen()
Returns whether the macro screen is a 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, screen is a start screen

isStartScreenRaw

public java.lang.String isStartScreenRaw()
Returns the expression form of whether the macro screen is a 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 expression evaluates to true, screen is a start screen

setStopScreen

public void setStopScreen(boolean argVal)
Sets the macro screen as a stop screen. If there is a stop screen in the MacroScreens collection, and it is recognized, the Macro bean will stop playing after the actions for the screen have been executed.
Parameters:
argVal - if true, screen will be set to be a stop screen

setStopScreen

public void setStopScreen(java.lang.String argVal)
Sets the macro screen as a stop screen. If there is a stop screen in the MacroScreens collection, and it is recognized, the Macro bean will stop playing after the actions for the screen have been executed.
Parameters:
expression - if true, screen will be set to be a stop screen

isStopScreen

public boolean isStopScreen()
Returns whether the macro screen is a stop screen. If there is a stop screen in the MacroScreens collection, and it is recognized, the Macro bean will stop playing after the actions for the screen have been executed.
Returns:
if true, screen is a stop screen

isStopScreenRaw

public java.lang.String isStopScreenRaw()
Returns the expression form of whether the macro screen is a stop screen. If there is a stop screen in the MacroScreens collection, and it is recognized, the Macro bean will stop playing after the actions for the screen have been executed.
Returns:
if expression evaluates to true, screen is a stop screen

setTransient

public void setTransient(boolean argVal)
Sets the macro screen as transient. For transient screens the next-screens collection is ignored and the actions are just executed. Use this to handle unwanted screens anywhere in the macro flow
Parameters:
argVal - if true, screen will be set to transient

setTransient

public void setTransient(java.lang.String argVal)
Sets the macro screen as transient. For transient screens the next-screens collection is ignored and the actions are just executed. Use this to handle unwanted screens anywhere in the macro flow
Parameters:
expression - if true, screen will be set to transient

isTransient

public boolean isTransient()
Returns whether the macro screen as transient. For transient screens the next-screens collection is ignored and the actions are just executed. Use this to handle unwanted screens anywhere in the macro flow
Returns:
if true, screen is set to transient

isTransientRaw

public java.lang.String isTransientRaw()
Returns the expression form of whether the macro screen as transient. For transient screens the next-screens collection is ignored and the actions are just executed. Use this to handle unwanted screens anywhere in the macro flow
Returns:
if expression evaluates to true, screen is set to transient

setRecoIncrement

public void setRecoIncrement(int argIncrement)
Sets the reco limit tracking value

getRecoIncrement

public int getRecoIncrement()
Returns the reco limit tracking value

setComment

public void setComment(java.lang.String argText)
Sets the comment text for the macro screen.
Parameters:
argText - text of comment, whitespace will be removed for better XML rendering.

getComment

public java.lang.String getComment()
Returns the comment text for the macro screen.
Returns:
text of comment, whitespace will be removed for better XML rendering.

appendComment

public void appendComment(java.lang.String argText)
Appends the given text to the comment text for the macro screen.
Parameters:
argText - text of comment, whitespace will be removed for better XML rendering.

equals

public boolean equals(java.lang.Object object)
Determines whether the two MacroScreen objects have same contents.
Overrides:
equals in class java.lang.Object
Parameters:
object - one of the MacroScreen classes
Returns:
boolean

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, nextscreens, 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