org.sikuli.api.visual
Class ScreenRegionCanvas

java.lang.Object
  extended by org.sikuli.api.visual.Canvas
      extended by org.sikuli.api.visual.ScreenRegionCanvas
Direct Known Subclasses:
DesktopCanvas

public class ScreenRegionCanvas
extends Canvas


Constructor Summary
ScreenRegionCanvas(ScreenRegion screenRegion)
          Constructs a new DesktopCanvas whose screen region is specified with the argument of the same name.
 
Method Summary
 BufferedImage createImage()
           
 void display(double seconds)
          Displays a canvas for the specified duration.
 void display(int seconds)
          Displays a canvas for the specified duration.
 void displayWhile(Runnable runnable)
          Displays the canvas and blocks the calling thread, while running the passed runnable on a background thread.
 ScreenRegion getScreenRegion()
          Returns the ScreenRegion of this ScreenRegionCanvas object.
 void hide()
          Clears the shown canvas.
 void refresh()
           
 void setScreenRegion(ScreenRegion screenRegion)
          Sets the ScreenRegion of this ScreenRegionCanvas object.
 void show()
          Shows a canvas.
 
Methods inherited from class org.sikuli.api.visual.Canvas
add, add, addBox, addCircle, addDot, addImage, addLabel, addLabel, clear
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenRegionCanvas

public ScreenRegionCanvas(ScreenRegion screenRegion)
Constructs a new DesktopCanvas whose screen region is specified with the argument of the same name.

Parameters:
screenRegion - the specified screen region of the Canvas.
Method Detail

display

public void display(int seconds)
Description copied from class: Canvas
Displays a canvas for the specified duration. This method blocks the calling thread for the specified duration.

Overrides:
display in class Canvas
Parameters:
seconds - the specified duration in seconds.

display

public void display(double seconds)
Description copied from class: Canvas
Displays a canvas for the specified duration. This method blocks the calling thread for the specified duration.

Specified by:
display in class Canvas
Parameters:
seconds - the specified duration in seconds.

displayWhile

public void displayWhile(Runnable runnable)
Description copied from class: Canvas
Displays the canvas and blocks the calling thread, while running the passed runnable on a background thread. When the passed Runnable completes, this method returns immediately and hides the canvas.

Specified by:
displayWhile in class Canvas
Parameters:
runnable - A runnable to run in the background.

show

public void show()
Description copied from class: Canvas
Shows a canvas. This is a non-blocking method. The canvas should be hidden using the Canvas.hide() method.

Specified by:
show in class Canvas

refresh

public void refresh()

hide

public void hide()
Description copied from class: Canvas
Clears the shown canvas.

Specified by:
hide in class Canvas

createImage

public BufferedImage createImage()
Specified by:
createImage in class Canvas

getScreenRegion

public ScreenRegion getScreenRegion()
Returns the ScreenRegion of this ScreenRegionCanvas object.

Returns:
the ScreenRegion object.

setScreenRegion

public void setScreenRegion(ScreenRegion screenRegion)
Sets the ScreenRegion of this ScreenRegionCanvas object.

Parameters:
screenRegion - the specified ScreenRegion.


Copyright © 2014. All rights reserved.