Class ObserveEvent


  • public class ObserveEvent
    extends java.lang.Object
    provides information about the observed event being in the ObserverCallBack
    • 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 event
      ObserveEvent​(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 type
      java.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 type
      boolean isChange()
      check the observe event type
      boolean isFindFailed()
      check the observe event type
      boolean isGeneric()
      check the observe event type
      boolean isMissing()
      check the observe event type
      boolean isVanish()
      check the observe event type
      void 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 observer
      void stopObserver​(java.lang.String text)
      stops the observer and prints the given text
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 - name
        type - type
        what - to search
        where - 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 - name
        type - type
        v1 - value 1
        v2 - value 2
        v3 - value 3
        now - 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 class java.lang.Object