Programming since early days of personnal computing around 1983, Frederic Barachant has been through many machines and languages and now concentrates on java.
I've been working in the graphic industry for years as an independent graphist, doing 3D images for corporate companies, films, tv shows and games. I have been the author of a compositing application, developped in the company i founded, I/O labs.
My interest is in anything that relates to graphic programming and animation.
I entered a new company a bit over a year ago. Came back from Paris to my beloved French Riviera. Calanques, pastis and aïoli, i'm back.
In this company i am developing a new version of an old foxpro product which displays performance information in movie theaters. The old product -which i respect a lot- (developed in two days, sold and worked flawlessly as-is for years) had to be revamped.
Company wanted a new, smart (read "sexy") display, colorful, animated, customizable, skinable, flexible. They wanted to be able to configure everything through network, never touch display machines, be able to configure all machines (potentially hundreds) from the same interface and they wanted it to be easy.
At first, i had to do simple reporting, which movies were on air, in what hall, bla bla bla. It ended with a program that was able to display on multiple monitors a playlist of modules that displays completely different types of information (advertising, path to halls, synopsis of movies to come, ....). All modules had to be layered (clock over everything, for example), but everything had to be customizable, startable anytime upon simple action, independent and non-intrusive, animated, screen resolution independent, displayable in portrait or landscape independently on any monitor, ...
...
...
So i was there with a huge list of tasks. Excited on one side, totally frightened on the other. What i had to create became no-less than scala infochannel, I was pretty far from the ugly ticker they showed to me.
...
...
...
One year passed, it's spring and weather is getting better. I am at Deauville, north of France, installing my software in my first movie theater. I wanted to be there for the first customer so i got out of the office to install everything myself.
I am now a bit over 110K LOC, my netbeans RCP program works very well. It displays information with java3D on up to 4 full HD monitors at around 60 fps on a roughly standard PC. Everything is as wanted, configurable through the net, easy, interactive, sexy.
Customer is happy and wishes to have more displays as i leave and take train to get back to the office. I feel nice and happy of my work, life is fine.
Life was almost fine, in fact. My dell laptop inverter broke, which left me with a dark screen and nothing to do for hours.
This is where i thought about an old song from information society. "where would i be without IBM". This is something a friend forced me to listen once or two about a decade ago, as an introduction to a discussion on what personal computer became since i started programming, around 1983.(time flies)
I thought, "where would i be without Open Source?".
Where would this program be if the huge list of libraries i used were not there?
Let's face it, i would certainly have created an other ugly ticker.
Where would most of nice and interesting programs of these days be without opensource? Almost nowhere.
Force of opensource is that we, individuals and small companies can compete with multimillion budget projects. We are a strong team of millions developpers, working all the time, everywhere. Each day, libraries become better or die, this is a very active and alive ecosystem. In a very few years we became surrounded by so many good APIs for each and every thing we need that it became easy and fast to create programs of great quality.
An extension of this question, of course, is "where would i be without ibm, sun, microsoft?"
What would be our real force without their billions? What would even our computers look like if Microsoft were not such a dominant company?
Their competition feeds us with will, their money federate us.
I believe in open source, but not as a final goal. Both models need their counterpart, none being all white/all black.
So, here i want to send an electronic thank/kiss/hug/beer/handshake to all those that created the libs/specs for my program. You are part of my daily happiness:
Java SE platform, Netbeans RCP, java3D team, java2D, ImageIO, JPA/Toplink, JCE/BouncyCastle, derby, JMF, Fobs4JMF, Com4J, glassfish, JMS, JMX, hudson, webstart, ...
Splines project now has its first incarnation within swash and the example chosen is the perfect one.
In a previous blog, Tim Bourdreau asked for the difference between splines project and java.awt.GeneralPath. Here i show some of the main reasons why generalPath could not be used:
Path can be changed anytime and displayers update themselves upon modification. No hassle.
Modifications on paths are very simple to operate
Having seperate splines for each ordinate makes it easy to change direction of the thrown gear. Using GeneralPath would have been a nightmare.
Sections of the splines are independent on each ordinate.
Velocity of the gear can easily be set and changed.
Demo consists of a gear that can be thrown to the wall when pressing a button. Gear bounces on bottom of the zone then on the wall and bounces back. Wall position can be changed anytime (even when animation is running, which can be funny on some cases when the gear bounces two times on wall :) ) and you will see splines being adapted in realtime.
There are two goals in this demo; show why splines project is done like that and show how to animate within swash.
Kudos go to the java2D and swing teams. While the animation runs at 50fps, there are no hiccups and cpu used is at 0%. Antialias is at max, and the gear rotates so it ought to take power from my old prescott and my even older ATI 9600.
Splines project is my latest contribution to oss.
It is aimed at helping people use, display and edit splines without too much hassle.
The main entity of the project is Curve, which is a list of CurseSection objects. Three types of sections can be added at the moment, but the system can accept new implementations anytime (you can already add yours).
Actually implemented CurveSection types are:
linear: a direct interpolation between previous section and current
cubic: a cubic spline interpolation between previous section and current
quadratic: a quadratic spline interpolation between previous section and current
Taken from the webstart Demo, here is how i created the Curve:
Curve = new Curve( new LinearSection( 0, 0 ) ) );
curve.addSection( new LinearSection( 1.0, 5.0 ) );
curve.addSection( new QuadraticSection( 3.0, 4.0, 2, 4 ) );
curve.addSection( new CubicSection( 6., 2., 4, 5, 5, 0 ) );
Cannot be easier.
and here is how i displayed the curve:
this.curveViewControl.setCurve( curve )
Once again, cannot be easier.
Curve and its sections can be listened for modification, curve can be serialized (listeners will not) and the whole is easy to use and fits in a very small single jar.
Sections can be replaced by others, and section objects can be modified externally. Library is totally threadsafe and a curve or its sections can be used and modified from multiple threads without collisions.
Plans for the future are to enhance the swing component to enable pluggable editors for curves, pluggable renderers, and before all more complete refreshing after edit.
A bug corrected in latest netbeans 6.1 enables swash to display its animations realtime while you edit withing matisse. Great effect and good step ahead in productivity.
Thanks goes to Tomas Pavek for that. Even if the bug report was a bit old, he fixed it as soon as he got his eyes on it and i admit i really waited for it.
So, here is a little swik capture that shows how animated components are shown. Unfortunatly, swik goofed a bit and does not show animations correctly as they are perfectly smooth on my screen, but you will see them jerk. Bah, i'm so happy i do not really care.
Fun thing is that you can edit, duplicate, add components over and under animations and matisse does not matter. Everyting just animates smoothly while you setup your UI.
While i was finishing the splines part of swash, i said to myself that this could easily be extracted to an external package that could be useful to other projects than swash. In fact, i have other projects that would benefit from it, so even within my own projects that would be fine.
Then i thought of other parts that could be useful and could be extracted. But as i was thinking deeper on what could be externalized and reused i wondered about the burden of reuse.
How much does it burden to be smart and fancy? When is it wrong to do it right?
I mean, i -more than once- grumbled over the fact that i needed activation.jar to use javaMail. What if to use one API you suddenly need to add six or eight jars? Swash actually has two jars, soon three. We are all taught the wonderful advantages of object orientation like ease of reuse, but even if not pushed to an extreme, i see it as a burden. Is it acceptable? I don't know.
Next thing i could export to an external lib is interpolation, but as i will soon support java3D canvases within my rendering pipeline, its jars will become somewhat a dependency of swash. (but no, i certainly do not intend to see everyone forced to install java3D. Not having it will simply not render that part of the graph). Only those two things add at least 4 jars (and native libs for java3d)
Supporting inclusion of svg will also add its own pack of jars.
Sure, JSR-277 could solve the problem and make it transparent for developers to include anything but it's not there. And until it is really everywhere and used by everyone -which imho means years- there will be a "legacy mode" to support.
On an other hand, having no real central repository and no real way to handle dependencies makes it a harder decision to whether i should include the whole bang or handle their inexistence gracefully.
Solution number two might turn in a coding nightmare, while solution number one will certainly add unwanted burden to swash.
Bubonic plague or cholera?
What could be the jar count to choose between one or the other?