Package org.sikuli.script.support
Class Observing
java.lang.Object
org.sikuli.script.support.Observing
public class Observing extends Object
INTERNAL USE ONLY --- NOT part of the official API
This class globally collects
all running observations and tracks the created events.
-
Method Summary
Modifier and Type Method Description static Stringadd(Region reg, ObserverCallBack obs, ObserveEvent.Type type, Object target)static voidaddEvent(ObserveEvent evt)static voidaddRunningObserver(Region r)static voidcleanUp()stop and remove all observers and their registered eventsstatic voidclearEvents()the event list is purgedstatic ObserveEventgetEvent(String name)retrieves and removes the requested eventstatic ObserveEvent[]getEvents()return all events (they are preserved)static ObserveEvent[]getEvents(Region reg)return the events for that region
events are removed from the liststatic booleangetStopOnFirstEvent()static booleanhasEvent(String name)are their any happened events for the observer having this name?static booleanhasEvents()are their any happened eventsstatic booleanhasEvents(Region reg)are their any happened events for this region?static voidremove(String name)remove the observer from the list, a region observer will be stopped
events for that observer are removed as wellstatic voidremove(Region reg)stop and remove all observers registered for this region from the list
events for those observers are removed as wellstatic voidremoveRunningObserver(Region r)voidsetActive(String name)set the observer with the given name active (checked while observing)static voidsetActive(String name, boolean state)voidsetInactive(String name)set the observer with the given name inactive (not checked while observing)static voidsetStopOnFirstEvent()tell the next starting observer, to stop on the first event
-
Method Details
-
setStopOnFirstEvent
public static void setStopOnFirstEvent()tell the next starting observer, to stop on the first event -
getStopOnFirstEvent
public static boolean getStopOnFirstEvent() -
addRunningObserver
-
removeRunningObserver
-
add
-
setInactive
set the observer with the given name inactive (not checked while observing)- Parameters:
name-
-
setActive
set the observer with the given name active (checked while observing)- Parameters:
name-
-
setActive
-
remove
remove the observer from the list, a region observer will be stopped
events for that observer are removed as well- Parameters:
name- name of observer
-
remove
stop and remove all observers registered for this region from the list
events for those observers are removed as well- Parameters:
reg-
-
cleanUp
public static void cleanUp()stop and remove all observers and their registered events -
hasEvents
public static boolean hasEvents()are their any happened events- Returns:
- true if yes
-
hasEvents
are their any happened events for this region?- Parameters:
reg-- Returns:
- true if yes
-
hasEvent
are their any happened events for the observer having this name?- Parameters:
name-- Returns:
- true if yes
-
addEvent
-
getEvents
return the events for that region
events are removed from the list- Parameters:
reg-- Returns:
- the array of events or size 0 array if none
-
getEvents
return all events (they are preserved)- Returns:
- the array of events or size 0 array if none
-
getEvent
retrieves and removes the requested event- Parameters:
name- of event- Returns:
- the event or null
-
clearEvents
public static void clearEvents()the event list is purged
-