The Source for Java Technology Collaboration
User: Password:



Romain Guy's Blog

October 2005 Archives


Twice the IDE

Posted by gfx on October 24, 2005 at 03:26 PM | Permalink | Comments (17)

Using Eclipse for the code, NetBeans for profiling, how cool is that? Well, it is, especially when you have a dual screen setup. I know a lot of developers do have such a setup today. Mine is a bit weird though:

Two IDEs


Anyway, I have been quite successful using two IDEs so far so I'm ready to switch to next gear and use NetBeans 5.0 GUI Builder for my UIs. Eclipse, as any decent IDE/source editor, knows when a file has changed on the hard drive and asks to reload it. And anyway, source code versioning tools come in handy in such cases :)

As much as I love writing my UIs by hand, I'm getting tired of fiddling with layout managers. I do my best to make my life easier with other tasks, so why not with this one?

Do you or did you successfully used two IDEs for the same project at the same time? I'd be interested in hearing from similar experiences.



Flock, rediscover the web

Posted by gfx on October 21, 2005 at 05:37 AM | Permalink | Comments (1)

I just installed Flock and I am writing this entry from within this new web browser. Flock provides a brand new way to browse the web and interact with social networks: blogs, del.icio.us, flickr, etc. It's been a while since we have seen real innovation amid web browsers but this is it. Go try it out, you might not regret it, despit the bugs.

Flock

Flock also contains many powerful features, like a full index for the pages you visited. This allows you to find pages in your history with their content instead of just their title or URL. Oooh I'm so excited by what this application could become!

Flock



Unexpected Java Tool

Posted by gfx on October 10, 2005 at 01:49 PM | Permalink | Comments (6)

When I'm home and need to tweak and plot an equation, I use an excellent tool that ships with MacOS X 10.4, Grapher. Easy to use, it fits my purpose and provides a good user experience:

Tiger Grapher


As I don't want to carry both my laptops to the office every day, I bring only my Windows box, on which I have yet to find a tool to replace Grapher. I have tried several tools and none convinced me yet. Nevertheless, I decided to give Maple 10 a try. I learned how to use Maple a few years ago at school and I was wondering what new stuff it could offer. Well, first of all, it seems to be written mostly in Java (at leat the whole UI is). The UI is also much easier for newcomers and now provides completion, context sensitive menus, and so forth. But that's not my point. Maple proved to be a valuable Java development tool.

It turns out Maple offers a language translation feature that can turn calculations, equations and even "Maple script" procedures into another language. Among the available targets are C, FORTRAN, MATLAB, Visual Basic and... Java. Take this example for instance:

Maple


To use this equation in my Java source code I can just right click on it and go to the Language Conversion menu:

Maple


And here is the result:

Maple


I'll grand you this feature is not the best one I have ever seen to boost my productivity but it's sure really handy, especially when you don't want to mess up parenthesis and other weird mathematical stuff. You can also optimize the computation and then generate the code:

Maple


This version makes it easier to break the computation into several methods which can be very useful when you know some parts won't change at runtime. I was happily surprised to find a good Java asset with Maple :)



SwingFX: Cancelable Infinite Progress

Posted by gfx on October 06, 2005 at 04:18 PM | Permalink | Comments (3)

Many months ago, Craig and I started the SwingFX project. One of the first components to be added was the infinite progress panel I described in a blog entry:

SwingFX


This component was quite successful (I've recently seen a variation in ZValley's ZEN) but it remains quite simple. Michael Bushe just added a very valuable feature, the ability to cancel the current running task:

SwingFX


You can get it today in SwingFX binaries, source and documentation. I also suggest you to take a look at the rubberband API, it can prove to be useful in some applications.



Drag and Drop Effects and Java2D Performances

Posted by gfx on October 03, 2005 at 09:09 PM | Permalink | Comments (5)

You can run the WebStart demo or download its source code.

Once the application is started, you can drag and drop pictures from the list on the left to the image viewer on the right and trigger a cool looking animation.

Photo Collage


Photo Collage

When writing this application, I found serious performances issues with J2SE 1.5. There were also some problems with Java SE 1.6 but far less important. Chris Campbell and Chet Haase really helped me on this. It turns out that loading an image with ImageIO does not necessarily provide a picture in a compatible format with the default screen configuration. When drawing such pictures you lose performances, especially when scaling them. An easy way to work around this problem is to convert them into compatible images:

  public static BufferedImage loadCompatibleImage(URL resource) throws IOException {
    BufferedImage image = ImageIO.read(resource);
    GraphicsConfiguration configuration = GraphicsEnvironment.
      getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
    BufferedImage compatibleImage = configuration.createCompatibleImage(image.getWidth(),
                                                                        image.getHeight());
    Graphics g = compatibleImage.getGraphics();
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return compatibleImage;
  }

I wrote a longer explanation you might want to check out if you need to perform heavy drawings with pictures in your application.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds