|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.eNetwork.ECL.ECLScreenReco
An ECLScreenReco object is the engine in the screen recognition system. It contains the methods for adding and removing descriptions of screens. It also contains the logic for recognizing those screens and for asynchronously calling back to your handler code for those screens.
Think of an object of the ECLScreenReco class as a unique "recognition set". The object can have multiple ECLPS objects that it watches for screens, multiple screens to look for, and multiple callback points to call when it sees a screen in any of the ECLPS objects.
All you need to do is set up your ECLScreenReco objects at the start of your application, and when any screen appears in any ECLPS that you want to monitor, your code will get called by ECLScreenReco.
ECLScreenReco uses the following logic for recognizing, or matching ECLScreenDesc objects, which contain ECLScreenDescriptor-derived objects, against the data in an ECLPS object:
The following is a code fragment showing a common use of ECLScreenReco and ECLScreenDesc:
// Set up a screen description object. In this example, the // screen is identified by a cursor position, a key word, and // the number of fields. myScreenDesc = new ECLScreenDesc(); myScreenDesc.AddCursorPos(23,1); myScreenDesc.AddString("LOGON"); myScreenDesc.AddNumFields(15);// Set up screen reco object myScreenReco = new ECLScreenReco(); // myECLPS is an instance of ECLPS obtained from an instance of ECLSession myScreenReco.AddPS(myECLPS); // myCallback is a class that implements ECLRecoNotify. // myCallback will be notified if the screen defined by our // screen description object is recognized. myScreenReco.RegisterScreen(myScreenDesc, myCallback);
ECLScreenReco operates in a single-step mode. The recognition engine is activated, reviews screen updates, fires a recognition event and then turns itself off. Each recognition cycle is a single step: the recognition engine is on and then it is off. Therefore the application must build complex behavior from a series of single steps (which is the methodology underlying the Macro facility).
We recommend following these points to code a step:
RegisterScreen( Vector, ECLRecoNotify, boolean )
to activate the screenreco engine.
NotifyEvent(ECLPS,
ECLScreenDesc)
is called, react by first calling the
ECLScreenReco.UnregisterAllScreens()
to remove the vector of screen descriptors. The screenreco engine is
then inactive.
If you are using ECLScreenReco to manage screen traversals, avoid mixing
in the ECLPS and ECLOIA families of WaitForXxxx()
and
WaitWhileXxxx()
methods.
If you are using ECLScreenReco because your application is non-GUI, consider that Session in tandem with Macro is also non-GUI. The Macro facility is highly refined and supports recording and editing. Using it may considerably reduce the development effort for screen traversal logic and actions.
Constructor Summary | |
---|---|
ECLScreenReco()
Creates an instance of ECLScreenReco. |
|
ECLScreenReco(boolean active)
Creates an instance of ECLScreenReco with monitoring initially turned off or on. |
Method Summary | |
---|---|
void |
AddECLRecoDebugListener(ECLRecoDebugListener listener)
Adds the given ECLRecoDebugListener to list of listeners. |
void |
AddPS(ECLPS ps)
Adds an ECLPS object (Presentation Space) to the screen recognition system. |
void |
AddPS(ECLPS ps,
int eventType)
Adds an ECLPS object (Presentation Space) to the screen recognition system. |
void |
dispose()
Cleans up the object's internal environment. |
void |
DoReco()
Performs a recognition analysis for all the currently registered screens. |
boolean |
IsActive()
Returns the ECLScreenReco monitoring process state. |
static boolean |
IsMatch(ECLPS ps,
ECLScreenDesc sd)
Compares the particular screen description to the current content of the indicated presentation space. |
void |
RegisterScreen(ECLScreenDesc sd,
ECLRecoNotify notify)
Register an ECLScreenDesc object with the screen recognition system. |
void |
RegisterScreen(ECLScreenDesc sd,
ECLRecoNotify notify,
boolean initEvent)
Register an ECLScreenDesc object with the screen recognition system. |
void |
RegisterScreen(java.util.Vector sds,
ECLRecoNotify notify,
boolean initEvent)
Registers a Vector ECLScreenDesc object with the screen recognition system. |
void |
RemoveECLRecoDebugListener(ECLRecoDebugListener listener)
Removes the given ECLRecoDebugListener from list of listeners. |
void |
RemovePS(ECLPS ps)
Removes an ECLPS object (Presentation Space) from the screen recognition system. |
void |
RemovePS(ECLPS ps,
int eventType)
Removes an ECLPS object (Presentation Space) from the screen recognition system. |
void |
SetActive(boolean active)
Starts or stops the ECLScreenReco monitoring process. |
void |
UnregisterAllScreens()
Removes all registered screens from the screen recognition object. |
void |
UnregisterScreen(ECLScreenDesc sd,
ECLRecoNotify notify)
Remove an ECLScreenDesc object and its corresponding ECLRecoNotify object from the screen recognition system. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ECLScreenReco()
public ECLScreenReco(boolean active)
active
- If false, ECLScreenReco will not start monitoring
until ECLScreenReco.SetActive is called. If true,
monitoring will start with the first call to
ECLScreenReco.RegisterScreenMethod Detail |
public void dispose()
public void RegisterScreen(ECLScreenDesc sd, ECLRecoNotify notify)
sd
- ECLScreenDesc object to registernotify
- ECLRecoNotify object defined by youECLRecoNotify
,
ECLScreenDesc
public void RegisterScreen(ECLScreenDesc sd, ECLRecoNotify notify, boolean initEvent)
sd
- ECLScreenDesc object to registernotify
- ECLRecoNotify object defined by youinitEvent
- if true, the comparison logic for the screen registered
will be runECLRecoNotify
,
ECLScreenDesc
public void RegisterScreen(java.util.Vector sds, ECLRecoNotify notify, boolean initEvent)
sds
- vector of ECLScreenDesc objects to registernotify
- ECLRecoNotify object defined by youinitEvent
- if true, the comparison logic for the screen registered
will be runECLRecoNotify
,
ECLScreenDesc
public void UnregisterScreen(ECLScreenDesc sd, ECLRecoNotify notify)
sd
- ECLScreenDesc object to unregisternotify
- ECLRecoNotify object to unregisterECLScreenDesc
public void AddPS(ECLPS ps)
ps
- ECLPS object to addECLPS
public void AddPS(ECLPS ps, int eventType)
ps
- ECLPS object to addeventType
- monitor type for the ECLPS object.
ECLPS
public void RemovePS(ECLPS ps)
ps
- ECLPS object to removeECLPS
public void RemovePS(ECLPS ps, int eventType)
ps
- ECLPS object to removeeventType
- monitor type for the ECLPS object.
ECLPS
public void AddECLRecoDebugListener(ECLRecoDebugListener listener)
listener
- The ECLRecoDebugListener to be addedRemoveECLRecoDebugListener(com.ibm.eNetwork.ECL.screenreco.event.ECLRecoDebugListener)
public void RemoveECLRecoDebugListener(ECLRecoDebugListener listener)
listener
- The ECLRecoDebugListener to be removedAddECLRecoDebugListener(com.ibm.eNetwork.ECL.screenreco.event.ECLRecoDebugListener)
public void SetActive(boolean active)
ECLScreenReco
monitoring process.active
- true
: monitoring will start with the first call to
ECLScreenReco.RegisterScreen(...)
false
: stops monitoring until ECLScreenReco.SetActive(true)
is called public boolean IsActive()
public void DoReco()
public void UnregisterAllScreens()
public static boolean IsMatch(ECLPS ps, ECLScreenDesc sd) throws ECLErr
ps
- Presentation Space object compared for a matchsd
- Screen description object that defines a matchECLErr
- Thrown if error in comparing ECLScreenReco to PS.ECLScreenDesc
,
ECLPS
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |