Rainbow 1.1 – SVG browser for remote SVN repositories

Those of you who came to the session (PDF link) that Alex and I have presented at JavaOne 2006 saw the application that we wrote to illustrate different animation, translucency and transition techniques. The project itself was named Rainbow and all the bits were made available immediately after the session. Unlike many other demo applications written specifically for JavaOne, Rainbow was not meant to be one-shot sow-it-all-together-over-the-pizza to be left stagnating in the dark, and over the past month i have added a few big features.

There are two main new features that you can find in the version 1.1 (nearing RC stage), code-named Nightstone:

  • Support for SVGZ format in addition to SVG
  • Ability to browse local and remote SVN repositories with the new breadcrumb bar functionality from Flamingo.

To try the latest dev version in action, click on the WebStart button below:

After the application has been downloaded (it is about 12MB large, including the bundled Batik, Substance, SVNKit and a few others) and granted permissions (as before, you can convert the SVG images to Java2D code classes and PNG images and save them to local disk), you can browse two remote SVN repositories, Oxygen and Kalzium.

Here is a screenshot that shows a few icons from the Oxygen SVN repository (click for full view):

As you can see, the application is able to show compressed SVG images (in SVGZ format) after these have been downloaded from a remote SVN repository. Here is a screenshot of another Oxygen folder:

As before, when you click on an icon button, you will see another frame pop up with three tabs. The first tab will show you the SVG contents (XML), the second tab will show you the matching Java2D code that you can save as a local class, and the third tab will allow you to apply a few effects on the SVG image and save it as a local PNG file. For example, if you’re interested in more details on the new Konqueror icon, here is what you’ll see:

Want to see it inverted? Click on the “Invert colors” checkbox et voila:

Still convinced that web applications are the way of the future?


Related posts:

  1. Swing Breadcrumb Bar for browsing remote SVN repositories Early last year, i wrote about an outside contribution to the Flamingo component suite. Back...
  2. Swing, RIA and Sage browser – interview with Don DeCoteau A few weeks ago i have mentioned the Sage project, and it’s time for a...
  3. Desktop, browser and RIA – interview with Chet Haase Chet Haase is a well-known figure in the graphics community. Join him as he talks...


21 Responses to “Rainbow 1.1 – SVG browser for remote SVN repositories”

  • Kamil Páral Says:

    That’s interesting, I can enlarge the browser width, but I can’t shrink it (Ubuntu Linux, Java 6).

  • Kirill Grouchnikov Says:

    Kamil,

    This is a known issue with breadcrumb bar which will be fixed.

    Thanks
    Kirill

  • alexp Says:

    Hello Kirill

    I am happy to see that our demo is going forward !

    It looks really nice, so I am eager to check it out

    When I selected Oxygen or Kalzium – no images were download,
    is it because I use proxy server ?

    Thanks
    alexp

  • Kirill Grouchnikov Says:

    Alex,

    If you’re behind a firewall, you won’t see anything. I will think about a way to show the SVN-related exceptions.

    Thanks
    Kirill

  • alexp Says:

    Thanks Kirill

    I’ll check it out from my home anyway
    :-)

    alexp

  • Keith Says:

    Hi Kirill, it doesn’t work for me either unfortunately – I can’t see any images.

  • Dhilshuk Reddy Says:

    Hi Kirill,
    Great tool and good work done,I have also found another tool called
    svg shape Extractor deveoped by jasper potts.Is that tool similar to this one.
    Kirill every thing is fine ,the tool is generating code for all SVG files but when I am adding a text to the existing SVG file I am getting some error related to the naming of the element in the SVG Xml file.Can you tell me how I can avoid this.
    The tool is really great and is simply my tasking of manually writing Java 2D code.

  • Kirill Grouchnikov Says:

    Keith – if you’re behind a firewall, you won’t see any indication since the exception thrown by the SVNKit are swallowed silently. I will upload a new version that shows these exceptions and post a comment about that.

    Thanks
    Kirill

  • Kirill Grouchnikov Says:

    Dhilshuk,

    I do believe that Jasper’s tool is a little more limited, at least from the description that he gave in that entry. It appears that it can only extract paths, and Flamingo SVG transcoder provides much wider support.

    One thing that is missing currently is support for text tags (as you have noticed). You should see an UnsupportedOperationException on TextNode – this was left out due to lack of time. You can start in the SvgTranscoder.transcodeGraphicsNode method that handles shape nodes and composite nodes but doesn’t handle the TextNode. I don’t have any code for the text handling. What i did for other nodes was to debug the painting in Batik itself to see what Java2D methods were called on every specific node / shape / … and reconstruct it in the generated Java2D code. So, the generated class is pretty much the same sequence of Java2D calls as Batik does at runtime.

    At the present time, support for TextNode is left to the community, but i do have plans to support it in the midterm future.

    Thanks
    Kirill

  • Dmitri Trembovetski Says:

    Hi Kirill,

    for some reason the application sucks 100% cpu (WinXP). The only active
    threads according to jconsole seem to be those loading stuff off the net.

    Dmitri

  • Dmitri Trembovetski Says:

    Hmm. Can’t reproduce it anymore.

    Dmitri

  • Kirill Grouchnikov Says:

    Dmitri,

    There are two sets of worker threads at work when you select a folder with SVG images. The first set loads the SVG / SVGZ content off the SVN repository, and the second set transcodes the SVG / SVGZ images into BufferedImages. So, if you browse to a folder with a high number of images (some Oxygen folders have about 300-400 images), it will take some time (2-3 minutes) to download and transcode them all. You will see the progress bar in the bottom part of the application that shows the progress. Once it’s done, the CPU should be “free” for the rollover and resize effects.

    Thanks
    Kirill

  • Dhilshuk Reddy Says:

    Kirill ,
    Thank you for the information,I also found certain other features which the rainbow is not supporting.
    I have downloaded the svg file named free_vector_fancy_headers present at
    http://files.filefront.com/free+vector+fancy+headerszip/;8375250;/fileinfo.html
    and checked with rainbow but I didnot get the complete Java2D code.

  • alexp Says:

    Hello Kirill

    I reproduced the same effect as Dmitry described,
    100% CPU usage and frozen Rainbow GUI
    as you said it lasted about 3 mins

    It is quite unexpected, taking into account the fact
    that you are moving expencive tasks out of EDT

    Would it be a good idea to decrease number of images ?

    Thanks
    alexp

  • Kirill Grouchnikov Says:

    Alex,

    When you say frozen, do you mean that you’re unable to do anything with the UI? I tried it, and while it’s slow, i can still scroll the icon panel up and down, click on the icons and play with the breadcrumb bar selector (browsing to another folder). Can you run the application locally (not via WebStart) and see if it’s the same? What JDK and OS are you using?

    Thanks
    Kirill

  • Kirill Grouchnikov Says:

    Dhilshuk,

    That SVG has an embedded raster node which is not supported in the transcoding as well. While it would be nice to support it, i’m not sure what the gain would be, since it’s not vector-based information which will not scale well. You might as well use the PNG format for that.

    Thanks
    Kirill

  • alexp Says:

    Hello Kirill

    There were Windows XP and JDK 6
    but my home internet connection was not very fast
    that might be a reason of GUI freezing
    (not sure about Dmitri’s connection speed)

    I almost couldn’t scroll the main panel at least a minute
    and ghost effects were very slow

    I am in the office now, so I can’t reproduce it now

    Thanks
    alexp

  • Kirill Grouchnikov Says:

    Alex, Keith

    The latest WebStart should display an exception dialog when you’re behind a firewall. There are two new APIs on the breadcrumb bar that allow setting the “throw exceptions” mode and register an exception handler. The exception handler in this specific application shows that exception dialog.

    Thanks
    Kirill

  • Keith Says:

    Thanks Kirill, yes it works and I got the error message. The only problem was that on one computer it took about 20 minutes of no activity before the message was shown. And I couldn’t see any progress bar or anything showing activity or the lack of it.

    I like the idea of this, it brings alive the work of those graphics guys.

    Cheers,
    Keith

  • Kirill Grouchnikov Says:

    Keith – i show the dialog as soon as the SVNKit throws an exception. I’m not sure if they have some timeout mechanisms to configure that. For now i’ll leave it up to the “real” applications – one can also play with timeout’ing the SwingWorker that wraps the SVNKit connection.

  • Alexander Potochkin's Blog Says:

    JXLayer 3.0 – Getting started

    The major update of the JXLayer, the universal decorator for Swing components.