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
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
setStopOnFirstEvent
public static void setStopOnFirstEvent()
tell the next starting observer, to stop on the first event
-
getStopOnFirstEvent
public static boolean getStopOnFirstEvent()
-
addRunningObserver
public static void addRunningObserver(Region r)
-
removeRunningObserver
public static void removeRunningObserver(Region r)
-
add
public static String add(Region reg, ObserverCallBack obs, ObserveEvent.Type type, Object target)
-
setInactive
public void setInactive(String name)
set the observer with the given name inactive (not checked while observing)- Parameters:
name-
-
setActive
public void setActive(String name)
set the observer with the given name active (checked while observing)- Parameters:
name-
-
setActive
public static void setActive(String name, boolean state)
-
remove
public static void remove(String name)
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
public static void remove(Region reg)
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
public static boolean hasEvents(Region reg)
are their any happened events for this region?- Parameters:
reg-- Returns:
- true if yes
-
hasEvent
public static boolean hasEvent(String name)
are their any happened events for the observer having this name?- Parameters:
name-- Returns:
- true if yes
-
addEvent
public static void addEvent(ObserveEvent evt)
-
getEvents
public static ObserveEvent[] getEvents(Region reg)
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
public static ObserveEvent[] getEvents()
return all events (they are preserved)- Returns:
- the array of events or size 0 array if none
-
getEvent
public static ObserveEvent getEvent(String name)
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
-
-