CARVIEW |
![]() Get Involved
Get Informed
Get Connected
Search
Online Books:
|
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Joshua Marinacci's Blog
At the speed of JavaFXPosted by joshy on April 06, 2008 at 11:19 AM | PermalinkAs we all rush headlong into JavaOne prep someone (okay it was James Gosling) sent me an email about performance of JavaFX. Speed is a crucial issue for anything dealing with user interfaces, so we care deeply about performance in our work with JavaFX. On the other hand we are focusing on bug fixes and correctness right now, not optimization, so it's not as fast as it could be. So how do we fare? Well, as a rough measurement, since there aren't any real benchmarks yet for rich internet applications, we have been using a website called BubbleMark, which has a simple graphics application written in many different languages/runtimes. It's the closest thing we have to a cross platform bench mark. So, how do we fare? James had this to say: "I just tried it on a MacPro running JDK6(developer preview 10) and the swing version runs at 198 fps with 32 balls, and the JavaFX version runs at 186 fps. Flex (cached) ran at 58...". So JavaFX's graphics layer, built on the currently un-optimized SceneGraph library, is only a few percentage points behind the plain Java2D/Swing version, and they are both 3 to 4 times faster than the Flex version. Not bad! Back from AustraliaPosted by joshy on April 05, 2008 at 06:15 PM | Permalink | Comments (0)Okay, so I've actually been back for several weeks, but JavaOne stuff has kept me super busy. I had a simply awesome time in Syndey. It's really a great city to visit. Very clean and friendly. And some truly excellent coffee. If you ever go be sure to order a flat white. I was in Australia for the Sydney Tech Days, speaking on JavaFX. While there I also gave a short presentation on Dynamic Languages for the JVM to several local universities. My focus was on Ruby, JavaScript, Groovy, and JavaFX Script. I specifically left out Jython because it was not being supported very well and looked like it might die. Of course, literally a day after I said this Sun announced that we are hiring two of the main Jython guys and it will be very well supported from now on. So I'm already out of date. Such is the life of a traveler. While in Sydney I also did an interview with David Coldrick on JavaFX and the state of desktop Java. You can see my interview at Youtube below or watch the super high-res version here
Oh, and enjoy a few photos from the zoo and aquarium.
Bleg: do you know of any good forum software?Posted by joshy on March 29, 2008 at 01:10 PM | Permalink | Comments (11)Today I think I shall use the power of my blog for evil instead of good. Well, maybe not evil but at least for my own personal gain. I need some forum software. After searching online for an hour or so and asking a few friends the consensus seems to be phpbb. Is this really the best of the bunch? The many forum software packages I have found all leave a great deal to be desired. They are often ugly, have extra features I don't need, are missing a few crucial features that I do need, and seem to have a plethora of config options. Surely there is something good out there I'm missing. So my question to you is: what forum software do you recommend? Here are my constraints:
Any ideas? Thanks. You need at least 386 PowerPosted by joshy on March 18, 2008 at 09:01 AM | Permalink | Comments (3)This is some old videos from the early days of the internet. And by videos I mean VHS. Videos from the mid 1990s that taught you about what the internet is and how to use it. Check out the screenshots of Yahoo circa 1995 and the mention of Gopher. Internet Power, Volume 1: Flashback to the VHS-Era Web I recall trying to explain the internet to friends and family back then and had trouble describing the scale of it. Me: It sends files. Of course we now know the Internet is all of those things and more, fundamentally changing the way everything is done. Now I could summarize it as: The Internet is the new electricity. JavaFX Doodle #3: A Paper Cutout DemoPosted by joshy on March 13, 2008 at 04:27 PM | Permalink | Comments (5)I just flew back from Australia where I spoke at the Sydney tech days and boy are my arms tired. Actually, it's more my legs than my arms, and technically I arrived before I left which is pretty weird... but anyway, I'm back now. I'm exhausted and don't have my photos in order yet so the Sydney post will have to wait until next week. For now, however, I thought I'd share with you Doodle #3, which is one of the demos I showed in Sydney. A Paper Cutout is a style of application common in the Flash world. It has a character of some sort with a bunch of pieces of clothing or other accessories next to it. You can think of it as the modern equivalent of a paper doll or Mr. Potato head. One of my favorites it the South Park character builder. You can run my humble little version of it here.
I built this demo in about an hour. I spent 10 minutes writing the code and 50 minutes badly drawing the artwork in Photoshop. When you run the demo you can move the pieces around and drop them on the canvas. Notice the drop shadow below the piece when you drag it. The code to do this is very simple. Each of the pieces is just a PNG image drawn in Photoshop. To add the movement I subclassed
The code above is pretty straight forward. The subclass adds
When the mouse is pressed it will turn on a shadow filter. When the mouse is released it will turn the shadow off. When you drag the mouse it will update the Now just combine them in a
So that's doodle number three. Almost entirely declarative and quite simple. See you next week. - Josh ResourcesJavaFX Script Doodles, #2: a tabbed rectanglePosted by joshy on February 18, 2008 at 06:27 PM | Permalink | Comments (5)Before I dive into my second doodle I'd like to mention the following Groodle. Allow me to explain. Andres Almiray saw my first JavaFX Doodle and decided to recreate it using the GraphicsBuilder syntax of Groovy; hence a Groodle! :) His first version is verbose, but later he updated it using the new alias syntax to be more compact. JavaFX is still a more concise syntax (IMHO), but Groovy is getting close and certainly has it's own strengths. I hope in the future Groovy will be another great way to build graphically rich apps on the Java platform. After all, why have one awesome way to build apps when you can have two! Be sure to watch Andres' excellent blog for updates. Now, on to the next doodle. A Tabbed Round RectangleThis is another sample for you to paste into NetBeans. It's a tabbed rectangle that looks like this:
Here's the basic code. I started by subclassing
So that's pretty straight forward. A clean definition with decent defaults. Good defaults are always important, since it lets developers get started right away. Now I could create this by drawing a rotated rectangle for the tab on top of a regular round rectangle, but that wouldn't be very dynamic. Really I want something that grows and shrinks properly. Then I can use it in cool transition effects, (more on that later). So instead of doing some funky shape unions I just made the shape out of curves and line segments. Note the
It's those bind statements above which contain the magic. Each part of the shape is defined in terms of the To use this new shape, just create an instance like this:
That will give you a decent looking shape but how about some animation? A nice transition would be handy. The code below does this by changing the
And here's what this would look like. Notice the
Enjoy. Any ideas for more doodles? Upcoming Java and JavaFX Events you should attendPosted by joshy on February 11, 2008 at 08:25 AM | Permalink | Comments (3)Travel, travel, and more travel. Between many FX related meetings, tech conferences, the holidays, and my wife's travel, I have been in an airport about once a week since June. Clearly whoever said technology would remove the need for travel never had to work on JavaFX. I'm sure technology will abolish travel one day, though, just as offices no longer use paper. :) So in case you are interested in traveling as well, here are some Java and Java related events coming up, including some featuring me. Sun Tech Days: March 4th-6th, Sydney, Australia.Yes, I'm heading to the land down under to talk about JavaFX and NetBeans. James Gosling and Bob Brewin will also be there. I've even done a video promo for the event that should be up soon. Since this is my first trip to the southern hemisphere I'm taking a few extra days after the conference for some much needed vacation. Since I live in Oregon the thought of summer sunshine was more than enough incentive to rope me into a 20 hour plane trip. Oh, and if you live in Australia but can't get to Sydney, click on the link above anyway. We will have satellite events in several other cities. The Java Posse Roundup: Crested Butte, CO. March 4th-7thI can't attend this year's Roundup since I will be in the aforementioned land down under, but I'll be there in spirit. Last year's event was incredible and intense. Oh, and the skiing was pretty good too. This year the topic is DRY: Don't Repeat Yourself. If you aren't in Australia you should come to this event. JavaFX Boot Camp: Indianapolis on April 9 - 11James Weaver, JavaFX coder extraordinaire, is hosting an intensive bootcamp to learn JavaFX. I believe that this is the first non-Sun JavaFX related event, which is pretty cool. Sadly I can't attend this conference since I'll be in JavaOne prep mode, but I'm sure it'll be fun. JavaOne 2008: San Francisco, May 6-9thAnd of course the granddaddy of all Java events is JavaOne. I have 2.5 sessions accepted this year so I'll be seeing you all there in early May. We've got tons of cool stuff coming. It's really amazing what's happened in the year since last JavaOne and we can't wait to show you. Betas for the JavaFX Script compiler, the scenegraph, hardware accelerated effects, HTML, and the Java 6 Update 10 are all converging upon JavaOne. And of course cool demos of everything. Oh, and we just might have a few other things up our sleeves. Be sure to refresh your blogs if you can't make it in person. Community One, May 5thThough JavaOne is rather pricey, the day before it starts (Monday May 5th) we will have a free event focusing on open source technologies like Java, NetBeans, and Open Solaris. It's called Community One and space is limited so sign up early. So get your walking boots on. It's going to be a busy spring. JavaFX Doodles: Doodle #1Posted by joshy on February 06, 2008 at 05:09 PM | Permalink | Comments (11)About four years ago when I started my blog I created a series of posts called Swing Hacks. This series eventually formed the basis of my similarly named book with Chris Adamson and led to my job at Sun. I think the series was successful. I still get an amazing number of hits to Swing Hacks 4, the Universal Right Click. I wish I had carried the series longer, however, since there was probably much more I could talk about. So this is why I'm starting a new series for JavaFX that I'm going to call JavaFX Doodles. Each doodle will be a small example of code snippet that does something compact but useful. I will cover only JavaFX Script initially, then add mobile and designer tools later. Also note that I am using the currently available interpreter version of the JavaFX Script syntax. I will switch to the compiler version with a slightly different syntax when it becomes available (which shouldn't be too much longer). I hope this series goes well and produces easily usable samples that will improve your own code. Let me know if there's anything you'd like to see a Doodle of. Here goes! JavaFX Doodle #1This is a simple demo I often use in my presentations. It uses basic binding and animation to create a grid of fading red cells.
Most of this code is boilerplate. It declares a subclass of Rect called Cell which adds two attributes (the JavaFX Script term for properties):
There are two interesting parts to this code which do all of the work. The first is the initializer for the The second important part is one line further down where the code sets an Whenever the mouse enters a cell it will kick off an animation for that cell. The color will go immediately to bright red and then fade back to black (since the other components of the color are already 0). That's it! These two lines do all of the hard work to create an interactive animation. LimitationsYou may have noticed a problem with this code. If you move the mouse in and out of a cell repeatedly within 5 seconds then then a new animation will start. There is no way to know if the animation is already running and optionally stop it. This is a limitation in the current animation system that is currently being overhauled by the compiler team. When the new syntax is ready I'll show you how to update to it. To try out this code just paste it into an open JavaFX Script buffer into NetBeans 6 with the latest plugin (instructions for setting up NetBeans here) Biblioteca![]() |
![]() |
April 2008
Search this blog:CategoriesCommunityCommunity: Java Tools Community: Java User Groups Community: Java Web Services and XML Community: JavaDesktop Community: JDK Community: linux.java.net Community: Mac Java Community Community: NetBeans Databases Deployment Distributed Games J2EE J2ME J2SE JavaOne Jini JSR JXTA Linux Mobility Open Source P2P Patterns Performance Programming Swing Testing Tools Virtual Machine Web Services and XML Archives
April 2008 Recent EntriesBleg: do you know of any good forum software? ArticlesMapping Mashups with the JXMapViewer Building Maps into Your Swing Application with the JXMapViewer Generating PDFs for Fun and Profit with Flying Saucer and iText All articles by Joshua Marinacci » ![]() |
![]()
|