Class Match

    • Constructor Detail

      • Match

        public Match()
      • Match

        public Match​(Match m)
        create a copy of Match object
        to e.g. set another TargetOffset for same match
        Parameters:
        m - other Match
      • Match

        public Match​(Region reg,
                     double sc)
        create a Match from a region with given SimScore
        Parameters:
        reg - Region
        sc - SimScore
      • Match

        protected Match​(Rectangle rect,
                        double confidence,
                        String text)
      • Match

        public Match​(int _x,
                     int _y,
                     int _w,
                     int _h,
                     double score,
                     IScreen _parent)
    • Method Detail

      • setOnScreen

        public void setOnScreen​(boolean state)
      • getIndex

        public int getIndex()
      • setIndex

        public void setIndex​(int index)
      • setTimes

        public void setTimes​(long ftime,
                             long stime)
        INTERNAL USE set the elapsed times from search
        Parameters:
        ftime - time
        stime - time
      • getTime

        public long getTime()
        Returns:
        this Match's actual waiting time from last successful find
      • getScore

        public double getScore()
        the match score
        Returns:
        a decimal value between 0 (no match) and 1 (exact match)
      • getTarget

        public Location getTarget()
        convenience method
        Overrides:
        getTarget in class Region
        Returns:
        the point defined by target offset (if set) or the center
      • setTargetOffset

        public void setTargetOffset​(Location offset)
        like Pattern.targetOffset sets the click target by offset relative to the center
        Parameters:
        offset - as a Location
      • setTargetOffset

        public void setTargetOffset​(int x,
                                    int y)
        like Pattern.targetOffset sets the click target relative to the center
        Parameters:
        x - x offset
        y - y offset
      • setImage

        protected void setImage​(Image img)
        set the image after finding with success
        Parameters:
        img - Image
      • getImage

        public Image getImage()
        get the image used for searching
        Overrides:
        getImage in class Region
        Returns:
        image or null
      • getImageFilename

        public String getImageFilename()
        get the filename of the image used for searching
        Returns:
        filename
      • getText

        public String getText()
        Returns:
        the text stored by findWord, findLine, ...
      • setText

        protected void setText​(String text)
        internally used to set the text found by findWord, findLine, ...
        Parameters:
        text -
      • toString

        public String toString()
        Description copied from class: Region
        Overrides:
        toString in class Region
        Returns:
        the description
      • setTarget

        public void setTarget​(int tx,
                              int ty)
        INTERNAL USE
        Parameters:
        tx - x
        ty - y