Package org.sikuli.script
Class ObserveEvent
- java.lang.Object
-
- org.sikuli.script.ObserveEvent
-
public class ObserveEvent extends java.lang.Object
provides information about the observed event being in theObserverCallBack
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObserveEvent.Type
-
Constructor Summary
Constructors Constructor Description ObserveEvent()
ObserveEvent(java.lang.String name, ObserveEvent.Type type, java.lang.Object v1, java.lang.Object v2, java.lang.Object v3, long now)
INTERNAL: creates an observed eventObserveEvent(java.lang.String name, ObserveEvent.Type type, org.sikuli.script.Element what, org.sikuli.script.Element where)
INTERNAL: creates an observed event
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Match>
getChanges()
int
getCount()
Image
getImage()
Match
getMatch()
java.lang.String
getName()
Pattern
getPattern()
Region
getRegion()
org.sikuli.script.FindFailedResponse
getResponse()
long
getTime()
java.lang.String
getType()
get the observe event typejava.lang.Object[]
getVals()
for type GENERIC: (the value's type is known by creator and user of getVals as some private protocol)boolean
isAppear()
check the observe event typeboolean
isChange()
check the observe event typeboolean
isFindFailed()
check the observe event typeboolean
isGeneric()
check the observe event typeboolean
isMissing()
check the observe event typeboolean
isVanish()
check the observe event typevoid
repeat()
tell the observer to repeat this event's observe action immediately after returning from this handler (APPEAR, VANISH)void
repeat(long secs)
tell the observer to repeat this event's observe action after given time in secs after returning from this handler (APPEAR, VANISH)void
setActive()
void
setChanges(java.util.List<Match> actualChanges)
void
setImage(java.lang.Object img)
void
setInactive()
void
setIndex(int index)
void
setMatch(java.lang.Object m)
void
setPattern(java.lang.Object p)
void
setRegion(java.lang.Object r)
void
setResponse(org.sikuli.script.FindFailedResponse resp)
void
stopObserver()
stops the observervoid
stopObserver(java.lang.String text)
stops the observer and prints the given textjava.lang.String
toString()
-
-
-
Constructor Detail
-
ObserveEvent
public ObserveEvent()
-
ObserveEvent
public ObserveEvent(java.lang.String name, ObserveEvent.Type type, org.sikuli.script.Element what, org.sikuli.script.Element where)
INTERNAL: creates an observed event- Parameters:
name
- nametype
- typewhat
- to searchwhere
- to search
-
ObserveEvent
public ObserveEvent(java.lang.String name, ObserveEvent.Type type, java.lang.Object v1, java.lang.Object v2, java.lang.Object v3, long now)
INTERNAL: creates an observed event- Parameters:
name
- nametype
- typev1
- value 1v2
- value 2v3
- value 3now
- now
-
-
Method Detail
-
getType
public java.lang.String getType()
get the observe event type- Returns:
- a string containing either APPEAR, VANISH, CHANGE or GENERIC
-
isAppear
public boolean isAppear()
check the observe event type- Returns:
- true if it is APPEAR, false otherwise
-
isVanish
public boolean isVanish()
check the observe event type- Returns:
- true if it is VANISH, false otherwise
-
isChange
public boolean isChange()
check the observe event type- Returns:
- true if it is CHANGE, false otherwise
-
isGeneric
public boolean isGeneric()
check the observe event type- Returns:
- true if it is GENERIC, false otherwise
-
isFindFailed
public boolean isFindFailed()
check the observe event type- Returns:
- true if it is FINDFAILED, false otherwise
-
isMissing
public boolean isMissing()
check the observe event type- Returns:
- true if it is MISSING, false otherwise
-
setActive
public void setActive()
-
setInactive
public void setInactive()
-
getVals
public java.lang.Object[] getVals()
for type GENERIC: (the value's type is known by creator and user of getVals as some private protocol)- Returns:
- an array with the 3 stored values (might be null)
-
getName
public java.lang.String getName()
- Returns:
- the observer name of this event
-
getRegion
public Region getRegion()
- Returns:
- this event's observer's region
-
setRegion
public void setRegion(java.lang.Object r)
-
getMatch
public Match getMatch()
- Returns:
- the observed match (APEAR, VANISH)
-
setMatch
public void setMatch(java.lang.Object m)
-
setIndex
public void setIndex(int index)
-
getChanges
public java.util.List<Match> getChanges()
- Returns:
- a list of observed changes as matches (CHANGE)
-
setChanges
public void setChanges(java.util.List<Match> actualChanges)
-
getPattern
public Pattern getPattern()
- Returns:
- the used pattern for this event's observing
-
setPattern
public void setPattern(java.lang.Object p)
-
getImage
public Image getImage()
-
setImage
public void setImage(java.lang.Object img)
-
setResponse
public void setResponse(org.sikuli.script.FindFailedResponse resp)
-
getResponse
public org.sikuli.script.FindFailedResponse getResponse()
-
getTime
public long getTime()
-
repeat
public void repeat()
tell the observer to repeat this event's observe action immediately after returning from this handler (APPEAR, VANISH)
-
repeat
public void repeat(long secs)
tell the observer to repeat this event's observe action after given time in secs after returning from this handler (APPEAR, VANISH)- Parameters:
secs
- seconds
-
getCount
public int getCount()
- Returns:
- the number how often this event has already been triggered until now
-
stopObserver
public void stopObserver()
stops the observer
-
stopObserver
public void stopObserver(java.lang.String text)
stops the observer and prints the given text- Parameters:
text
- text
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-