Author: vpakan(a)redhat.com
Date: 2012-08-20 09:19:55 -0400 (Mon, 20 Aug 2012)
New Revision: 43110
Added:
trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
trunk/tests/plugins/org.jboss.tools.tests/resources/
trunk/tests/plugins/org.jboss.tools.tests/resources/lib/
trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
Modified:
trunk/tests/plugins/org.jboss.tools.tests/.classpath
trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/about.html
trunk/tests/plugins/org.jboss.tools.tests/build.properties
Log:
Add screencast recording util.
Modified: trunk/tests/plugins/org.jboss.tools.tests/.classpath
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-20 13:10:24 UTC (rev
43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-20 13:19:55 UTC (rev
43110)
@@ -3,5 +3,6 @@
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib"
path="resources/lib/ScreenRecorder.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-20 13:10:24 UTC
(rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-20 13:19:55 UTC
(rev 43110)
@@ -15,7 +15,8 @@
org.jboss.tools.test.util,
org.jboss.tools.test.util.xpl,
org.jboss.tools.tests
-Bundle-ClassPath: .
+Bundle-ClassPath: .,
+ resources/lib/ScreenRecorder.jar
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Activator: org.jboss.tools.tests.TestsPlugin
Modified: trunk/tests/plugins/org.jboss.tools.tests/about.html
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/about.html 2012-08-20 13:10:24 UTC (rev
43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/about.html 2012-08-20 13:19:55 UTC (rev
43110)
@@ -30,5 +30,15 @@
and such source code may be obtained at
<A
href="http://www.jboss.org/tools">http://www.jboss.org/tools...
+<H3>Third party</H3>
+<P>
+The Content includes Monte Media Library. Use of the Monte Media Library is free for all
uses (non-commercial,
+commercial and educational) under the terms of <A
href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
Attribution 3.0 (CC BY 3.0)</A>.
+<BR>
+<BR>
+Author of Monte Media library is Werner Randelshofer, Immensee, Switzerland.
+<BR>
+<A href="www.randelshofer.ch">www.randelshofer.ch</A>
+</P>
</BODY>
</HTML>
\ No newline at end of file
Modified: trunk/tests/plugins/org.jboss.tools.tests/build.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/build.properties 2012-08-20 13:10:24 UTC
(rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/build.properties 2012-08-20 13:19:55 UTC
(rev 43110)
@@ -10,7 +10,9 @@
plugin.properties,\
about.html,\
.project,\
- .classpath
+ .classpath,\
+ monte-library-license.html,\
+ resources/
bin.includes = .,\
META-INF/,\
testProject1/,\
@@ -18,4 +20,6 @@
plugin.xml,\
plugin_customization.ini,\
plugin.properties,\
- about.html
+ about.html,\
+ monte-library-license.html,\
+ resources/
Added: trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
(rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html 2012-08-20
13:19:55 UTC (rev 43110)
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Pure Java Screen Recorder Demo | License</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/>
+<style type="text/css">
+<!--
+* {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ line-height: 140%;
+ font-weight: normal;
+ font-size: 12px;
+ background-color: #FFFFFF;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+.header {
+ padding-bottom: 20px;
+}
+.header h1 {
+ font-size: 16px;
+ font-weight: bold;
+}
+.header .byline {
+ font-weight: bold;
+}
+.article {
+}
+.article ul {
+ padding-bottom: 10px;
+}
+.toc ul {
+ padding-bottom: 10px;
+}
+.article p {
+ padding-bottom: 12px;
+}
+body {
+ width: 512px;
+ padding-top: 10px;
+ padding-right: 10px;
+ padding-bottom: 20px;
+ padding-left: 10px;
+}
+.article h1 {
+ font-size: 16px;
+ font-weight: bold;
+ padding-top: 10px;
+}
+.article h2 {
+ font-weight: bold;
+ padding-top: 10px;
+}
+-->
+</style>
+</head>
+
+<body>
+<div class="header" >
+ <h1>Pure Java Screen Recorder Demo</h1>
+ <p class="byline">License</p>
+</div>
+<div class="toc" >
+ <h1>Table of Contents</h1>
+ <ul>
+ <li><a href="#disclaimer">Disclaimer</a></li>
+ <li><a href="#Fee2">License Fee</a></li>
+ <li><a href="#Fee">License Terms</a></li>
+ <li><a href="#Copyright">Copyright</a></li>
+ </ul>
+</div>
+<div class="article" >
+ <h1><a name="disclaimer"
id="disclaimer"></a>Disclaimer</h1>
+ <p>Use of the demo is entirely at your own risk. I will not be
+ liable for any data
+ loss, hardware damage or whatever this program might cause. </p>
+ <h1 class="semiparagraph"><a name="Fee"
id="Fee2"></a>License Fee</h1>
+ <p>Use of the demo iis free for all uses, including personal use, educational
use, and commercial use.</p>
+ <h1></h1>
+ <h1><a name="Terms" id="Terms"></a>License
Terms</h1>
+ <p>You can license the demo under the terms of the <a
href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
Attribution 3.0</a> license.</p>
+ <h2> You are free:</h2>
+ <ul>
+ <li>to Share — to copy, distribute and transmit the work</li>
+ <li> to Remix — to adapt the work</li>
+ </ul>
+ <h2> Under the following conditions:</h2>
+ <ul>
+ <li> Attribution. You must keep an attribution to the author, Werner
Randelshofer, in the source files (but not in any way that suggests that they endorse you
or your use of the work).</li>
+ </ul>
+ <p> For any reuse or distribution, you must make clear to others the license
terms of this work. The best way to do this is with a link to <a
href="http://creativecommons.org/licenses/by/3.0/">this web
page</a>.</p>
+ <p>Any of the above conditions can be waived if you get permission from the
copyright holder.</p>
+ <p>Nothing in this license impairs or restricts the author's moral
rights.</p>
+ <h1><a name="Copyright"
id="Copyright"></a>Copyright</h1>
+ <h5 class="semiparagraph">Pure Java Screen Recorder Demo ©
2008-2011</h5>
+ <p> Werner Randelshofer, Hausmatt 10, Immensee,
+ CH-6405, Switzerland<br />
+ <a
href="http://www.randelshofer.ch/">http://www.randelshofer.ch/</a><br
/>
+ <a
href="mailto:werner.randelshofer@bluewin.ch">werner.randelshofer@bluewin.ch<br
/>
+ </a>All Rights Reserved.</p>
+</div>
+</body>
+</html>
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java 2012-08-20
13:19:55 UTC (rev 43110)
@@ -0,0 +1,152 @@
+package org.jboss.tools.test.util;
+
+import static org.monte.media.FormatKeys.EncodingKey;
+import static org.monte.media.FormatKeys.FrameRateKey;
+import static org.monte.media.FormatKeys.KeyFrameIntervalKey;
+import static org.monte.media.FormatKeys.MIME_QUICKTIME;
+import static org.monte.media.FormatKeys.MediaTypeKey;
+import static org.monte.media.FormatKeys.MimeTypeKey;
+import static org.monte.media.VideoFormatKeys.CompressorNameKey;
+import static org.monte.media.VideoFormatKeys.DepthKey;
+import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_ANIMATION;
+import static org.monte.media.VideoFormatKeys.QualityKey;
+
+import java.awt.AWTException;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.io.File;
+import java.io.IOException;
+
+import org.monte.screenrecorder.ScreenRecorder;
+import org.monte.media.Format;
+import org.monte.media.Registry;
+import org.monte.media.FormatKeys.MediaType;
+import org.monte.media.math.Rational;
+/**
+ * Extends ScreenRecorder class due to possibility to specify location
+ * of file with recorder screen cast
+ * @author Vlado Pakan
+ *
+ * ScreenRecorder class was created by Werner Randelshofer, Immensee, Switzerland.
+ *
www.randelshofer.ch
+ *
+ * Use of the Monte Media Library is free for all uses (non-commercial, commercial and
educational)
+ * under the terms of Creative Commons Attribution 3.0 (CC BY 3.0).
+ *
http://creativecommons.org/licenses/by/3.0/
+ *
+ */
+public class ScreenRecorderExt extends ScreenRecorder{
+ private String useFileName = null;
+ public static final String STATE_DONE = "DONE";
+ public static final String STATE_RECORDING = "RECORDING";
+ public static final String STATE_FAILED = "FAILED";
+
+ /**
+ * Default constructor for .mov screen cast file
+ * @throws IOException
+ * @throws AWTException
+ */
+ public ScreenRecorderExt() throws IOException, AWTException {
+ this(GraphicsEnvironment
+ .getLocalGraphicsEnvironment()
+ .getDefaultScreenDevice()
+ .getDefaultConfiguration(),
+ new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_QUICKTIME),
+ new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
+ ENCODING_QUICKTIME_ANIMATION, CompressorNameKey,
+ ENCODING_QUICKTIME_ANIMATION, DepthKey, (int) 24,
+ FrameRateKey, Rational.valueOf(15), QualityKey, 1.0f,
+ KeyFrameIntervalKey, (int) (15 * 60)),
+ new Format(MediaTypeKey,
+ MediaType.VIDEO, EncodingKey, "black", FrameRateKey,
+ Rational.valueOf(30)),
+ null);
+ }
+ /**
+ * Creates ScreenRecorderExt instance with parametrs
+ * @param cfg
+ * @param fileFormat
+ * @param screenFormat
+ * @param mouseFormat
+ * @param audioFormat
+ * @throws IOException
+ * @throws AWTException
+ */
+ public ScreenRecorderExt(GraphicsConfiguration cfg, Format fileFormat,
+ Format screenFormat, Format mouseFormat, Format audioFormat)
+ throws IOException, AWTException {
+ super(cfg, fileFormat, screenFormat, mouseFormat, audioFormat);
+ }
+
+ /**
+ * Start screen cast recording to specified file name
+ * @param fileName
+ * @throws IOException
+ */
+ public void start(String fileName) throws IOException{
+ this.useFileName = fileName;
+ super.start();
+ }
+ /**
+ * Start screen cast recording to default file name
+ * @throws IOException
+ */
+ @Override
+ public void start() throws IOException{
+ this.useFileName = null;
+ super.start();
+ }
+ /**
+ * Create movie file for recorder screen cast. Screen cast will be stored
+ * to file specified within proceeding start() method invocation
+ *
+ */
+ @Override
+ protected File createMovieFile(Format fileFormat) throws IOException {
+ File fileToWriteMovie;
+ if (this.useFileName == null || this.useFileName.length() == 0){
+ fileToWriteMovie = super.createMovieFile(fileFormat);
+ }
+ else {
+ if (this.useFileName.indexOf('.') < 0){
+ this.useFileName += '.' +
Registry.getInstance().getExtension(fileFormat);
+ }
+ fileToWriteMovie = new File(this.useFileName);
+ if (fileToWriteMovie.exists()){
+ fileToWriteMovie.delete();
+ }
+ }
+
+ return fileToWriteMovie;
+ }
+
+ /**
+ * Returns true if state of Screen Recorder is as specified by parameter state
+ * @param state
+ * @return
+ */
+ public boolean isState(String state) {
+ boolean result = false;
+
+ if (state.equals(ScreenRecorderExt.STATE_DONE) &&
getState().equals(State.DONE)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_RECORDING) &&
getState().equals(State.RECORDING)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_RECORDING) &&
getState().equals(State.RECORDING)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_FAILED) &&
getState().equals(State.FAILED)){
+ result = true;
+ }
+
+ return result;
+ }
+ /**
+ * Overrides parent definition.
+ * Defined to not have access restriction warning
+ */
+ @Override
+ public void stop() throws IOException{
+ super.stop();
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain