P3 A new story begins

Aller au contenu | Aller au menu | Aller à la recherche

jeudi 4 avril 2013

JRebirth 0.7.3 is released

This new version of JRebirth offers a new website entirely generated with Maven Doxia engine, all source code is available on the GitHub repository, thus documentation will be updated more frequently because this the new challenge of JRebirth's Team: Provide a really understandable documentation :D

The 0.7.3 is available on: Official Release Note is available here : www.jrebirth.org/releaseNotes.html

What's new ?

0.7.3 - 'Doc&Site' version - 2013-04-03
  • JRebirth is now available on JCenter repository hosted by bintray.
  • JRebirth has now its own Logo (Special thanks to XoXi).
  • JRebirth provides a real Zip archive with all important files (also available in tar.gz and tar.bz2)
  • JRebirth Web site is now entirely generated with Maven Doxia engine.
    All documentation is written with Doxia and could be updated on GitHub.
    Every one can send a pull request to add information or to correct mistakes.
    PDF Documentation is delayed or will be manually built.
  • The website is now managed with rolling version:
  • Javadoc API (and other reports) follow the same rules:
  • JRebirth Catalog used to declare JRebirth archetype is now available online for each version.
    The latest one is available here : Latest catalog

    Enjoy it and don't hesitate to send some feedbacks on mailing list or by twitter.

dimanche 24 février 2013

JRebirth 0.7.2 is finally released !

It was painful but it's done !! A lot of trouble have been solved lately and infrastructure has been repaired.
The 0.7.2 is available on JRebirth repository (http://repo.jrebirth.org)
What's new ?

  • JRebirth Maven Repository is up to date
   Artifactory server was sometimes offline due to a lot of file corruption, Jenkins had broken a lot of build due to severals Java (64bit) VM fatal errors.
  • Update archetype to 0.7.2 version
   The 0.7.2 archetype has been upgraded to fit with new command and application classes
  • Add OnAction annotation
   JRebirth provides a new feature that allow handling events with annotation, a sample is available here : https://github.com/JRebirth/JRebirt...
  • Add Touch and Gesture events
   All newest touch and gesture event handlers have been added (with annotation and standard way)
  • Manage @RunInto
   Thread management are now configurable with annotation, you can still use class inheritance
  • Impossible to retrieve a component from ready method
   Main facades had a bug in their own lifecycle, everything is ok now, (Special Thanks to Heiko who send his remarks on mailing list)
  • Manage Multiple Stage
   A feature has been added to manage Stage (open, close etc...) with a command and a service
  • Improve Wave Contract
   WaveType usage has been improved (most convenient ot use)
  • Provide FXMLModel
   FXML integration has been simplified, you can just use a FXMLModel with a fxml file, check a sample here : https://github.com/JRebirth/JRebirt...
  • Merge Event Tracking with new Logging way
   Internal logger has been discarded, and internal event tracker has been upgraded, it allows JRebirth Analyzer tool to replay all JRebirth events to analyze application behaviour
  • Add JRebirth properties management
   A new mecanism to load properties has been created, it allows to use custom parameters (JRebirth already use some customizable properties)
  • Refactor Resources Management
   Usage of resources has been improved (font, colors, parameters), check sample test classes to learn more : https://github.com/JRebirth/JRebirt...
  • Improve site deployment
   JRebirth maven web site has been repaired, it provides Javadoc API, you should visit these urls : api.jrebirth.org site.jrebirth.org sites.jrebirth.org

Some documentation have been also updated check them on www.jrebirth.org website.

Enjoy it and don't hesitate to send some feedbacks on mailing list.

dimanche 3 février 2013

How to build a JRebirth Presentation

Last year I decided to create an application framework dedicated to JavaFX; the brand new graphical toolkit for Java.

After having played with Swing, SWT/JFaces, Flex, Silverlight and for sure Web API during several years I wanted to go back to Swing... ... and JavaFX 2 had been launched.

So I called my framework : JRebirth to beat all web-kiddies Up !!!

After few weeks of work, I had the opportunity to talk about JavaFX API during a ToulouseJug evening meeting. As Office suite was not my best friends, filling excel and powerpoint files all the day is not my main objectives (whereas it 's currently my everyday life ...).

So I decided to challenge myself and to create a Powerpoint's like presentation entirely in JavaFX. I activated the dog-fooding mode and I created the org.jrebirth.presentation sub module for JRebirth.

If you are a little bit lazy, you can fork one of the 4 presentations/applications I had built :

Otherwise as JRebirth is based on Maven Tools; the best way to use is to create a Maven project.

Project configuration

Hereafter you can see a typical presentation folder hierarchy :

Presentation Application Tree Structure with JRebirth

The first step is to create your pom.xml, you can copy/paste the sample hereafter:

pom.xml

  1. <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">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>org.jrebirth.presentation</groupId>
  4. <artifactId>lightningtalk</artifactId>
  5. <version>1.0.0</version>
  6.  
  7. <name>JavaFX 2.2 Lightning Talk</name>
  8. <url>http://www.jrebirth.org/lightningtalk</url>
  9. <description>Interactive Short Presentation of JavaFX 2.2 capabilities</description>
  10.  
  11. <properties>
  12. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  13.  
  14. <!-- Used for jnlp generation-->
  15. <jnlpFilename>LightningTalk.jnlp</jnlpFilename>
  16. <appClass>org.jrebirth.presentation.lightningtalk.LightningTalk</appClass>
  17.  
  18. <appletWidth>1024</appletWidth>
  19. <appletHeight>768</appletHeight>
  20.  
  21. <updateCheck>timeout</updateCheck>
  22. <updatePolicy>prompt-update</updatePolicy>
  23.  
  24. </properties>
  25.  
  26. <issueManagement>
  27. <system>GitHub Issue Tracker</system>
  28. <url>http://bugs.jrebirth.org</url>
  29. </issueManagement>
  30.  
  31. <ciManagement>
  32. <system>Jenkins</system>
  33. <url>http://ci.jrebirth.org/job/LightningTalk-Trunk/</url>
  34. </ciManagement>
  35.  
  36. <scm>
  37. <connection>scm:git:git://github.com/JRebirth/LightningTalk.git</connection>
  38. <developerConnection>scm:git:ssh://git@github.com/JRebirth/LightningTalk.git</developerConnection>
  39. <url>https://github.com/JRebirth/LightningTalk</url>
  40. </scm>
  41.  
  42. <organization>
  43. <name>JRebirth Open Group</name>
  44. <url>http://www.jrebirth.org</url>
  45. </organization>
  46.  
  47. <build>
  48. <resources>
  49. <resource>
  50. <filtering>false</filtering>
  51. <directory>${basedir}/src/main/java</directory>
  52. <includes>
  53. <include>**/*.fxml</include>
  54. <include>**/*.txt</include>
  55. </includes>
  56. </resource>
  57. <resource>
  58. <filtering>false</filtering>
  59. <directory>${basedir}/src/main/resources</directory>
  60. <includes>
  61. <include>**/*.*</include>
  62. </includes>
  63. </resource>
  64. </resources>
  65.  
  66. <plugins>
  67.  
  68. <plugin>
  69. <groupId>org.apache.maven.plugins</groupId>
  70. <artifactId>maven-compiler-plugin</artifactId>
  71. <version>2.3.2</version>
  72. <configuration>
  73. <source>1.7</source>
  74. <target>1.7</target>
  75. <encoding>UTF-8</encoding>
  76. </configuration>
  77. </plugin>
  78.  
  79. <plugin>
  80. <groupId>org.apache.maven.plugins</groupId>
  81. <artifactId>maven-jar-plugin</artifactId>
  82. <version>2.3.2</version>
  83.  
  84. <configuration>
  85. <archive>
  86. <manifestEntries>
  87. <JavaFX-Version>2.0</JavaFX-Version>
  88. <Main-Class>${appClass}</Main-Class>
  89. <JavaFX-Application-Class>${appClass}</JavaFX-Application-Class>
  90. <implementation-vendor>seb</implementation-vendor>
  91. <implementation-title>Prez</implementation-title>
  92. <implementation-version>1.0</implementation-version>
  93. <JavaFX-Class-Path>jaxb-api-2.2.1.jar
  94. stax-api-1.0-2.jar activation-1.1.jar jaxb-impl-2.2.1.jar presentation-0.7.1-SNAPSHOT.jar core-0.7.1-SNAPSHOT.jar
  95. logback-classic-1.0.6.jar logback-core-1.0.6.jar
  96. slf4j-api-1.6.5.jar</JavaFX-Class-Path><!-- Optional (not required for JWS) Update it because it's not automated yet -->
  97. </manifestEntries>
  98. <manifest>
  99. <addClasspath>true</addClasspath>
  100. </manifest>
  101. </archive>
  102. </configuration>
  103. </plugin>
  104.  
  105. <plugin>
  106. <groupId>org.codehaus.mojo</groupId>
  107. <artifactId>webstart-maven-plugin</artifactId>
  108. <version>1.0-beta-3</version>
  109.  
  110. <executions>
  111. <execution>
  112. <phase>package</phase>
  113. <goals>
  114. <goal>jnlp</goal>
  115. </goals>
  116. </execution>
  117. </executions>
  118.  
  119. <configuration>
  120.  
  121. <jnlpFiles>${jrebirth.jnlp.filename}</jnlpFiles>
  122. <excludeTransitive>false</excludeTransitive>
  123. <libPath>lib</libPath>
  124.  
  125. <resourcesDirectory>${project.basedir}/src/main/jnlp/resources</resourcesDirectory>
  126. <codebase>${deployUrl}/${deployPath}</codebase>
  127.  
  128. <jnlp>
  129. <!-- <inputTemplateResourcePath>
  130. ${project.basedir}</inputTemplateResourcePath> <inputTemplate>src/main/jnlp/template.vm</inputTemplate> -->
  131. <outputFile>${jnlpFilename}</outputFile>
  132.  
  133. <mainClass>${appClass}</mainClass>
  134. <offlineAllowed>true</offlineAllowed>
  135. </jnlp>
  136.  
  137. <sign>
  138. <keystore>${basedir}/jrebirth.jks</keystore>
  139. <keypass>${keypass}</keypass>
  140. <storepass>${storepass}</storepass>
  141. <!-- <storetype>
  142. fillme</storetype> -->
  143. <alias>jrebirth</alias>
  144.  
  145. <validity>360</validity>
  146. <dnameCn>www.jrebirth.org</dnameCn>
  147. <dnameOu>None</dnameOu>
  148. <dnameO>JRebirth</dnameO>
  149. <dnameL>Toulouse</dnameL>
  150. <dnameSt>HG</dnameSt>
  151. <dnameC>FR</dnameC>
  152.  
  153. <verify>true</verify>
  154.  
  155. <keystoreConfig>
  156. <delete>true</delete>
  157. <gen>true</gen>
  158. </keystoreConfig>
  159. </sign>
  160.  
  161. <pack200>true</pack200>
  162. <gzip>true</gzip>
  163.  
  164. <outputJarVersions>false</outputJarVersions>
  165. <install>false</install>
  166. <verbose>true</verbose>
  167. </configuration>
  168. </plugin>
  169.  
  170. <!-- Project Quality OPTIONAL :D -->
  171. <plugin>
  172. <groupId>org.codehaus.sonar</groupId>
  173. <artifactId>sonar-maven3-plugin</artifactId>
  174. <version>3.3.2</version>
  175. </plugin>
  176. </plugins>
  177. </build>
  178.  
  179. <dependencies>
  180.  
  181. <dependency>
  182. <groupId>javax.xml.bind</groupId>
  183. <artifactId>jaxb-api</artifactId>
  184. <version>2.2.1</version>
  185. </dependency>
  186. <dependency>
  187. <groupId>com.sun.xml.bind</groupId>
  188. <artifactId>jaxb-impl</artifactId>
  189. <version>2.2.1</version>
  190. </dependency>
  191.  
  192. <dependency>
  193. <groupId>org.jrebirth</groupId>
  194. <artifactId>presentation</artifactId>
  195. <version>0.7.2-SNAPSHOT</version>
  196. </dependency>
  197.  
  198. <dependency>
  199. <groupId>ch.qos.logback</groupId>
  200. <artifactId>logback-classic</artifactId>
  201. <version>1.0.6</version>
  202. </dependency>
  203.  
  204. </dependencies>
  205.  
  206. </project>

The sample pom also allow you releasing your application with Java WebStart with a self-signed certificate. You must fill 2 parameters to create your self-signed certificate :

  • -Dkeypass= your pass
  • -Dstorepass= your pass

This org.jrebirth:presentation dependency will fetch automatically the dependency: org.jrebirth:core which is the core of the JRebirth Application Framework.

Obviously you must connect to repo.jrebirth.org to download latest files, to do it you should read this page : JRebirth Installation

Let's code !

Now you have to create your package tree (for me org.jrebirth.presentation.lightningtalk), and add your first class. This is your application main class and it must inherit from AbstractApplication class available into core library. You can find more information about JRebirth Application class here : Application

  1. /**
  2.  * The class <strong>LightningTalk</strong>.
  3.  *
  4.  * Application as support for live javafx 2.2 lightning talk.
  5.  *
  6.  * @author Sébastien Bordes
  7.  *
  8.  */
  9. public final class LightningTalk extends AbstractApplication<StackPane> {
  10.  
  11. /**
  12.   * Application launcher.
  13.   *
  14.   * @param args the command line arguments
  15.   */
  16. public static void main(final String... args) {
  17. Application.launch(LightningTalk.class, args);
  18. }
  19.  
  20. /**
  21.   * {@inheritDoc}
  22.   */
  23. // @Override
  24. public Class<? extends Model> getFirstModelClass() {
  25. return StackModel.class;
  26. }
  27.  
  28. /**
  29.   * {@inheritDoc}
  30.   */
  31. @Override
  32. protected String getApplicationTitle() {
  33. return "JavaFX 2.2 - What's up ?";
  34. }
  35.  
  36. /**
  37.   * {@inheritDoc}
  38.   */
  39. @Override
  40. protected void customizeStage(final Stage stage) {
  41. stage.setFullScreen(false);
  42. stage.setWidth(1040);
  43. stage.setHeight(800);
  44. }
  45.  
  46. /**
  47.   * {@inheritDoc}
  48.   */
  49. @Override
  50. protected void customizeScene(final Scene scene) {
  51.  
  52. scene.getStylesheets().add("style/template.css");
  53.  
  54. // Manage Scene Zoom
  55. scene.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
  56.  
  57. // @Override
  58. public void handle(final KeyEvent event) {
  59. if (event.isControlDown()) {
  60. if (event.getCode() == KeyCode.ADD || event.getCode() == KeyCode.PLUS) {
  61. getScene().getRoot().setScaleX(getScene().getRoot().getScaleX() + 0.05);
  62. getScene().getRoot().setScaleY(getScene().getRoot().getScaleY() + 0.05);
  63. event.consume();
  64. } else if (event.getCode() == KeyCode.SUBTRACT || event.getCode() == KeyCode.MINUS) {
  65. getScene().getRoot().setScaleX(getScene().getRoot().getScaleX() - 0.05);
  66. getScene().getRoot().setScaleY(getScene().getRoot().getScaleY() - 0.05);
  67. event.consume();
  68. } else if (event.getCode() == KeyCode.DIGIT0 || event.getCode() == KeyCode.NUMPAD0) {
  69. getScene().getRoot().setScaleX(1.0);
  70. getScene().getRoot().setScaleY(1.0);
  71. event.consume();
  72. }
  73. }
  74. }
  75. });
  76.  
  77. //Keep aspect ratio
  78. scene.getRoot().scaleXProperty().bind(Bindings.divide(getStage().widthProperty(), 1040));
  79. scene.getRoot().scaleYProperty().bind(Bindings.divide(getStage().heightProperty(), 800));
  80.  
  81. }
  82.  
  83. /**
  84.   * {@inheritDoc}
  85.   */
  86. @Override
  87. protected List<FontItem> getFontToPreload() {
  88.  
  89. return Arrays.asList(new FontItem[] {
  90. LtFonts.TYPEWRITER,
  91. LtFonts.DOG_SPLASH,
  92. LtFonts.WAZAA_SPLASH,
  93. LtFonts.SLIDE_ITEM
  94. });
  95. }
  96.  
  97. /**
  98.   * {@inheritDoc}
  99.   */
  100. // @Override
  101. public List<Wave> getPreBootWaveList() {
  102. return Collections.emptyList();
  103. }
  104.  
  105. /**
  106.   * {@inheritDoc}
  107.   */
  108. // @Override
  109. public List<Wave> getPostBootWaveList() {
  110. return Collections.emptyList();
  111. }
  112.  
  113. }

You must load the StackModel view by overriding getFirstModelClass() method to create a Presentation application. This will create for you a customized view that will handle some events:

  • Left click and PageDown to move forward into your slides stack
  • Right click and PageUp to move backward into your slides stack
  • Ctrl + '+' to zoom in the scene
  • Ctrl + '-' to zoom out the scene

JRebirth Core also adds these shortcuts (they could be changed by overriding methods too)

  • F10 to maximize
  • F11 for fullscreen mode

How to add content ?

You must create a presentation/Presentation.xml file compliant with the Presentation.xsd XML schema. You can write raw text and create slides and sub-slides with image and hyperlink. You should launch the application and compare the xml file to evaluate all features. Here you have a full sample with a lot of different slides.

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <presentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.jrebirth.org/Presentation" xsi:schemaLocation="http://www.jrebirth.org/Presentation Presentation.xsd">
  3.  
  4. <title>JavaFX 2.2 What's Up ?</title>
  5. <date>15/11/2012</date>
  6. <event>ToulouseJug 11/2012</event>
  7. <place>Toulouse</place>
  8.  
  9. <speakers>
  10. <speaker firstName="Sébastien" lastName="Bordes" email="contact@jrebirth.org" job="JRebirth" />
  11. </speakers>
  12.  
  13. <slides defaultModelClass="org.jrebirth.presentation.lightningtalk.ui.slides.basic.BasicModel">
  14.  
  15. <slide style="place" modelClass="org.jrebirth.presentation.lightningtalk.ui.slides.place.PlaceModel" showAnimation="FadeIn" hideAnimation="FadeOut">
  16. </slide>
  17.  
  18. <!-- Presentation Title -->
  19. <slide style="intro" modelClass="org.jrebirth.presentation.lightningtalk.ui.slides.intro.IntroModel" showAnimation="FadeIn" hideAnimation="MoveToLeft">
  20. <title> JavaFX 2.2\n\t What's Up ?</title>
  21. </slide>
  22.  
  23. <slide style="me" showAnimation="MoveFromLeft" hideAnimation="MoveToRight">
  24. <title>Sébastien Bordes</title>
  25. <content>
  26. <item>Développeur</item>
  27. <item level="1"></item>
  28. <item>Technologies</item>
  29. <item level="1">Swing, JEE, Eclipse RCP, Flash-Flex (AS3), Silverlight (C#)</item>
  30. <item></item>
  31. <item>@s8bordes</item>
  32. <item level="1">seb@jrebirth.org</item>
  33. <item link="true">www.jrebirth.org</item>
  34. <item link="true">blog.webeo.fr</item>
  35. <item></item>
  36. <item>Artwork by</item>
  37. <item level="1">xoxi@xoxi.fr</item>
  38. </content>
  39. </slide>
  40.  
  41. <!-- Episode précédent -->
  42. <slide showAnimation="MoveFromBottom" hideAnimation="FadeOut">
  43. <title>Previously On ...</title>
  44. <content>
  45. <item>ToulouseJUG</item>
  46. <item level="1" link="true">www.jrebirth.org/toulousejug</item>
  47. <item>EclipseDay</item>
  48. <item level="1" link="true">www.jrebirth.org/eclipseday</item>
  49. <item>Breizhcamp</item>
  50. <item level="1" link="true">www.jrebirth.org/breizhcamp</item>
  51. <item>ToulouseJUG Lightning Talk</item>
  52. <item level="1" link="true">www.jrebirth.org/lightningtalk</item>
  53. </content>
  54. </slide>
  55.  
  56. <slide style="dogfooding" modelClass="org.jrebirth.presentation.lightningtalk.ui.slides.intro.IntroModel" showAnimation="FadeIn" hideAnimation="FadeOut">
  57. <title>DogFooding.Mode = On</title>
  58. </slide>
  59.  
  60. <!-- Read source -->
  61. <slide showAnimation="SlidingTopBottomProgressive" hideAnimation="FadeOut">
  62. <title>Explore it !</title>
  63. <content>
  64. <item>Source available on GitHub</item>
  65. <item link="true">https://github.com/JRebirth</item>
  66. <item></item>
  67. <item>Powered by JRebirth JavaFX Framework</item>
  68. <item link="true">www.jrebirth.org</item>
  69. <item image="images/me/JRebirth_128x128.png"></item>
  70. </content>
  71. </slide>
  72.  
  73. <slide modelClass="org.jrebirth.presentation.ui.splash.SplashModel" showAnimation="FadeIn" hideAnimation="ScaleToMin">
  74. <title>So\n What's up ???</title>
  75. </slide>
  76.  
  77. <slide showAnimation="MoveFromTop" hideAnimation="MoveToBottom">
  78. <title>Cross-Platform</title>
  79. <content>
  80. <item>JavaFX 2.2 is available on :</item>
  81. <item level="1">Windows (32-bit &amp; 64-bit)</item>
  82. <item level="1">Mac OS X (64-bit)</item>
  83. <item level="1">Linux (32-bit &amp; 64-bit)</item>
  84. <item>OpenJFX in OpenJDK</item>
  85. <item>Full Unified installer</item>
  86. <item level="1">Since Java SE 7u6</item>
  87. <item>jfxrt.jar included</item>
  88. <item level="1">Require some hack to generate Javadoc</item>
  89. </content>
  90. </slide>
  91.  
  92. <slide showAnimation="ScaleFromMin" hideAnimation="ScaleToMin">
  93. <title>Packaging</title>
  94. <content>
  95. <item>Native packaging</item>
  96. <item level="1">.exe, .msi, bundle image, dmg, rpm</item>
  97. <item>Self-installable package</item>
  98. <item>Including Java &amp; JavaFX Runtimes</item>
  99. <item level="1">Redistribution allowed</item>
  100. <item>... but still require ant :(</item>
  101. </content>
  102. </slide>
  103.  
  104. <slide showAnimation="FadeIn" hideAnimation="MoveToBottom">
  105. <title>Event Handlers</title>
  106. <content>
  107. <item>Multi-Touch &amp; Gesture</item>
  108. <item>Rotate</item>
  109. <item level="1">ROTATION_STARTED, ROTATE, ROTATION_FINISHED</item>
  110. <item>Scroll</item>
  111. <item level="1">SCROLL_STARTED, SCROLL, SCROLL_FINISHED</item>
  112. <item>Swipe</item>
  113. <item level="1">SWIPE_LEFT, SWIPE_RIGHT, SWIPE_UP, SWIPE_DOWN</item>
  114. <item>Zoom</item>
  115. <item level="1">ZOOM_STARTED, ZOOM, ZOOM_FINISHED</item>
  116. </content>
  117. </slide>
  118.  
  119. <slide modelClass="org.jrebirth.presentation.ui.splash.SplashModel" style="kiosk" showAnimation="MoveFromTop" hideAnimation="MoveToBottom">
  120. </slide>
  121.  
  122. <slide modelClass="org.jrebirth.presentation.lightningtalk.ui.slides.control.ControlModel" showAnimation="MoveFromTop" hideAnimation="MoveToLeft">
  123. <title>New controls</title>
  124. <content>
  125. <item>JFXtras 2</item>
  126. <item link="true">jfxtras.org</item>
  127. <item>Lot of control improvements</item>
  128. <item>JavaFX UI controls sandbox</item>
  129. <item link="true">hg.openjdk.java.net/openjfx/sandbox-8/controls/rt</item>
  130. </content>
  131. </slide>
  132.  
  133. <slide showAnimation="MoveFromRight" hideAnimation="MoveToTop">
  134. <title>Media</title>
  135. <content>
  136. <item>WebView enhanced</item>
  137. <item>Read &amp; Write pixels</item>
  138. <item>Enhanced font rendering on LCD displays</item>
  139. <item>MPEG-4 with H.264/AVC video and AAC audio codec</item>
  140. <item>HTTP Live Streaming with playlist</item>
  141. </content>
  142. </slide>
  143.  
  144. <slide showAnimation="MoveFromBottom" hideAnimation="ScaleToMin">
  145. <title>Canvas</title>
  146. <content>
  147. <item>Canvas != FXCanvas</item>
  148. <item>GraphicsContext</item>
  149. <item>Draw &amp; Fill methods (and more)</item>
  150. <item level="1">gc.setFill(Color.BLUE);</item>
  151. <item level="1">gc.fillRect(75,75,100,100);</item>
  152. <item>Save &amp; Restore methods</item>
  153. <item level="1">equivalent to push &amp; pop</item>
  154. <item>Effects &amp; Transform</item>
  155. <item level="1">Canvas &amp; Stack</item>
  156. </content>
  157. </slide>
  158.  
  159. <slide modelClass="org.jrebirth.presentation.lightningtalk.ui.slides.fireworks.FireworksModel" showAnimation="ScaleFromMax" hideAnimation="ScaleToMax">
  160. </slide>
  161.  
  162. <slide showAnimation="FadeIn" hideAnimation="ScaleToMin">
  163. <title>Integration</title>
  164. <content>
  165. <item>Swing integration documentation</item>
  166. <item>SWT integration documentation</item>
  167. <item></item>
  168. <item>New stable SceneBuilder 1.0</item>
  169. <item link="true">www.oracle.com/technetwork/java/javafx/tools</item>
  170. <item></item>
  171. <item>Scenic View, Visual Debugger</item>
  172. <item link="true">fxexperience.com/scenic-view/</item>
  173.  
  174. </content>
  175. </slide>
  176.  
  177. <slide showAnimation="FadeIn" hideAnimation="ScaleToMin">
  178. <title>Java 8 Overview</title>
  179. <content>
  180. <item>No more JavaFX version</item>
  181. <item></item>
  182. <item>Allow QuantumRenderer &amp; JAT to run in parallel</item>
  183. <item></item>
  184. <item>Performance improvements :</item>
  185. <item level="1">more than 50% in Charts</item>
  186. <item level="1">up to 30% in DirtyArea</item>
  187. <item level="1">more than 100% in some Controls</item>
  188. <item level="1">between 20 to 100% in Guimark</item>
  189. </content>
  190. </slide>
  191.  
  192. <slide modelClass="org.jrebirth.presentation.ui.image.ImageSlideModel" showAnimation="ScaleFromMax" hideAnimation="FadeOut">
  193. <content>
  194. <item image="images/splash/Merci.png" />
  195. </content>
  196. </slide>
  197.  
  198. <slide modelClass="org.jrebirth.presentation.ui.image.ImageSlideModel" showAnimation="FadeIn" hideAnimation="FadeOut">
  199. <content>
  200. <item image="images/splash/Q_and_R.png" />
  201. </content>
  202. </slide>
  203. </slides>
  204.  
  205. </presentation>

How to add JavaFX content ?

For each slide XML element you can declare a modelClass which will be loaded and used according MVC principles of JRebirth Application Framework (JRebirth Overview). Your model should inherit from AbstractSlideModel. Your view should inherit from AbstractSlideView. Your controller should inherit from AbstractSlideController.

Customizable method are available into your view to trigger and stop you slide animation.

Example:

  1. /**
  2.   * {@inheritDoc}
  3.   */
  4. @Override
  5. protected void customInitializeComponents() {
  6. this.pane = new FireworksPane(loadImage("images/canvas/MontSaintMichel.jpg"), loadImage("images/canvas/MontSaintMichel.png"));
  7. StackPane.setAlignment(this.pane, Pos.CENTER);
  8. getRootNode().getChildren().add(this.pane);
  9. }
  10.  
  11. /**
  12.   * {@inheritDoc}
  13.   */
  14. @Override
  15. public void doStart() {
  16. doReload();
  17. }
  18.  
  19. /**
  20.   * {@inheritDoc}
  21.   */
  22. @Override
  23. public void doHide() {
  24. this.pane.stop();
  25. }
  26.  
  27. /**
  28.   * {@inheritDoc}
  29.   */
  30. @Override
  31. public void doReload() {
  32. this.pane.start();
  33. }

How to package ?

Your pom.xml allow to package it as a Java WebStart Application, so you can broadcast your slides online ! Hereafter you have some examples :

Enjoy It and contact me on twitter (@s8bordes) if you have any question !

What's next ?

I will probably add an archetype to build quickly a new fresh presentation application. In the future I will add some JRebirth Services and Commands to manipulate Images and create some exciting animation, this module is called org.jrebirt:transition and will be released soon ... (depending if I have to create another presentation for another conference)

Currently I mainly work on JRebirth core new features.

vendredi 16 novembre 2012

Java FX 2.2 Lightning Talk at ToulouseJUG

On Thursday the 15th of November I have explained new features of JavaFX 2.2 at ToulouseJUG Hero session.

This was a lightning talk and it lasted 15 minutes. The video is available on Parleys : http://www.parleys.com/#st=5&id=3429&sl=18

You can find it here : http://www.jrebirth.org/lightningtalk.html

All code source is available on GitHub : https://github.com/JRebirth/LightningTalk

ToulouseJUG_November

jeudi 12 juillet 2012

JavaFX 2 Architecture Artwork

Today I want to share an artwork that my wife has done for my JavaFX presentations, it's a schematic of JavaFX architecture.

You can use it if you mention www.JRebirth.org web site Enjoy it !

JavaFX 2 Architecture

lundi 18 juin 2012

JavaFX 2 Presentation at Breizhcamp 2012

On Friday the 15th of June I have demonstrated JavaFX capabilities at Breizhcamp 2012 (Rennes, ISTIC).

I ship all my little family with me to go in Bretagne !! We visit some interesting museum between different sessions.

The talk lasted 1h15 and has been recorded. The video is available on Parleys here : http://www.parleys.com/#st=5&id=3357&sl=1

You can find it here : http://www.jrebirth.org/breizhcamp.html

All code source is available on GitHub : https://github.com/JRebirth/JFX-Presentation

Breizhcamp_June

vendredi 25 mai 2012

JavaFX 2 Presentation at EclipseDay Toulouse 2012

On thursday 24h of May I have demonstrated JavaFX capabilities at EclipseDay conference.

The talk lasted 30 minutes, 20min of slides presentation followed by 10 minutes of Live coding (An JavaFX hello World! using Tom Schindl eclipse plugin then a EclipseRCP application).

You can find it here : http://www.jrebirth.org/eclipseday.html

An Hellow world JavaFX application has been written in Live, and a Eclipse RCP application that embed several JavaFX components has been shown too.

All code source of these 3 application is available on GitHub : https://github.com/JRebirth/EclipseDay-Presentation

EclipseDay_May

vendredi 17 février 2012

JavaFX 2 Presentation at ToulouseJUG

On thursday 16th of February I have demonstrated JavaFX capabilities at ToulouseJUG monthly session.

The talk lasted 1h30 and has been done entirely with a JavaFX 2 application.

You can find it here : http://www.jrebirth.org/toulousejug.html

All code source is available on GitHub (from toulousejug tag since application has evolved) : https://github.com/JRebirth/JFX-Presentation

ToulouseJUG_February

dimanche 29 janvier 2012

How to build and package JavaFX 2 Application with Maven

I hate Ant, and I can't begin to work on a project that require using it.

So like many people I want to build my brand new JavaFX 2 applications with the best toolchain available for Java : Maven.

I planned to create a custom maven-plugin to do the job, but by using existing ones we can do it. Some things must be improved but the essential works.

The results is a zip file containing all dependencies (jar) with a jnlp file used to launch the application online or offline.

A demo application is currently visible on the JRebirth website. I used the html template generated by the javafxpackager tool.

Here you have the pom.xml file of the JavaFX application.

You can browse the svn source repository to show more information about the demo project at source.jrebirth.org:

The Pom that rules the maven Build

pom.xml

  1. <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">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>org.jrebirth.presentation</groupId>
  4. <artifactId>javafx2</artifactId>
  5. <version>1.0.0-SNAPSHOT</version>
  6. <name>JavaFX 2.0 Presentation</name>
  7. <url>http://www.jrebirth.org</url>
  8. <description>Interactive Presentation of JavaFX2 capabilities</de
  9. <!-- not used yet -->
  10. <properties>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. </properties>
  13.  
  14. <build>
  15. <!-- Include FXML resources -->
  16. <resources>
  17. <resource>
  18. <filtering>false</filtering>
  19. <directory>${basedir}/src/main/java</directory>
  20. <includes>
  21. <include>**/*.fxml</include>
  22. </includes>
  23. </resource>
  24. <resource>
  25. <filtering>false</filtering>
  26. <directory>${basedir}/src/main/resources</directory>
  27. <includes>
  28. <include>**/*.*</include>
  29. </includes>
  30. </resource>
  31. </resources>
  32.  
  33. <plugins>
  34. <plugin>
  35. <groupId>org.apache.maven.plugins</groupId>
  36. <artifactId>maven-compiler-plugin</artifactId>
  37. <version>2.3.2</version>
  38. <configuration>
  39. <source>1.7</source>
  40. <target>1.7</target>
  41. <encoding>UTF-8</encoding><!-- try to force encoding -->
  42. </configuration>
  43. </plugin>
  44.  
  45. <plugin>
  46. <groupId>org.apache.maven.plugins</groupId>
  47. <artifactId>maven-jar-plugin</artifactId>
  48. <version>2.3.2</version>
  49. <configuration>
  50. <archive>
  51. <manifestEntries>
  52. <JavaFX-Version>2.0</JavaFX-Version>
  53. <Main-Class>org.jrebirth.presentation.Presentation</Main-Class>
  54. <implementation-vendor>seb</implementation-vendor>
  55. <implementation-title>${project.name}</implementation-title>
  56. <implementation-version>1.0</implementation-version>
  57. <JavaFX-Application-Class>org.jrebirth.presentation.Presentation</JavaFX-Application-Class>
  58. <JavaFX-Class-Path>presentation-0.4.0-SNAPSHOT.jar
  59. jaxb-api-2.2.1.jar stax-api-1.0-2.jar activation-1.1.jar
  60. jaxb-impl-2.2.1.jar core-0.4.0-SNAPSHOT.jar
  61. </JavaFX-Class-Path>
  62. </manifestEntries>
  63. <manifest>
  64. <addClasspath>true</addClasspath>
  65. </manifest>
  66. </archive>
  67. </configuration>
  68. </plugin>
  69. <plugin>
  70. <groupId>org.codehaus.mojo.webstart</groupId>
  71. <artifactId>webstart-maven-plugin</artifactId>
  72. <version>1.0-beta-2</version>
  73. <executions>
  74. <execution>
  75. <phase>package</phase>
  76. <goals>
  77. <goal>jnlp</goal> <!-- use jnlp, jnlp-inline or jnlp-single as appropriate -->
  78. </goals>
  79. </execution>
  80. </executions>
  81. <configuration>
  82. <!--outputDirectory>
  83. </outputDirectory --> <!-- not required?? -->
  84.  
  85. <!-- Set to true to exclude all transitive dependencies. Default is false. -->
  86. <excludeTransitive>false</excludeTransitive>
  87.  
  88. <!-- The path where the libraries are stored within the jnlp structure. not required. by default the libraries are within the working directory -->
  89. <!-- <libPath>
  90. lib</libPath> -->
  91. <!-- [optional] transitive dependencies filter - if omitted, all transitive dependencies are included -->
  92. <!-- <dependencies>
  93. Note that only groupId and artifactId must be specified here. because of a limitation of the Include/ExcludesArtifactFilter <includes> <include>org.jrebirth:presentation</include>
  94. <include>org.jrebirth:core</include> </includes> excludes> <exclude></exclude> <excludes </dependencies> -->
  95. <!--resourcesDirectory>
  96. ${project.basedir}/src/main/jnlp/resources</resourcesDirectory --> <!-- default value -->
  97.  
  98. <!-- JNLP generation -->
  99. <jnlp>
  100. <!-- default values -->
  101. <!--inputTemplateResourcePath>
  102. ${project.basedir}</inputTemplateResourcePath -->
  103. <!--inputTemplate>
  104. src/main/jnlp/template.vm</inputTemplate --> <!-- relative to inputTemplateResourcePath -->
  105. <outputFile>Prez.jnlp</outputFile> <!-- defaults to launch.jnlp -->
  106. <!-- used to automatically identify the jar containing the main class. -->
  107. <!-- this is perhaps going to change -->
  108. <mainClass>org.jrebirth.presentation.Presentation</mainClass>
  109. </jnlp>
  110.  
  111. <!-- SIGNING -->
  112. <!-- defining this will automatically sign the jar and its dependencies, if necessary -->
  113. <sign>
  114. <keystore>${basedir}/jrebirth.jks</keystore><!-- Used a pre-generated keystore -->
  115. <keypass>gojava</keypass> <!-- we need to override passwords easily from the command line. ${keypass} -->
  116. <storepass>gojava</storepass> <!-- ${storepass} -->
  117. <!--storetype>
  118. fillme</storetype -->
  119. <alias>jrebirth</alias>
  120.  
  121. <!--validity>
  122. fillme</validity -->
  123. <!-- only required for generating the keystore -->
  124. <!--dnameCn>
  125. fillme</dnameCn> <dnameOu>fillme</dnameOu> <dnameO>fillme</dnameO> <dnameL>fillme</dnameL> <dnameSt>fillme</dnameSt> <dnameC>fillme</dnameC -->
  126. <verify>true</verify> <!-- verify that the signing operation succeeded -->
  127. <!-- KEYSTORE MANAGEMENT -->
  128. <!-- <keystoreConfig>
  129. <delete>true</delete> delete the keystore <gen>true</gen> optional shortcut to generate the store. </keystoreConfig> -->
  130. </sign>
  131.  
  132. <!-- BUILDING PROCESS -->
  133. <pack200>false</pack200>
  134. <gzip>false</gzip> <!-- default force when pack200 false, true when pack200 selected ?? -->
  135. <!-- causes a version attribute to be output in each jar resource element, optional, default is false -->
  136. <!-- <outputJarVersions>
  137. true</outputJarVersions> -->
  138. <!--install>
  139. false</install --> <!-- not yet supported -->
  140. <verbose>true</verbose>
  141. </configuration>
  142. </plugin>
  143. </plugins>
  144. </build>
  145.  
  146. <dependencies>
  147. <dependency>
  148. <groupId>org.jrebirth</groupId>
  149. <artifactId>core</artifactId>
  150. <version>0.4.0-SNAPSHOT</version>
  151. </dependency>
  152. <dependency>
  153. <groupId>com.oracle.javafx</groupId>
  154. <artifactId>jfxrt</artifactId>
  155. <scope>provided</scope>
  156. <version>2.0</version>
  157. </dependency>
  158. </dependencies>
  159. </project>

I choose to deploy the jfxrt.jar into my maven repository to have a cross-platform build independantly of JavaFX Runtime installation.

Maven build doesn't require Dlls (or .so files) dependencies, it just need the JavaFX api jar (jfxrt.jar), thus we can manage several javafx versions.

An alternative is to provide the jar with system scope by usin a JAVAFX_HOME environment variable :

  1. <dependency>
  2. <groupId>javafx</groupId>
  3. <artifactId>javafx</artifactId>
  4. <version>2.0.2</version>
  5. <scope>system</scope>
  6. <systemPath>C:/Program Files/oracle/jfx2.0/rt/lib/jfxrt.jar</systemPath><!-- should use environment variable for cross-platform-->
  7. </dependency>

Jnlp Template for JavaFX 2

The jnlp file template that you must use :

It could be improved by adding runtimes for all operating system.

src/main/jnlp/template.vm

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <jnlp spec="1.0+" xmlns:jfx="http://javafx.com" href="Prez.jnlp">
  3. <!-- codebase="http://www.jrebirth.org/prez" for online-->
  4. <information>
  5. <title>${project.name}</title>
  6. <vendor>Sébastien Bordes</vendor>
  7. <homepage href="${project.url}"/>
  8. <description>${project.description}</description>
  9. <!--<description kind="short">
  10. </description>-->
  11. <!--<icon href="icon.png"/>
  12. -->
  13. <offline-allowed/>
  14. </information>
  15.  
  16. <security>
  17. <all-permissions/>
  18. </security>
  19.  
  20. <resources os="Windows" arch="x86">
  21. <jfx:javafx-runtime version="2.0+" href="http://download.oracle.com/otn-pub/java/javafx/javafx-windows-i586__Vlatest.exe "/>
  22. </resources>
  23. <resources os="Windows" arch="x64">
  24. <jfx:javafx-runtime version="2.0+" href="http://download.oracle.com/otn-pub/java/javafx/javafx-windows-x64__Vlatest.exe "/>
  25. </resources>
  26.  
  27. <resources>
  28. <j2se version="1.7+" />
  29. <property name="file.encoding" value="UTF-8"/>
  30. $dependencies
  31. </resources>
  32.  
  33. <applet-desc width="1024" height="768" main-class="com.javafx.main.NoJavaFXFallback" name="${project.name}" />
  34. <jfx:javafx-desc width="1024" height="768" main-class="$mainClass" name="${project.name}" />
  35.  
  36. <update check="background"/>
  37. </jnlp>

Developper launching

I'm using e(fx)clipse to write code.

I launch the application from eclipse IDE, and to do the 'Dlls" trick, I copy the bin folder (that store all Dlls) into the parent folder of the jfxrt.jar stored into my maven repository. It's only used to launch the application from Eclipse. A better way will be to store them into the maven repository but It's quite painful... When you launch the jnlp file, you will use the default JavaFX runtime installed on your platform.

Bin_Trick.png



Continuous Delivery

Then you can add a FTP transfer task into your Continuous Integration (obviously I use jenkins for JRebirth) to allow continuous delivery to your favorite project.

Continuous_Delivery.png

So JavaFX 2 Rocks with Maven, and even with your favorite software factory tools ! (You can have a look at JRebirth contribute page to see which other softwares I use)

Enjoy JavaFX with Maven !!

Wordle: Maven JavaFX2 Tutorial

vendredi 27 janvier 2012

JavaFX 2 Presentation

I will demonstrate JavaFX 2 capabilities at ToulouseJUG on February 16th.

Registration to this free event is not yet opened, please check www.toulousejug.org website to be informed.

Here the event poster :
ToulouseJUG_JavaFX2_16-02-2012.png

You can also download the printable pdf version : ToulouseJUG_JavaFX2_16-02-2012.pdf

mercredi 28 décembre 2011

Type Filters for Accelerated JavaFX 2.0 UI development

I was bored by Eclipse who ask me to choose between many API classes when I press crtl+shift+O to Organize Imports.

So I explore the type filters feature of my preferred IDE : Eclipse.

Here you have a screenshot of packages filtered to gain few seconds when you write new class reference into your code.

I filter the awt and swing API, and also the Javafx inner API and other package which hold simlilar class names.

Eclipse Type Filter for JavaFX 2.0

if you want to copy paste packages name :

  • AWT
    • com.sun.awt.*
    • java.awt.*
  • Swing
    • javax.swing.*
  • Inner JavaFX 2.0 API
    • com.sun.javafx.*
    • com.sun.prism.*
  • For Line class
    • javax.sound.sampled.*
  • For Duration class
    • javax.xml.datatype.*

Be careful some classes will be inaccessible.

mardi 27 septembre 2011

JRebirth

Mon nouveau PPP est officiellement démarré => Nom de code JRebirth

Il s'agit d'un Framework pour JavaFx2 qui utilisera les meilleurs pratiques que j'ai pu apprendre lors de mon utilisation de Flex, de Silverlight (mais aussi de Swing et de SWT/JFace).

Si vous avez des questions ou que vous voulez vous joindre au projet n'hésitez pas !!! Je vais enclencher la deuxième d'ici peu .... (problème de logistique interne)

Stay Tuned !

La logistique est quasiment prête ! Comme je suis plus radin qu'éco-concepteur dans l'âme le serveur hébergeant tout ce petit monde est parfois hors ligne (notamment la nuit). Si la sauce prend il sera en ligne non stop voire pourquoi pas sur un dédié.

Me manque-t-il quelque chose ?

mercredi 24 août 2011

Prise en main de JavaFX 2

Je viens enfin de tester NEtBeans 7.0.1 pour créer une application JavaFx2

Le résultat est minable mais cela vaut bien un HelloWorld :D

Demo JavaFx2

mardi 23 août 2011

JavaFx (2) RuleZ

Un billet pour la postérité !!!

Voici 3 liens de benchmark sur les différentes technologies utilisées pour faire une Rich internet Application

  1. riabench-start
  2. guimark
  3. Bubblemark

On peut en conclure que javaFx1.3 est bien plus puissant que DHTML, Flex ou Silverlight (3 technos qui m'ont donné de sérieux maux de tête !!)

Au prochain Java One java Fx 2 sortira et enterrera toutes les autres technos, JavaFx 2 reprensente le dernier espoir des RIAs !!!! Il sera entièrement en Java avec un pont technique vers Swing et une accélèration graphique matérielle, que de bons choix !!

Son seul défaut est de ne pas encore avoir de plugin sous Linux mais cela sera vite résolu (enfin j'espère pour eux).

Après cela reste mon opinion personnelle mais on en reparle dans 1 an si vous voulez.

Si vous voulez débuter un projet en JavaFx 2, mailez moi au plus vite je suis preneur