org.sikuli.api
Class DefaultTarget

java.lang.Object
  extended by org.sikuli.api.DefaultTarget
All Implemented Interfaces:
Target
Direct Known Subclasses:
ForegroundTarget, ImageTarget, MultiStateTarget

public abstract class DefaultTarget
extends Object
implements Target

DefaultTarget is the abstract base class for all targets.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sikuli.api.Target
Target.Ordering
 
Constructor Summary
DefaultTarget()
          Constructs a Target with default parameters
 
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 DefaultTarget.
 Target.Ordering getOrdering()
          Returns the Ordering of matched targets this DefaultTarget 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.
 BufferedImage toImage()
          Gets the image representation of this target for visualization purposes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTarget

public DefaultTarget()
Constructs a Target with default parameters

Method Detail

getMinScore

public double getMinScore()
Returns the minimum matching score of this DefaultTarget. The score should be between 0 and 1 where 1 is the best.

Specified by:
getMinScore in interface Target
Returns:
the minimum matching score value for a target to be considered a match.

setMinScore

public 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).

Specified by:
setMinScore in interface Target
Parameters:
minScore -

getLimit

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

Specified by:
getLimit in interface Target
Returns:
the limit on the number of matches to return.

setLimit

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

Specified by:
setLimit in interface Target
Parameters:
limit - the number of matches

getOrdering

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

Specified by:
getOrdering in interface Target
Returns:
the Ordering of the matched targets for this Target.

setOrdering

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

Specified by:
setOrdering in interface Target
Parameters:
ordering - the Ordering of the matched targets for this Target.

doFindAll

public List<ScreenRegion> doFindAll(ScreenRegion screenRegion)
Description copied from interface: Target
Sorts all found instances of a screenRegion objects according to the Ordering value of this Target.

Specified by:
doFindAll in interface Target
Parameters:
screenRegion - the ScreenRegion to be sorted with other unsorted regions.
Returns:
a sorted list of ScreenRegions.

toImage

public BufferedImage toImage()
Gets the image representation of this target for visualization purposes

Returns:
a BufferedImage object


Copyright © 2014. All rights reserved.