Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Javadoc plugin to generate javadocs #66

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.sikuli.org/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>doubleshow</id>
<name>Tom Yeh</name>
<email>[email protected]</email>
</developer>
</developers>

<groupId>org.sikuli</groupId>
<artifactId>sikuli-api</artifactId>
<name>sikuli-api</name>
<url>http://www.sikuli.org</url>
<version>1.0.9-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.sikuli</groupId>
Expand Down Expand Up @@ -64,20 +59,12 @@
<version>1.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<type>maven-plugin</type>
</dependency>
</dependencies>

<scm>
<connection>scm:git:[email protected]:doubleshow/sikuli-api.git</connection>
<developerConnection>scm:git:[email protected]:doubleshow/sikuli-api.git</developerConnection>
<url>[email protected]:doubleshow/sikuli-api.git</url>
</scm>

<build>
<plugins>
<plugin>
Expand All @@ -91,5 +78,17 @@
</plugin>
</plugins>
</build>

</project>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
<show>public</show>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import org.sikuli.api.robot.Keyboard;
import org.sikuli.api.robot.Mouse;


/**
* A DesktopKeyboard object is used to generate native keyboard events.
*
*/
public class DesktopKeyboard implements Keyboard {
static private int modifiers;
static private String _hold_keys = "";
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/sikuli/api/robot/desktop/DesktopMouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

import org.sikuli.api.ScreenLocation;
import org.sikuli.api.robot.Mouse;

/**
* A DesktopMouse object is used to generate native mouse events.
*
*/
public class DesktopMouse implements Mouse {

private AWTMouse getAWTMouse(ScreenLocation screenLoc){
Expand Down
31 changes: 27 additions & 4 deletions src/main/java/org/sikuli/api/util/ScreenRegionRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,32 @@
import org.slf4j.LoggerFactory;

import com.google.common.io.Files;

/**
* The ScreenRegionRecorder class is used to video record a screen region.
*
*/
public class ScreenRegionRecorder{

private Logger logger = LoggerFactory.getLogger(getClass());

volatile boolean stopped = false;
/**
* The default capture interval: 200 ms
*/
public int captureInterval = 200;
/**
* The captured image file.
*/
public File store;

final private File output;
final private ScreenRegion screenRegion;
/**
* Constructs a new ScreenRegionRecorder on the specified ScreenRegion.
*
* @param screenRegion the screen region to be captured.
* @param output the output file to save the screen recording in Quicktime format (.mov)
*/
public ScreenRegionRecorder(ScreenRegion screenRegion, File output) {
this.output = output;
this.screenRegion = screenRegion;
Expand All @@ -43,7 +58,9 @@ void recordFrame() throws IOException{
ImageIO.write(image, "jpeg", new File(store, System.currentTimeMillis() + ".jpeg"));
}

// wait for all pending tasks to complete
/**
* Waits for all pending tasks to complete.
*/
public static void awaitTermination(){
// wait for all capturing threads to finish
for (Thread t : capturingThreads){
Expand Down Expand Up @@ -72,7 +89,9 @@ public static void awaitTermination(){
private Thread capturingThread = null;

volatile boolean recording = false;

/**
* Stops capturing frames from this ScreenRegion.
*/
synchronized public void stop(){
stopped = true;
}
Expand Down Expand Up @@ -104,7 +123,11 @@ public void run() {
submitMakeMovieJob();
}
};

/**
* Starts capturing frames from this ScreenRegion for the specified duration.
*
* @param duration the recording duration in milliseconds.
*/
synchronized public void start(int duration){
if (capturingThread != null && capturingThread.isAlive())
return;
Expand Down
Loading