Class ObserveEvent

java.lang.Object
org.sikuli.script.ObserveEvent
Direct Known Subclasses:
SikuliEvent

public class ObserveEvent
extends Object
provides information about the observed event being in the ObserverCallBack
  • Constructor Details

  • Method Details

    • getType

      public 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()
    • setVals

      protected void setVals​(Object v1, Object v2, Object v3)
      for type GENERIC: 3 values can be stored in the event (the value's type is known by creator and user of getVals as some private protocol)
      Parameters:
      v1 -
      v2 -
      v3 -
    • getVals

      public 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 String getName()
      Returns:
      the observer name of this event
    • getRegion

      public Region getRegion()
      Returns:
      this event's observer's region
    • setRegion

      public void setRegion​(Object r)
    • getMatch

      public Match getMatch()
      Returns:
      the observed match (APEAR, VANISH)
    • setMatch

      public void setMatch​(Object m)
    • setIndex

      public void setIndex​(int index)
    • getChanges

      public List<Match> getChanges()
      Returns:
      a list of observed changes as matches (CHANGE)
    • setChanges

      public void setChanges​(List<Match> actualChanges)
    • getPattern

      public Pattern getPattern()
      Returns:
      the used pattern for this event's observing
    • setPattern

      public void setPattern​(Object p)
    • getImage

      public Image getImage()
    • setImage

      public void setImage​(Object img)
    • setResponse

      public void setResponse​(FindFailedResponse resp)
    • getResponse

      public 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​(String text)
      stops the observer and prints the given text
      Parameters:
      text - text
    • toString

      public String toString()
      Overrides:
      toString in class Object