org.autoplot.ScreenshotsTool

Jeremy's experiment that will create automatic documentation. This is intended to provide a means for users to more easily communicate and to make it easier to create documentation. This is being modified a bit, namely to delay work such as screening private regions, to improve responsiveness and to allow the user the option of screening or not.

ScreenshotsTool( java.awt.Window parent, String outLocationFolder )

create a new ScreenshotsTool, which will write screenshots to the location.

ScreenshotsTool( java.awt.Window parent, String outLocationFolder, boolean clearFolder )

create a new ScreenshotsTool, which will write screenshots to the location. The output folder must not exist or be empty, or clearFolder must be set to true. This is created and then pushed to the event stack, so that screenshots will be taken when activity occurs (see start which manages this), or will takePicture is called to manually take screenshots (e.g. from scripts). When the session is done, requestFinish is called to clean up.


dispatchEvent

dispatchEvent( java.awt.AWTEvent theEvent ) → void

Parameters

theEvent - an AWTEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getScreenShot

getScreenShot( ) → BufferedImage

get a screenshot of the display Autoplot's main UI is running within.

Returns:

a java.awt.image.BufferedImage

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getScreenShot( int active ) → BufferedImage

getScreenShotNoPointer

getScreenShotNoPointer( ) → BufferedImage

get a screenshot of the display Autoplot's main UI is running within, but without the pointer.

Returns:

a java.awt.image.BufferedImage

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getTrim

getTrim( java.io.File root, ProgressMonitor monitor ) → Rectangle

return the common bounding rectangle to all png images in the directory.

Parameters

root - folder containing png images.
monitor - progress monitor for the task

Returns:

the rectangle common to all images.

See Also:

getTrim(java.awt.image.BufferedImage)


[search for examples] [view on GitHub] [view on old javadoc] [view source]

getTrim( java.awt.image.BufferedImage source ) → Rectangle

requestFinish

requestFinish( boolean trimAll ) → void

This was introduced to provide a method for Jemmy tests to record videos (so that videos are tested), but it looks like this won't work. However this would probably be useful from scripts, so I will leave it.

Parameters

trimAll - trim off the portions of all screenshots which are not used.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


start

start( java.awt.Window parent ) → void

start should be called from the event thread.

Parameters

parent - the device

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


takePicture

takePicture( int id ) → void

manually trigger a screenshot, which is put in the output directory.

Parameters

id - user-provided id (≤ 99999) for the image, which is the last part of the filename.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

takePicture( int id, String caption ) → void
takePicture( int id, String caption, java.awt.Component c, java.awt.Point p, int buttons ) → void

trim

trim( java.awt.image.BufferedImage image ) → BufferedImage

trim off the excess white to make a smaller image

Parameters

image - a BufferedImage

Returns:

a java.awt.image.BufferedImage

[search for examples] [view on GitHub] [view on old javadoc] [view source]

trim( java.awt.image.BufferedImage image, java.awt.Rectangle r ) → BufferedImage

trimAll

trimAll( java.io.File dir ) → void

find the common trim bounding box and trim all the images in the directory.

Parameters

dir - a File

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

trimAll( java.io.File dir, java.awt.Rectangle r, ProgressMonitor monitor ) → void