Package org.sikuli.script
Class ObserveEvent
- java.lang.Object
-
- org.sikuli.script.ObserveEvent
-
public class ObserveEvent extends java.lang.Objectprovides information about the observed event being in theObserverCallBack
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObserveEvent.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()intgetCount()ImagegetImage()MatchgetMatch()java.lang.StringgetName()PatterngetPattern()RegiongetRegion()org.sikuli.script.FindFailedResponsegetResponse()longgetTime()java.lang.StringgetType()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)booleanisAppear()check the observe event typebooleanisChange()check the observe event typebooleanisFindFailed()check the observe event typebooleanisGeneric()check the observe event typebooleanisMissing()check the observe event typebooleanisVanish()check the observe event typevoidrepeat()tell the observer to repeat this event's observe action immediately after returning from this handler (APPEAR, VANISH)voidrepeat(long secs)tell the observer to repeat this event's observe action after given time in secs after returning from this handler (APPEAR, VANISH)voidsetActive()voidsetChanges(java.util.List<Match> actualChanges)voidsetImage(java.lang.Object img)voidsetInactive()voidsetIndex(int index)voidsetMatch(java.lang.Object m)voidsetPattern(java.lang.Object p)voidsetRegion(java.lang.Object r)voidsetResponse(org.sikuli.script.FindFailedResponse resp)voidstopObserver()stops the observervoidstopObserver(java.lang.String text)stops the observer and prints the given textjava.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-