tag:blogger.com,1999:blog-23306992296286130072024-02-18T17:32:30.295-08:00Programmer in troublePaul Weiberthttp://www.blogger.com/profile/07834672159124826665noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2330699229628613007.post-82235376750321355572013-07-25T09:13:00.001-07:002013-07-25T09:16:49.766-07:00PlayN / tripleplay - Simple Progressbar<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
Since there is no default progressbar widget in the tripleplay gui framework, I've build my own one. Feel free to use, improvements are appreciated. I use it for the visualization of creature's lifeenergy in my game. </div>
<div style="text-align: left;">
<br /></div>
</div>
<pre class="brush:java">
package de.creaturewars.client.gui;
import tripleplay.ui.Background;
import tripleplay.ui.SizableGroup;
import tripleplay.ui.Style;
import tripleplay.ui.layout.AxisLayout;
/**
*
* @author Paul Weibert
*
*/
public class ProgressBar extends SizableGroup {
private final int BAR_COLOR = 0xff379aff;
private final int EMPTY_COLOR = 0xff000000;
private float maxValue = 100;
private float value = 0;
private SizableGroup bar;
private float barHeight = 10;
public ProgressBar(float width, float height) {
super(AxisLayout.horizontal());
this.preferredSize.update(width, height);
this.addStyles(Style.HALIGN.left);
this.bar = new SizableGroup(AxisLayout.horizontal());
this.addStyles(Style.BACKGROUND.is(Background.solid(EMPTY_COLOR)));
this.bar.setStyles(Style.BACKGROUND.is(Background.solid(BAR_COLOR)));
this.bar.addStyles(Style.HALIGN.left);
add(bar);
}
public void setValue(float value) {
this.value = value;
dataChanged();
}
public void setMaxValue(float maxValue) {
this.maxValue = maxValue;
dataChanged();
}
private void dataChanged() {
float w = this.preferredSize.get().width();
float qoutient = w / maxValue;
float barWidth = qoutient * value;
final float maxWidth = this.preferredSize.get().width();
if(barWidth > maxWidth){
barWidth = maxWidth;
}
bar.preferredSize.update(barWidth, barHeight);
}
public void setBarHeight(float barHeight) {
this.barHeight = barHeight;
}
}
</pre>
Paul Weiberthttp://www.blogger.com/profile/07834672159124826665noreply@blogger.com0tag:blogger.com,1999:blog-2330699229628613007.post-28543024668084559382013-04-09T15:59:00.000-07:002013-04-09T15:59:45.670-07:00PlayN and eclipse - flash build issue<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote class="tr_bq">
In my <a href="http://programmerintrouble.blogspot.de/2013/04/getting-started-with-eclipse-and-playn.html">previous post</a> I have described how to set up eclipse for gamedevelopment with PlayN and import the PlayN showcases. The Html and Java versions worked fine and I tried to run the flash version (Run As -> Maven install) which failed with the following output: </blockquote>
<blockquote class="tr_bq">
<blockquote class="tr_bq">
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;">[INFO] Scanning for projects...<br />[INFO] <br />[INFO] ------------------------------------------------------------------------<br />[INFO] Building PlayN Showcase Flash 1.0-SNAPSHOT<br />[INFO] ------------------------------------------------------------------------<br />[INFO] <br />[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ playn-showcase-flash ---<br />[INFO] <br />[INFO] --- maven-dependency-plugin:2.1:unpack (unpack) @ playn-showcase-flash ---<br />[INFO] Configured Artifact: com.adobe.flex:flex-sdk:4.1.0.16076_mpl:zip<br />[INFO] Unpacking /home/paul/.m2/repository/com/adobe/flex/flex-sdk/4.1.0.16076_mpl/flex-sdk-4.1.0.16076_mpl.zip to<br /> /home/paul/development/playn-samples/showcase/flash/target/flex4sdk<br /> with includes null and excludes:null<br />[INFO] <br />[INFO] --- maven-antrun-plugin:1.3:run (default) @ playn-showcase-flash ---<br />[INFO] Executing tasks<br />[INFO] ------------------------------------------------------------------------<br />[INFO] BUILD FAILURE<br />[INFO] ------------------------------------------------------------------------<br />[INFO] Total time: 4.359s<br />[INFO] Finished at: Mon Apr 08 08:13:27 CEST 2013<br />[INFO] Final Memory: 10M/108M<br />[INFO] ------------------------------------------------------------------------<br />[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (default) on project playn-showcase-flash: An Ant BuildException has occured: /home/paul/development/playn-samples/showcase/flash/target/flex4sdk/bin not found. -> [Help 1]<br />[ERROR] <br />[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<br />[ERROR] Re-run Maven using the -X switch to enable full debug logging.<br />[ERROR] <br />[ERROR] For more information about the errors and possible solutions, please read the following articles:<br />[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException</span></span> </blockquote>
</blockquote>
My System Information: <span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"></span></span><span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"></span></span><span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"></span></span><br />
<ul style="text-align: left;">
<li>OS: Ubuntu 12.04 LTS 32bit</li>
<li>Eclipse Indigo </li>
</ul>
<h3 style="text-align: left;">
Resolving The Errors</h3>
<div style="text-align: left;">
We look at the first error Message,</div>
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">[ERROR]
Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.3:run (default) on
project playn-showcase-flash: An Ant BuildException has occured:
/home/paul/development/playn-samples/showcase/flash/target/flex4sdk/bin
not found.</span></span></blockquote>
When browsing to the mentioned folder <span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">/home/paul/development/playn-samples/showcase/flash/target/flex4sdk<span style="font-size: xx-small;"> </span></span></span>it turns out that this folder is empty. Something must have gone wrong during unpacking or copying. An upper message tells us where we can find the right flex4sdk :<br />
<blockquote class="tr_bq">
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;">[INFO] Unpacking /home/paul/.m2/repository/com/adobe/flex/flex-sdk/4.1.0.16076_mpl/flex-sdk-4.1.0.16076_mpl.zip to<br /> /home/paul/development/playn-samples/showcase/flash/target/flex4sdk<br /> with includes null and excludes:null</span></span></blockquote>
We browse to <span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;">/home/paul/.m2/repository/com/adobe/flex/flex-sdk/4.1.0.16076_mpl/ </span></span>unpack the <span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;">flex-sdk-4.1.0.16076_mpl.zip </span></span>and copy its content to the <span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">home/paul/development/playn-samples/showcase/flash/target/flex4sdk</span></span><span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"></span></span> (You can also create a symlink).<br />
<br />
We run the flash target again Run As->maven install on playn-showcase-flash. The previous message disappear. But the build still fails with the following output:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">... </span></span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> [INFO] <br />[INFO] --- gwt-maven-plugin:2.5.0:compile (default) @ playn-showcase-flash ---<br />[INFO] ------------------------------------------------------------------------<br />[INFO] BUILD FAILURE<br />[INFO] ------------------------------------------------------------------------<br />[INFO] Total time: 6.534s<br />[INFO] Finished at: Mon Apr 08 08:30:57 CEST 2013<br />[INFO] Final Memory: 13M/173M<br />[INFO] ------------------------------------------------------------------------<br />[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.5.0:compile (default) on project playn-showcase-flash: GWT Module org.jbox2d.GwtBox2D not found in project sources or resources. -> [Help 1]<br />[ERROR] <br />[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<br />[ERROR] Re-run Maven using the -X switch to enable full debug logging.<br />[ERROR] <br />[ERROR] For more information about the errors and possible solutions, please read the following articles:<br />[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException</span></span></blockquote>
The GWT Compiler tells us that the Module <span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">org.jbox2d.GwtBox2D </span></span>is missing. This module should be located in the jbox-sources.jar. We take a look at the Maven Dependencies:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Qs9XWbA39hpzAfZYknJfFIMARaxRgCYrhDVlck778QPGxcqJTqkgXb2-8_R7nvVSAL2q5J0xZGrFDlDKhievRqBIk-HiNJPwYCDdJ4iUMZVvtbUrHOsmemOaPiEopczeNPlgzRYzv9s/s1600/flash1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Qs9XWbA39hpzAfZYknJfFIMARaxRgCYrhDVlck778QPGxcqJTqkgXb2-8_R7nvVSAL2q5J0xZGrFDlDKhievRqBIk-HiNJPwYCDdJ4iUMZVvtbUrHOsmemOaPiEopczeNPlgzRYzv9s/s320/flash1.png" width="156" /></a></div>
A playn-jbox-xx.jar is actually listed but this jar contains only binaries, but the GWT Compiler need the source files. We must add an maven dependency for the sourcefile archive.<br />
<br />
Later I found out that this wasn't the last missing maven dependency, to resolve all missing dependencies i had to add the following dependencies to my playn-showcase-flash/pom.xml:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <groupId>com.googlecode.playn</groupId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <artifactId>playn-html</artifactId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <version>1.6</version></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <classifier>sources</classifier></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> </dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <groupId>com.googlecode.playn</groupId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <artifactId>playn-jbox2d</artifactId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <version>${playn.version}</version></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <classifier>sources</classifier></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> </dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <groupId>com.threerings</groupId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <artifactId>tripleplay</artifactId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <version>${playn.version}</version></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <classifier>sources</classifier></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> </dependency></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"></span></span> </blockquote>
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <dependency></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <groupId>com.googlecode.playn</groupId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <artifactId>playn-flash</artifactId></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <version>${playn.version}</version></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> <classifier>sources</classifier></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> </dependency></span></span></blockquote>
Now all dependencies should be complete. But running (Run As-> Maven install) the flash target results in an other Build Failure. Which seems to be more serious:<br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"><br />[INFO] --- gwt-maven-plugin:2.5.0:compile (default) @ playn-showcase-flash ---<br />[INFO] Compiling module playn.showcase.ShowcaseFlash<br />[INFO] Validating units:<br />[INFO] Ignored 1 unit with compilation errors in first pass.<br />[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.<br />[INFO] Computing all possible rebind results for 'com.google.gwt.useragent.client.UserAgentAsserter'<br />[INFO] Rebinding com.google.gwt.useragent.client.UserAgentAsserter<br />[INFO] Checking rule <replace-with class='com.google.gwt.user.client.FlashUserAgentProperty'/><br />[INFO] [WARN] Unknown type 'com.google.gwt.user.client.UserAgentAsserter.UserAgentProperty' specified in deferred binding rule<br />[INFO] Computing all possible rebind results for 'com.google.gwt.user.client.DocumentModeAsserter'<br />[INFO] Rebinding com.google.gwt.user.client.DocumentModeAsserter<br />[INFO] Checking rule <replace-with class='com.google.gwt.user.client.FlashUserAgentProperty'/><br />[INFO] [WARN] Unknown type 'com.google.gwt.user.client.UserAgentAsserter.UserAgentProperty' specified in deferred binding rule<br />[INFO] Computing all possible rebind results for 'playn.showcase.flash.ShowcaseFlash'<br />[INFO] Rebinding playn.showcase.flash.ShowcaseFlash<br />[INFO] Checking rule <replace-with class='com.google.gwt.user.client.FlashUserAgentProperty'/><br />[INFO] [WARN] Unknown type 'com.google.gwt.user.client.UserAgentAsserter.UserAgentProperty' specified in deferred binding rule<br />[INFO] [ERROR] Unexpected internal compiler error<br />[INFO] java.lang.NoClassDefFoundError: com/google/gwt/dev/jjs/impl/TypeLinker<br />[INFO] at com.google.gwt.dev.jas.JavaToActionScriptCompiler.precompile(JavaToActionScriptCompiler.java:530)<br />[INFO] at com.google.gwt.dev.jas.JasCompiler.precompile(JasCompiler.java:41)<br />[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:278)<br />[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)<br />[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)<br />[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:232)<br />[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:198)<br />[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)<br />[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)<br />[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)<br />[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:177)<br />[INFO] Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.jjs.impl.TypeLinker<br />[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:217)<br />[INFO] at java.security.AccessController.doPrivileged(Native Method)<br />[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)<br />[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:321)<br />[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)<br />[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)<br />[INFO] ... 11 more<br />[INFO] ------------------------------------------------------------------------<br />[INFO] BUILD FAILURE</span></span><br />
<br />
<div style="text-align: left;">
The line <span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;">Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.jjs.impl.TypeLinker </span></span><br />
tells us that the class TypeLinker is missing. After spending several time googling I found out that this problem won't be easy to fix since the flash target of PlayN 1.6 is not compatible to gwt 2.5 which is curiously used by PlayN 1.6. Another curious thing is that the PlayN Developers seem to know about this problem:<br />
<br />
I found the following comment on <a href="http://code.google.com/p/playn/wiki/PlatformStatus">http://code.google.com/p/playn/wiki/PlatformStatus:</a><br />
<br />
<blockquote class="tr_bq">
"Using Flash currently requires some fiddling because the GWT plugin that
translates Java to ActionScript has fallen out of date with GWT. Thus
one has to roll back to an older version of GWT (pre-2.4) to use the
Flash backend. "</blockquote>
Because of this message I spent a whole day trying to switch back to gwt 2.3 without success. It's quite hard because the flash target depends on artifacts witch seem to depend on gwt2.5. No matter what gwt version you include there are still some classes missing. <br />
<br />
<br />
<h3 style="text-align: left;">
Notes</h3>
<ul style="text-align: left;">
<li>I've decided to post this article even though I didn't find a solution, with the hope the first part may be still useful for somebody.</li>
<li>Leave your comments if you have any ideas on how this problem can be solved</li>
<li>If flash support is essential for your project you should try PlayN 1.4 is seems to be the last version which supports the flash target </li>
</ul>
</div>
</div>
Paul Weiberthttp://www.blogger.com/profile/07834672159124826665noreply@blogger.com0tag:blogger.com,1999:blog-2330699229628613007.post-1049326125899699562013-04-07T11:48:00.001-07:002013-04-19T03:07:35.675-07:00Getting started with Eclipse and PlayN - run playn showcases<div dir="ltr" style="text-align: left;" trbidi="on">
This article mentions how to set up eclipse for the work with the crossplatform game framework PlayN and also how to import and run the showcases. <br />
I decided to write this article since the Getting Started guide on <a href="http://code.google.com/p/playn/wiki/GettingStarted">http://code.google.com/p/playn/wiki/GettingStarted</a> is pretty short and some points were not quite clear to me as I was trying to set up Eclipse with PlayN. So I hope this guide will be helpful for you.<br />
<br />
Some Information about my System :<br />
<ul style="text-align: left;">
<li>OS: Ubuntu 12.04 LTS</li>
<li>Java: Open JDK 1.6</li>
<li>Eclipse Indigo</li>
</ul>
<h4 style="text-align: left;">
What is not covered in this article? </h4>
<div style="text-align: left;">
Above all I was interested in the java, flash and html 5 functionality of PlayN. So I didn't test the ios and android targets. I your main interest lies in the mobile targets maybe this may be the wrong place for you. </div>
<ul style="text-align: left;">
</ul>
<h3 style="text-align: left;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a>
Set Up Maven Plugin </h3>
<ul style="text-align: center;">
<li style="text-align: left;"> First of all you need to install the Maven Plugin: therefore click on Help -> Install New Software and type "maven" , the screen should look like this:</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgabAA5Mo9KmfAORKMShH940W_0GfRUadoLbrGjCkLBO8UiHW0d0DL49_xLpDyJf4N9OWajMyWgFimbqqOpIurKsIlK5an2zmbna9-um_lBot3dFqTQ6xQ1mKN9KOKGsrXBDQrF-x2AkHg/s1600/bild1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgabAA5Mo9KmfAORKMShH940W_0GfRUadoLbrGjCkLBO8UiHW0d0DL49_xLpDyJf4N9OWajMyWgFimbqqOpIurKsIlK5an2zmbna9-um_lBot3dFqTQ6xQ1mKN9KOKGsrXBDQrF-x2AkHg/s1600/bild1.png" width="320" /></a></div>
<div style="text-align: center;">
</div>
<ul style="text-align: center;">
</ul>
<div>
<div style="text-align: center;">
</div>
<ul style="text-align: center;">
<li style="text-align: left;">Select the item as shown in the picture, agree to install unsigned content if you'll be asked </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Another plugin you need is the native-dependency-plugin, to install it do the following:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul style="text-align: left;">
<li>In Eclipse click on: Help->Install New Software->Add (upper right corner)</li>
<li>The add "http://mavennatives.googlecode.com/svn/eclipse-update/" as new update site</li>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAAPPrhnKOY5UgAuR2JsABS5l9iIu02dVUGznG0IdWPtBJaperNs4-_RQ1FscnL6JvArUHrd0C1fVqJYnGYgqh0u6ozN3DH2pqWIAHkIfFv4enJF-UFhVycnBMt5yXzeBA75Qqw1IQTCk/s1600/bild2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAAPPrhnKOY5UgAuR2JsABS5l9iIu02dVUGznG0IdWPtBJaperNs4-_RQ1FscnL6JvArUHrd0C1fVqJYnGYgqh0u6ozN3DH2pqWIAHkIfFv4enJF-UFhVycnBMt5yXzeBA75Qqw1IQTCk/s1600/bild2.png" width="320" /></a></div>
</ul>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
</div>
<div>
<ul style="text-align: center;">
<li style="text-align: left;">Select the new Site, and the plugin to install </li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOXx5zt350FKC1kEkfFSFshH66XmfLZJbouTjFRqmPI2FOxX9d5WB2clU7fCLXDOkQXb5KEl5n05noIBf-xLCiLKTR2FX91rZquzHK3NMVgurcAF0dR5h0E9y9xLuGN1rYfx7SfCsnS1M/s1600/bild3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOXx5zt350FKC1kEkfFSFshH66XmfLZJbouTjFRqmPI2FOxX9d5WB2clU7fCLXDOkQXb5KEl5n05noIBf-xLCiLKTR2FX91rZquzHK3NMVgurcAF0dR5h0E9y9xLuGN1rYfx7SfCsnS1M/s1600/bild3.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div style="text-align: center;">
</div>
</div>
<div>
<ul style="text-align: center;">
</ul>
<ul style="text-align: left;">
<li>install the plugin (accept to install unsigned content) </li>
<li>Now we are done with the maven installation</li>
</ul>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Download and import the PlayN showcases</h3>
<div style="text-align: left;">
To download the showcases you need to install git. </div>
<ul style="text-align: left;">
<li>For debian based linux systems you just type "sudo apt-get install git" in the terminal</li>
<li>A detailed installation description for other operating systems can be found under <a href="http://git-scm.com/book/en/Getting-Started-Installing-Git">http://git-scm.com/book/en/Getting-Started-Installing-Git</a> </li>
</ul>
<div style="text-align: left;">
When the git installation was successful, we can checkout the showcases</div>
<ul style="text-align: left;">
<li>Open a terminal (should also work on windows similarly) and cd to your eclipse workspace you want the showcases to be in</li>
<li>type : <span class="pln">"git clone https</span><span class="pun">:</span><span class="com">//code.google.com/p/playn-samples"</span></li>
</ul>
<span class="com"></span></div>
<div>
<span class="com">If the download completed successfully there should be a directory named "</span><span class="com">playn-samples" and we can now import the samples in eclipse: </span></div>
<div>
<ul style="text-align: left;">
<li><span class="com">In eclipse: click on File->Import.. </span></li>
<li><span class="com">Choose "Existing Maven Projects" and click on next</span></li>
</ul>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmiPTUVk0XUO7gii6Wg3hhNFm6frceb-9X5qI1MWy7lSjqRWv_uYy5XIeSbzET0o88QdjoGDYCmBrgS4d5axyIW1RsRW2aExKUKXEb2I-zOnR4HRemKrWMrwdDQ-w8nqD9qLcb0Z_xy08/s1600/bild4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmiPTUVk0XUO7gii6Wg3hhNFm6frceb-9X5qI1MWy7lSjqRWv_uYy5XIeSbzET0o88QdjoGDYCmBrgS4d5axyIW1RsRW2aExKUKXEb2I-zOnR4HRemKrWMrwdDQ-w8nqD9qLcb0Z_xy08/s1600/bild4.png" width="320" /></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
<ul style="text-align: left;">
<li>In the next screen click on "Browse" and browse to the previously mentioned "playn-samples" folder, select the subfolder "showcase" then on "ok" and on "Next" (later you can also try other samples from the "playn-samples" folder the same way)</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie2H3zcaoA09_V2wcBp42lNjExA7ys4hFnBozilybCdDtEHVdWNx_3q_rN_vNumlWmUiKeW-VIS0-5hzQKMQetzII_MXttxeQtZ4P6S5iudyY5sGtlRa3D9V-nRiGQS9lWcBOiDcrT0Ng/s1600/import2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie2H3zcaoA09_V2wcBp42lNjExA7ys4hFnBozilybCdDtEHVdWNx_3q_rN_vNumlWmUiKeW-VIS0-5hzQKMQetzII_MXttxeQtZ4P6S5iudyY5sGtlRa3D9V-nRiGQS9lWcBOiDcrT0Ng/s1600/import2.png" width="320" /></a></div>
<br />
<ul style="text-align: left;">
<li> After this you see a summary of the required maven-plugins and eclipse tells you that one of them is missing (I wasn't able to find a way to resolve it). So we just click on "Finish". </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzsHEfkrUhavLYVjhE8uN9mNSxM9gJUF1RJVxdyUV9LTYpMmxFHjDY5KE4MjgyBHbSEMKRo9GLkm9gWeiwhjgSWFpfA6iQf4eixxhpgzWcb-M9hOdsV7HMIQf6LceJk9eufWKh6uxtcEk/s1600/import3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzsHEfkrUhavLYVjhE8uN9mNSxM9gJUF1RJVxdyUV9LTYpMmxFHjDY5KE4MjgyBHbSEMKRo9GLkm9gWeiwhjgSWFpfA6iQf4eixxhpgzWcb-M9hOdsV7HMIQf6LceJk9eufWKh6uxtcEk/s1600/import3.png" width="303" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=2330699229628613007" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<ul style="text-align: left;">
<li> If all went right you should now see a bunch of new projects named "playn-showcase-x" </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0p-axt4AbefKGSjO_j34Elqcr0JIIaHJyHf_AYu8wip-atUsFqeg_A08H-bfun1FYQc0A5XSTXvEZA4Y5rcLL0l5tqure2OD2lARt7yLUprTaQGDs_k-jUrUk7G156kRj-2y1v8bxW3c/s1600/run1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0p-axt4AbefKGSjO_j34Elqcr0JIIaHJyHf_AYu8wip-atUsFqeg_A08H-bfun1FYQc0A5XSTXvEZA4Y5rcLL0l5tqure2OD2lARt7yLUprTaQGDs_k-jUrUk7G156kRj-2y1v8bxW3c/s1600/run1.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<h3 style="text-align: left;">
Run the showcases </h3>
</div>
<ul style="text-align: left;">
<li>To run the showcases right click on playn-showcase->Run As -> maven install, As result the following should appear:</li>
</ul>
</div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDPaL6zuHWvxOnYz9JoP9zLzOkSPdLxWzyWk2RNC4oYJE8WfDcAtseJApghjGWAMx4EEQ0k93DfVAyfAztfZ4zzYH7d6yPYUEZhyyvWLTaDAhoaOBzMOHUJi2io7DsoAmkQH62RN7Y9sI/s1600/run2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDPaL6zuHWvxOnYz9JoP9zLzOkSPdLxWzyWk2RNC4oYJE8WfDcAtseJApghjGWAMx4EEQ0k93DfVAyfAztfZ4zzYH7d6yPYUEZhyyvWLTaDAhoaOBzMOHUJi2io7DsoAmkQH62RN7Y9sI/s1600/run2.png" width="320" /></a></div>
<br />
<div style="text-align: left;">
If you want to run the html version of the showcase</div>
<ul>
<li style="text-align: left;">Previously make sure that the port 8080 is not already being used. </li>
<li style="text-align: left;"> right click on playn-showcase-html->Run As -> maven install</li>
<li style="text-align: left;">Open a browser and type http://localhost:8080, now you should see the same menu and be able to play the samples</li>
</ul>
<div style="text-align: left;">
<h3 style="text-align: left;">
<span id="goog_1828648672"></span><span id="goog_1828648673"></span> Notes</h3>
<ul style="text-align: left;">
<li>I haven't tried the android and ios targets</li>
<li>The flash target is not compiling (I will update the post when I have figured out what the problem is)</li>
<li>If you want to change the default port for the html target, just change the jetty-plugin configuration in pom.xml of the xx-html project to this: </li>
</ul>
<pre class="brush:xml">
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.0.0.v20110901</version>
<configuration>
<webApp>
${project.basedir}/target/${project.artifactId}-${project.version}
</webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8181</port>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>test-html</id>
<phase>integration-test</phase>
<goals>
<goal>run-exploded</goal>
</goals>
</execution>
</executions>
</plugin>
</pre>
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<ul style="text-align: left;">
</ul>
</div>
</div>
<div style="text-align: center;">
<a name='more'></a><span class="com"> </span></div>
</div>
</div>
</div>
</div>
Paul Weiberthttp://www.blogger.com/profile/07834672159124826665noreply@blogger.com0