All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eNetwork.beans.HOD.MacroScreen

java.lang.Object
   |
   +----com.ibm.eNetwork.beans.HOD.MacroScreen

public class MacroScreen
extends Object
implements Serializable, MacroParsable, 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 Macro bean's default XML representation of a macro, 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 retreived 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

Constructor Index

 o MacroScreen()
Constructs an empty instance of a macro screen.
 o MacroScreen(String, ECLScreenDesc, MacroActions, MacroNextScreens, int)
Constucts a functional instance of a macro screen with the given parameters.

Method Index

 o addAction(MacroAction)
Convenience method to add a MacroAction object to the MacroActions collection object contained in this MacroScreen object.
 o addNextScreen(MacroScreen)
Convenience method to add a MacroScreen object to the vector of valid next screens contained in this MacroScreen object.
 o appendComment(String)
Appends the given text to the comment text for the macro screen.
 o format(int, boolean)
Formats the object's contents into a readable string.
 o getActions()
Returns the actions associated with the screen.
 o getComment()
Returns the comment text for the macro screen.
 o getDescription()
Returns the ECLScreenDesc object for the screen.
 o getName()
Returns the unique identifier for the screen.
 o getNextScreens()
Returns the collection of valid next screens.
 o getRecoGoto()
Returns the screen name of another screen to go to if the recognition limit is reached.
 o getRecoIncrement()
Returns the reco limit tracking value
 o getRecoLimit()
Returns the macro screen's reco limit.
 o isStartScreen()
Returns whether the macro screen is a start screen.
 o isStopScreen()
Returns whether the macro screen is a stop screen.
 o isTransient()
Returns whether the macro screen as transient.
 o removeAction(MacroAction)
Convenience method to remove a MacroAction object from the MacroActions collection object contained in this MacroScreen object.
 o removeNextScreen(MacroScreen)
Convenience method to remove a MacroScreen object from the vector of valid next screens contained in this MacroScreen object.
 o setActions(MacroActions)
Sets the actions associated with the screen.
 o setAttributes(Hashtable)
Sets all the basic attributes for the Macro object from the String contents in the given hash table.
 o setComment(String)
Sets the comment text for the macro screen.
 o setDescription(ECLScreenDesc)
Sets the ECLScreenDesc object for the screen.
 o setName(String)
Sets the unique identifier for the screen.
 o setNextScreens(MacroNextScreens)
Sets the collection of valid next screens.
 o setOwner(Macro)
Sets the owner of the action.
 o setRecoGoto(String)
Sets the screen name of another screen to go to if the recognition limit is reached.
 o setRecoIncrement(int)
Sets the reco limit tracking value
 o setRecoLimit(int)
Sets the macro screen's reco limit.
 o setStartScreen(boolean)
Sets the macro screen as a start screen.
 o setStopScreen(boolean)
Sets the macro screen as a stop screen.
 o setTransient(boolean)
Sets the macro screen as transient.

Constructors

 o 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.

 o MacroScreen
 public MacroScreen(String argName,
                    ECLScreenDesc argSD,
                    MacroActions argActs,
                    MacroNextScreens argNext,
                    int argRecoLimit)
Constucts 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

Methods

 o getDescription
 public ECLScreenDesc getDescription()
Returns the ECLScreenDesc object for the screen.

Returns:
ECLScreenDesc object associated with the screen
 o setDescription
 public void setDescription(ECLScreenDesc argSD)
Sets the ECLScreenDesc object for the screen.

Parameters:
argSD - ECLScreenDesc object for the screen
 o getActions
 public MacroActions getActions()
Returns the actions associated with the screen.

Returns:
screen actions object
 o setActions
 public void setActions(MacroActions argActs)
Sets the actions associated with the screen.

Parameters:
argActs - actions to execute when Macro recognizes the screen
 o 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
 o 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
 o getName
 public 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
 o setName
 public void setName(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
 o addAction
 public void addAction(MacroAction argMA)
Convenience method to add a MacroAction object to the MacroActions collection object contained in this MacroScreen object.

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

 o 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.

 o 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.

 o setRecoLimit
 public void setRecoLimit(int argRecoLimit)
Sets the macro screen's reco limit. This is the number that the screen will be recognized by the Macro bean before going to the RecoGoto screen.

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

Returns:
recognition limit
 o setRecoGoto
 public void setRecoGoto(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
 o getRecoGoto
 public 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o setRecoIncrement
 public void setRecoIncrement(int argIncrement)
Sets the reco limit tracking value

 o getRecoIncrement
 public int getRecoIncrement()
Returns the reco limit tracking value

 o setComment
 public void setComment(String argText)
Sets the comment text for the macro screen.

Parameters:
argText - text of comment, whitespace will be removed for better XML rendering.
 o getComment
 public String getComment()
Returns the comment text for the macro screen.

Returns:
text of comment, whitespace will be removed for better XML rendering.
 o appendComment
 public void appendComment(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.
 o format
 public String format(int argType,
                      boolean displayAll)
Formats the object's contents into a readable string. Intended for visual feedback, as with the MacroDebugActionEvent class. Note: this method will result in a complete string representatino of the Macro. That is, it calls all the format methods for the screens, descriptions, nextscreens, actions, etc.

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
 o setAttributes
 public MacroParseEvent setAttributes(Hashtable ht) throws MacroException
Sets all the basic attributes for the Macro object from the String contents in the given hash table.

Parameters:
ht - hash table that contains string values of each attribute. Numeric and boolean values are converted from strings.
 o setOwner
 public void setOwner(Macro mac)
Sets the owner of the action.

Parameters:
mac - new Macro bean owner of the action

All Packages  Class Hierarchy  This Package  Previous  Next  Index