org.sikuli.api
Interface Target

All Known Implementing Classes:
ColorImageTarget, DefaultTarget, ForegroundTarget, ImageTarget, MultiStateTarget, StyledRectangleTarget

public interface Target

The Target interface allows you to specify what targets to find or wait for and also to specify several control parameters. It is intended mainly to passed as an input argument to target finding functions such as ScreenRegion.find(Target) and ScreenRegion.findAll(Target).

The Target class is an abstract base class. As such, you should not use this class directly. Instead, you should use one of the concrete classes inheriting from this class, such as ImageTarget, TextTarget, StyledRectangleTarget, MultiStateTarget, ColorImageTarget, and ForegroundTarget.

Author:
Tom Yeh (tom.yeh@colorado.edu)

Nested Class Summary
static class Target.Ordering
          Defines a set of constants to use to indicate how multiple targets should be ordered by find functions
 
Method Summary
 List<ScreenRegion> doFindAll(ScreenRegion screenRegion)
          Sorts all found instances of a screenRegion objects according to the Ordering value of this Target.
 int getLimit()
          Returns the limit on the number of matched targets to return.
 double getMinScore()
          Returns the minimum matching score of this Target.
 Target.Ordering getOrdering()
          Returns the Ordering of matched targets this Target uses.
 void setLimit(int limit)
          Sets the limit on the number of matched targets to return.
 void setMinScore(double minScore)
          Sets the minimum matching score.
 void setOrdering(Target.Ordering ordering)
          Sets the ordering of the matched targets.
 

Method Detail

getMinScore

double getMinScore()
Returns the minimum matching score of this Target. This value controls how "fuzzy" the image matching should be. The score should be between 0 and 1, where 1 is the most precise (least fuzzy), and 0 is the least precise (most fuzzy).

Returns:
the minimum matching score value for a target to be considered a match.

setMinScore

void setMinScore(double minScore)
Sets the minimum matching score. This controls how "fuzzy" the image matching should be. The score should be between 0 and 1, where 1 is the most precise (least fuzzy), and 0 is the least precise (most fuzzy).

Parameters:
minScore - the minimum matching score value for a target to be considered a match.

getLimit

int getLimit()
Returns the limit on the number of matched targets to return.

Returns:
the number of matched targets this Target returns.

setLimit

void setLimit(int limit)
Sets the limit on the number of matched targets to return.

Parameters:
limit - the number of matches used by this Target

getOrdering

Target.Ordering getOrdering()
Returns the Ordering of matched targets this Target uses. The Ordering value indicates how multiple targets are ordered by find related functions.

Returns:
the Ordering of the matched targets for this Target.

setOrdering

void setOrdering(Target.Ordering ordering)
Sets the ordering of the matched targets.

Parameters:
ordering - the Ordering of the matched targets for this Target

doFindAll

List<ScreenRegion> doFindAll(ScreenRegion screenRegion)
Sorts all found instances of a screenRegion objects according to the Ordering value of this Target.

Parameters:
screenRegion - the ScreenRegion to be sorted with other unsorted regions.
Returns:
a sorted list of ScreenRegions.


Copyright © 2014. All rights reserved.