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