All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eNetwork.ECL.ECLScreenReco

java.lang.Object
   |
   +----com.ibm.eNetwork.ECL.ECLScreenReco

public class ECLScreenReco
extends Object
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:

  1. All ECLScreenDescriptor-derived objects in an ECLScreenDesc object registered with an ECLScreenReco object that are not optional must pass.
  2. If there are no non-optional descriptors, at least one optional descriptor must match.

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);


Constructor Index

 o ECLScreenReco()
Creates an instance of ECLScreenReco.
 o ECLScreenReco(boolean)
Creates an instance of ECLScreenReco with monitoring initially turned off or on.

Method Index

 o AddECLRecoDebugListener(ECLRecoDebugListener)
Adds the given ECLRecoDebugListener to list of listeners.
 o AddPS(ECLPS)
Adds an ECLPS object (Presentation Space) to the screen recognition system.
 o AddPS(ECLPS, int)
Adds an ECLPS object (Presentation Space) to the screen recognition system.
 o dispose()
Cleans up the object's internal environment.
 o DoReco()
Performs a recognition analysis for all the currently registered screens.
 o IsActive()
Returns the ECLScreenReco monitoring process state.
 o IsMatch(ECLPS, ECLScreenDesc)
Compares the screen in the PS.
 o RegisterScreen(ECLScreenDesc, ECLRecoNotify)
Register an ECLScreenDesc object with the screen recognition system.
 o RegisterScreen(ECLScreenDesc, ECLRecoNotify, boolean)
Register an ECLScreenDesc object with the screen recognition system.
 o RemoveECLRecoDebugListener(ECLRecoDebugListener)
Removes the given ECLRecoDebugListener from list of listeners.
 o RemovePS(ECLPS)
Removes an ECLPS object (Presentation Space) from the screen recognition system.
 o SetActive(boolean)
Starts or stops the ECLScreenReco monitoring process.
 o UnregisterAllScreens()
Removes all registered screens from the screen recognition object.
 o UnregisterScreen(ECLScreenDesc, ECLRecoNotify)
Remove an ECLScreenDesc object and its corresponding ECLRecoNotify object from the screen recognition system.

Constructors

 o ECLScreenReco
 public ECLScreenReco()
Creates an instance of ECLScreenReco.

 o ECLScreenReco
 public ECLScreenReco(boolean active)
Creates an instance of ECLScreenReco with monitoring initially turned off or on.

Parameters:
active - If false, ECLScreenReco will not start monitoring until ECLScreenReco.SetActive is called. If true, monitoring will start with the first call to ECLScreenReco.RegisterScreen

Methods

 o dispose
 public void dispose()
Cleans up the object's internal environment.

 o RegisterScreen
 public void RegisterScreen(ECLScreenDesc sd,
                            ECLRecoNotify notify)
Register an ECLScreenDesc object with the screen recognition system. When the system recognizes the screen it will call the NotifyEvent method in the notify object given. The notify object is an object of an ECLRecoNotify derived class that you defined. It contains the handler or "callback" code for the recognition event. It contains your screen handling code.

Parameters:
sd - ECLScreenDesc object to register
notify - ECLRecoNotify object defined by you
See Also:
ECLRecoNotify, ECLScreenDesc
 o RegisterScreen
 public void RegisterScreen(ECLScreenDesc sd,
                            ECLRecoNotify notify,
                            boolean initEvent)
Register an ECLScreenDesc object with the screen recognition system. When the system recognizes the screen it will call the NotifyEvent method in the notify object given. The notify object is an object of an ECLRecoNotify derived class that you defined. It contains the handler or "callback" code for the recognition event. It contains your screen handling code.

Parameters:
sd - ECLScreenDesc object to register
notify - ECLRecoNotify object defined by you
initEvent - if true, the comparison logic for the screen registered will be run
See Also:
ECLRecoNotify, ECLScreenDesc
 o UnregisterScreen
 public void UnregisterScreen(ECLScreenDesc sd,
                              ECLRecoNotify notify)
Remove an ECLScreenDesc object and its corresponding ECLRecoNotify object from the screen recognition system. Calling this method will cause the NotifyStop method to be called on all ECLRecoNotify derived objects in the screen recognition system.

Parameters:
sd - ECLScreenDesc object to unregister
notify - ECLRecoNotify object to unregister
See Also:
ECLScreenDesc
 o AddPS
 public void AddPS(ECLPS ps)
Adds an ECLPS object (Presentation Space) to the screen recognition system. The system will monitor all ECLPS objects added to it for all ECLScreenDesc objects added to it.

Parameters:
ps - ECLPS object to add
See Also:
ECLPS
 o AddPS
 public void AddPS(ECLPS ps,
                   int eventType)
Adds an ECLPS object (Presentation Space) to the screen recognition system. The system will monitor all ECLPS objects added to it for all ECLScreenDesc objects added to it for the given event type.

Parameters:
ps - ECLPS object to add
eventType - monitor type for the ECLPS object. If ECLPS.HOST_EVENTS is given, only host screen changes will fire recognition events. If ECLPS.USER_EVENTS is given, only user events (typing, mouse activity, etc.) will fire recognition events. If ECLPS.ALL_EVENTS is given, both user and host initiated screen changes will fire recognition events.
See Also:
ECLPS
 o RemovePS
 public void RemovePS(ECLPS ps)
Removes an ECLPS object (Presentation Space) from the screen recognition system.

Parameters:
ps - ECLPS object to remove
See Also:
ECLPS
 o AddECLRecoDebugListener
 public void AddECLRecoDebugListener(ECLRecoDebugListener listener)
Adds the given ECLRecoDebugListener to list of listeners.

Parameters:
listener - The ECLRecoDebugListener to be added
See Also:
removeECLRecoDebugListener
 o RemoveECLRecoDebugListener
 public void RemoveECLRecoDebugListener(ECLRecoDebugListener listener)
Removes the given ECLRecoDebugListener from list of listeners.

Parameters:
listener - The ECLRecoDebugListener to be removed
See Also:
addECLRecoDebugListener
 o SetActive
 public void SetActive(boolean active)
Starts or stops the ECLScreenReco monitoring process.

Parameters:
active - If false, ECLScreenReco will not start monitoring until ECLScreenReco.SetActive is called. If true, monitoring will start with the first call to ECLScreenReco.RegisterScreen
 o IsActive
 public boolean IsActive()
Returns the ECLScreenReco monitoring process state.

Returns:
state of monitoring process
 o DoReco
 public void DoReco()
Performs a recognition analysis for all the currently registered screens. This runs on a separate thread to keep from hanging the caller's code for the duration of the analysis.

 o UnregisterAllScreens
 public void UnregisterAllScreens()
Removes all registered screens from the screen recognition object.

 o IsMatch
 public static boolean IsMatch(ECLPS ps,
                               ECLScreenDesc sd) throws ECLErr
Compares the screen in the PS. If a row or column parameter that was set in AddString, SetCursor, etc. is out of the boundaries of the PS, this method will return false.

Parameters:
ps - Presentation Space object to compare to screen description
sd - Screen description object that defines the screen
Returns:
True if the screen in PS matches, otherwise it is false.
Throws: ECLErr
Thrown if error in comparing ECLScreenReco to PS.
See Also:
ECLScreenDesc, ECLPS

All Packages  Class Hierarchy  This Package  Previous  Next  Index