« September 2009 | Main | November 2009 »

October 19, 2009

Teppefall Hybrid released

Hybrid is a component API for developing Swing applications. Instead of writing Java code from the start, you simply write a layout file and an application manifest file. Both are XML files. You then export the user interface assembly in Teppefall Layout and start adding Java or Javascript code. The application manifest format is almost identical to Adobe AIR application.xml files.

You only need Java skills if you want to deploy in a web browser. Compiling Javascript is possible, but dependency problems might bite you in the ass later on. Rhino changed their threading model once and that really confused the heck out of me.

Teppefall SDK 20091019 (Windows, Mac OS X, Linux, Solaris)

The only classes you should worry about are:

Importer
http://labs.teppefall.com/docs/index.html?com/teppefall/ds/layout/jxml/Importer.html

Assembly
http://labs.teppefall.com/docs/index.html?com/teppefall/ds/layout/jxml/Assembly.html

AssemblyComponent
http://labs.teppefall.com/docs/index.html?com/teppefall/hybrid/AssemblyComponent.html

AssemblyContext
http://labs.teppefall.com/docs/index.html?com/teppefall/hybrid/AssemblyContext.html

JApplication
http://labs.teppefall.com/docs/index.html?com/teppefall/hybrid/JApplication.html

Launchers are:
com.teppefall.hybrid.app.JJHMain – Loads an application manifest.
com.teppefall.hybrid.browser.JJHPlugin – Loads a layout assembly.
com.teppefall.hybrid.browser.JJHPluginLAF – Customized LAF.
com.teppefall.hybrid.browser.JJHPluginLAFDT – Customized LAF with correct EDT.

Example shell script
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain application.xml

Example Javascript (set in application.xml/application@script)
app = context.getApplication() // implements JApplication
app.getApplicationFrame().setTitle("Hello World !") // Script runs on EDT by default

Example website
http://app.teppefall.com/installer

Example layout (layout.jfc)
<component class="javax.swing.JLabel" text="Hello World" id=”hello” name="hello"/>
<!-- Javascript: context.getApplication().getAssembly().getComponentById("hello") -->

Example manifest (application.xml)
<application script="hello/world.js" grabber="false" traymenu="true">
<id>com.example</id>
<name>HelloWorldApp</name>
<initialWindow>
<title>Hello World</title>
<content>cache/layout_assembly.jxml</content>
</initialWindow>
</application>

Example Hybrid component
public class MyLabel extends JLabel implements AssemblyComponent {}

I was considering a free commercial license, but I doubt there is a marked for this anyway. Sun's focus on JavaFX is just going to kill off the remaining Swing developers. And nobody sane is using JavaFX as a replacement. I don't want to piss away fellow developers time when I know how useless the current Sun Desktop management really is. We got some task bar code and window shaping. While SAF, BB, SG, JMF, JmediaPane, JwebPane and SwingX are all dead or dying. Oh sorry.. partially pseudo open sourced.

I have to be pragmatic. Hybrid was designed for the Teppefall Media Player and yet Sun still has no news about JmediaPane. So I assume the worst and start coding non-Java libraries as well. Because it's not Java or JavaFX. It's basically Sun or Microsoft or Apple. Sun thinks that JavaFX is like Ruby on Rails (RoR) on J2EE. It really isn't.

If you don't believe my statements about JavaFX, then use this JavaFX application create by James Gosling. The year is 2009 and Sun is basically promoting widgets. And if they want to compete with OS X Tiger from 2005, then yes, they have a fair chance. But who makes money on widget development anyway ? How do people make money off JavaFX without spamming Dzone and writing books ? And the thing that really bugs me is this. From a developer perspective JavaFX is one hundred percent dependent on Swing. The idea that JavaFX can exist without Swing is pure propaganda. JavaFX without Swing is like J2ME without emulators.

So, only use my framework if you're nuts ! Test out the Media Player if you want to see the potential. It's not based on Hybrid, but it's almost the same design. JJHMain is just a XML replacement for the Java calls.

October 04, 2009

Java Swing versus Nokia Qt

Qt Software (Trolltech/Nokia) has some pretty impressive technology and the new license makes it possible for pretty much everyone to develop Qt based software. Nokia wants a slice of the iPhone marked and Qt is the dedicated carrot on a stick. Although, I expect most people will write desktop software since this is the focus of their excellent Qt Creator IDE. Mixing Qt Creator and Visual Studio C++ 2008 Express is a powerful combination, but very complex to set up. And you will need this if you want to compile Phonon and Phonon compatible QT4.5 shared libraries. Qt Creator is very easy to use for Qt beginners, but you will need console and makefile skills if you want Phonon.

Teppefall Media Player (Qt) (15).png

The downsides are as follows.
Ridiculous compilation time unless you know how to split up your project into smaller bits.
Resource format appears to be from the stone age. It's solid, but Java developers will hate it.
Whiny when it comes to image formats. Java appears to be superior.
Qstring. Yet another string format. I understand why.. but OMG.. C++ standards process == poo.
Very complex build process based on PRO, MOC, QRC and non-standard C++ keyword(s) (slots).
MingW32 GCC is awesome, but Phonon/DirectX/DirectShow/etc requires Windows SDK and CL.
Four makefiles if you want Windows, Linux, OS X Cocoa and OS X Carbon builds.
Yes, I know about the PRO format, but I was almost instantly forced to write my own makefiles.
32/64 bit complexity. Suddenly shared DLL's becomes rocket science.
C++ threading is a non-standard mess.

Teppefall Media Player (Qt) (12).png

The media framework used in Qt is something called Phonon. Simple, easy to use and similar to JMC. Qt can be styled using standard CSS and it looks pretty decent. I do dislike the tiny icons and tiny text that seems to be the default on CSS styled Windows Vista. Qt developers must either have glasses or hawk eye vision. I don't understand why the QRC format scales everything down into tiny icons. Qt has SVG support, but I have yet to figure out how they use it. The framework is gigantic and you can spend a long time reading documentation. But the code samples are very good and the documentation is easy to understand.

My Qt media player feels very similar to the WPF version in terms of memory use and video scaling. Which is understandable, since both are relatively thin layers over the Windows media framework.

So, Qt, yet another framework where video is available today.

Teppefall Media Player (Qt) (13).png

This website is all about alpha and beta software

Download non-beta software here