Pular para o conteúdo principal

Postagens

Creating custom Work Item Handler in BPM Suite/jBPM 6

Hi all! In this post I am going to share my experience creating a work item handler for BPM Suite 6.0.3 (which is very similar to jbpm as explained in a previous post ). The Hello World Work Item Handler Let's create a really simple WorkItemHandler just to print "Hello World" in the console. Of course you can implement more feature and make it receive parameters, access database, web services, etc. But in this post we will keep it simple. Really simple. First thing to do is to create a maven project for my WorkItemHandler. Here's the pom.xml of my Maven project: Notice that we are importing jbpm dependency so we can find the java interface that is used to create work item handlers. Now we can start coding. Let's create a class name HelloWorkItemHandler in package org.jugvale.jbpm, here is the simple code: Now we can build our project and go to BPM Suite to configure it so we can use this workitem. Registering the WorkItemHandler UPDATE...

Porting the StackerJavaFX game to Android

For too long I want to port a JavaFX application of mine to Android using JavaFX Ports . The day has come! In this post I will share with you my experiences porting the Stacker Game to Android. Actually at the time I write this sentence I just created a new project on Netbeans and it might even not work, I can even abandon this post, because at the moment I have 0% of the port done! UPDATE: It worked and was really easy! From Java 8 to Java 7 Android doesn't support Java 8. We have projects to use Lambdas in Java 7, but I wanted to make it simple as possible to avoid any incompatibility, hence I decided to keep it only with Java 7 and JavaFX 2.2. The saddest thing was to remove my beautiful lambdas to use the old anonymous classes from the code. Also, I noticed that JavaFX 8 is easier than JavaFX 2.2. The reason is that we have more constants and constructors in JavaFX 8 that we won't find in the 2.2 version. There were simple details to change, but Netbeans helped me, w...

Exporting JavaFX application as an animated GIF

To try to export an animation from a JavaFX app to an animated GIF, I started on this thread in StackOverflow , then this class  from Eliot Kroo, which I am sharing on gist in case his site goes down. Right now I am going to try his class on a JavaFX application and I will share the results here. A sample animation This is the animation I generated using my code : The source for this animation is here: Based on Eliot's class, I created one which will take an amount of screenshots based on the given period and write an animated GIF on the given path(well, right now I didn't create the source yet, hope I will be able to make it work): This code have no great performance since the snapshot method is not "performatic". If we set a small period to collect the GIF's frames, we will face slowness. That's all, folks! Now you can use the above code in your application to export GIT animations from your JavaFX applications! Com...

Stacker Game in JavaFX

In this post I am going to share with you this simple game I created using JavaFX. The Stacker game The goal of the game is to reach the top by stacking rectangles. This is a well known game where when you reach the top you earn some gifts. Here is a video I took from youtube of someone playing this game: Our game is a little different. We will will only stack 1 rectangle, but the rectangle can be adjacent of the below rect, not exactly on top of it. The number of rectangles to fill will be increasing according to the level and also the speed. The game in Processing The game was previously created in Processing , but most of the code I could reuse in the JavaFX version! You can find the source for the processing version in my github . Creating games with JavaFX JavaFX was always a platform for games since its 1.0 version. I remember we even had a blog specific for JavaFX script games . Since the end of JavaFX Script and with JavaFX 2, we have some samples that m...

My experience with Processing programming language (and JavaFX X Processing)

Processing is the main language used to create Arduino code . It is also a great language to create visual applications . In this post I am going to share you some processing sketches I created and the way to follow if you are looking to have fun with this great programming language based in Java. Having fun with processing Simplicity is the word for processing. You can sit, open the IDE, have some random idea and in a few minutes you will implement it. Here are some random fun stuff I created in a few minutes Spiral As a first test with angular motion, I created a sketch to draw lines which when connected create a spiral: TV out of tune To experiment the noise function, a sketch using this function was to simulate an old TV of tune effect: "The Thing" Angular motion is always exciting. In this example I created a class called TheThing, which makes use of angular motion. I won't post all the code here, but you can see in my github . Particle gen...