Monday Dec 03, 2007

Swing YouTube Player

NetBeans IDE 6 is out. Time to hurry to http://www.netbeans.tv/ and check for movies. Another place is YouTube, a few interesting things can be found there too. Here's one way of doing it, using a Swing YouTube Player:

YouTube is really well integrated here, for example, you can scroll through related movies within the browser component, i.e., note the "left" and "right" arrows on the two sides of the screenshot below. And, at the bottom of the currently playing movie, you can see small Ajaxy thumbnails, which move in and out as the mouse hovers over them and which you can click, at which point the selected movie starts instead of the current one:

Ingredients:

  • YouTube Data API. Pulls the information from YouTube.

  • HTML Tidy. Parses the returned HTML page, looking for the OBJECT element and extracts the embedded URL from there.

  • WebRenderer. Provides the embedded browser component.

The latter of the three above was the hardest bit, and it still isn't perfect. First, I searched in vain for a Flash API. One that works on Linux, up to date with the latest Flash versions and, preferably, free and open source. Nothing out there meets these requirements. Secondly, I wrestled with JDIC and then gave up. Simply doesn't work with FireFox. Mozilla and Internet Explorer only, neither of which are an option. I also played with Rich Unger's JDIC Browser plugin from java.net, to no avail. I got quite far, but for the same FireFox reasons, couldn't succeed.

I then basically threw my hands in the air until I suddenly thought: "Who said that JDIC is the only available browser component?" Then I googled around and found WebRenderer. Not ideal, at all, because it is commercial. On the other hand, it doesn't involve native libraries, unlike JDIC, which is a big plus in my book. So, because I simply wanted to get something working, I got the evaluation download. Everything works as expected, basically, except that I'm having problems reloading new movies. (I write a temporary HTML file, as suggested by Sandip in the comments of the previous blog entry.) I don't want to invest too much time on this part, because WebRenderer can't be the real solution. I also get annoying messages about this being an evaluation version, as one might expect. So, my question is, does anyone know of other browser components? I would be so grateful if I could finish this application. And then port it to the NetBeans Platform, of course.

Thursday Nov 29, 2007

1.5 Version of Google Translation Service Integrator

I incremented the NetBeans Google Translator Integrator to 1.5. One can now translate text in any kind of file (Editors/Popup folder, instead of Editors/mime-type/Popup), not just HTML or Java. Go here to get the plugin:

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4189

You'll get a ZIP file with two NBMs. When you're in the Plugin Manager, you'll see this:

After installation, you can translate to your heart's content. Select the from/to languages in the Translate toolbar, then select your text to be translated, and then right-click and choose Translate:

For example, here's something I pasted into the text editor, something I got from the Arabic CNN site:

Then, I chose the Translate menu item and got this:

Many scenarios where this feature might be useful can be imagined. Remember that you're interacting with the on-line Google translation service, under the hood, so make sure to be on-line. If there's an error for any reason, the status bar will tell you so.

Here's a funny Dutch/English translation:

By the way, does someone know how to get the selected index displayed in a JList? By default, the first value in the list is shown in the JList, which is Arabic/Arabic. However, I'd like it to scroll to the selected index by default, at startup, which is English/French. Can someone tell me how to do that?

Saturday Nov 24, 2007

Masters Thesis on the NetBeans Platform

Visualization of Program Dependence Graphs, by Thomas Wurthinger, from the Johannes Kepler University in Linz, Austria, is a paper dealing with the Java HotSpot VM server compiler. It was successfully submitted in partial fulfilment of the requirements of the degree of Master of Science at the abovementioned university.

Below follows a brief interview with Thomas, about his thesis (which is well worth browsing through, in fact, I highly recommend it):

What was your thesis about?

My thesis was about the visualization of the internal graph data structure of the server compiler of the Java HotSpot virtual machine. I developed an application for displaying, filtering, and analyzing the program dependence graph of the compiler. The tool helps to debug the server compiler and understand its optimizations.

Why did you decide to use the NetBeans Platform for your thesis?

Because it fitted best for the purpose of creating a modular GUI application without having to think about the window system or module management. Additionally, the NetBeans Visual Library provides an easy-to-use API for displaying graphs, which is perfectly suitable for my application.

How did you first hear about the NetBeans Platform?

First time I stumbled over NetBeans was when I was porting a C++ application to Java and I was looking for a Java GUI framework. I found the NetBeans Platform homepage and created a prototype application.

How was it to use the NetBeans Platform? Advantages/disadvantages?

The disadvantage of using the NetBeans Platform was the time needed at the beginning of the project to get familiar with the platform. As the application got more and more complex, the advantages of using modularization and the frameworks became clear.

Did it help you in some way in relation to your thesis?

Building my application on top of the NetBeans Platform meant that during development I could focus on the application logic. Plus, the modularization concepts of the NetBeans Platform forced me to give the application a clean modular structure.

How has your thesis been received? What kind of results did you get?

The tool developed as part of the thesis is currently tested by the HotSpot compiler team at Sun Microsystems. Based on the results, I will further improve the application and then publish it as an open source project. The hierarchical layout algorithm implemented for the tool will be integrated into the NetBeans Visual Library.

What are you going to do now that you have graduated?

Currently, I'm doing my civil service. Afterwards, I would like to continue working as a researcher and maybe do a PhD thesis in the area of compiler construction.

And will you continue to use the NetBeans Platform in some way?

Of course I will continue using the NetBeans Platform for developing GUI Java applications. Now that I'm familiar with the concepts of the platform, there's an even greater advantage to using it.

Friday Nov 23, 2007

Citra FX Photo Filter 2.0

What do the two screenshots below have in common?

They both come from Citra FX Photo Filter 2.0, which is a filter effects studio for digital photos. The latest release was announced about a week ago. And... the application is created on top of NetBeans Platform 6. Tonny Kohar and his team at Kiyut in Indonesia are behind this cool software. Here, in an interview conducted over the past few weeks, he spends some time talking especially about the classes they used from the NetBeans Platform 6 APIs.

Thursday Nov 22, 2007

Big Milestone for Groovy and Grails in NetBeans IDE

The biggest development of Groovy and Grails in relation to NetBeans IDE happened yesterday: "Groovy and Grails support in NetBeans has been enabled on Development Update Center." I mean, the most concrete contribution of Groovy and Grails support and the clearest sign that NetBeans loves Groovy (and Grails). The work done by Martin Adamek and Matthias Schmidt is now, for the first time, available in the update center for NetBeans Development Builds (i.e., for post-6.0 builds, hence, not in RC 2). They will not be part of the standard NetBeans IDE 6.0 distribution, because of timing and planning and so on, but anyone with a development build (obtainable from netbeans.org download page) can go to the Plugin Manager and look for Groovy:

Partly, this is what I referred to a few days ago in this blog: "Interestingly, I've talked to lots of people internally in NetBeans and Sun recently about Groovy, even more so than before. Watch this space for some interesting announcements coming up in the next months (or maybe even sooner)."

After installation of the plugin, one has new project templates:

You need to register Groovy and Grails in the Options window, before you can use them. I don't like this. But I can see how it is preferable. It means a smaller NBM distribution and no need for licensing issues, because the user has to register Groovy and Grails themselves. That also allows the user to set a different Groovy or Grails version, if so desired. You could set Groovy 1.0 and then later upgrade to Groovy 1.1, without needing to wait for a related NBM to be distributed. Still, I'm lazy and I liked the approach that I took, where everything was handled internally.

After the above registration, you can generate Grails projects and deploy them. You can also run Groovy scripts:

And how does this relate to my plugin in the Plugin Portal? It doesn't really. It is based on much firmer footing than my plugin. It makes use of the General Scripting Framework, which Tor Norbye is spinning out of his JRuby support. (So, yes, this implies Groovy support in NetBeans IDE will be similar/same as what Tor has been doing for JRuby.) It makes use of the NetBeans Lexer API. It really is the right approach to take, while I took the simplified Schliemann approach. I did that because I wanted a quick result; I wanted to start working with Groovy immediately and Schliemann afforded that opportunity. I got "good enough" results, was able to run Groovy scripts (as well as Java/Groovy combinations, which the Martin/Matthias plugin doesn't yet support). Plus, part of the motivation for my plugin was to say to the Groovy/Grails community: "Hey guys, there are plenty of people in Sun who love your work and, look, one of them has even produced a NetBeans plugin." Both these use cases are now becoming obsolete, because the new plugin caters to both of them. So, sooner or later, I will remove the plugin from the Plugin Portal and point to a tutorial that describes how to use the official plugin in NetBeans. But, since the official plugin will only be official after 6.0, that could still take some time. You're welcome to try either plugin, though the future is clearly with the other one.

So, if interested in Groovy/Grails, download a development build, install the plugin, play around with it, and then file bugs and enhancements in the 'groovy' category in Issuezilla. Information and tasks for this plugin can be found here. The Groovy plugin is built three times a day as part of the development build and committers (you could be one of them, if you're interested) need to be careful because they could even break the build. That's how committed NetBeans is to Groovy and Grails and is a sign of how solid the plugin already is: we are even willing to have the NetBeans builds break for Groovy and Grails.

In other news. Have a look at Wouter van Reeven's article on Seam, Maven, NetBeans IDE, and GlassFish, here.

Friday Nov 16, 2007

Austria in Prague

Around 50 students from various universities in Austria came to see us at Sun in Prague on Thursday. The students are visiting a range of companies (e.g., Siemens and Skoda too) all over the place, it seems. We did presentations on Sun, OpenSolaris, NetBeans IDE, and GlassFish. Here's a pic that shows the general setting, with Petr Jiricka opening the day with a presentation about Sun:

I had the honor of introducing NetBeans IDE and here is my presentation. I really stressed the Java angle (since we had been told the students wanted to hear about Java and Sun), i.e., that Sun supports Java development by providing tools and how the NetBeans team creates all those tools and delivers them in the form of NetBeans IDE. It was pretty cool—during my presentation I developed an application which the GlassFish guys deployed during theirs, showing the seamless integration between development and deployment via the IDE. The questions and discussion at the end were interesting, about UML, Eclipse, plugins, the NetBeans Java editor, NetBeans Platform, and future developments of NetBeans IDE.

Friday Nov 09, 2007

NetBeans Certified Engineers

Jarda and I are at the Institut für Systemsoftware in Linz and have just completed the 1st edition of the brand new NetBeans Certified Engineer Course. The official site at SSW is here. The basic break down of the two days (yesterday and today) was as follows:
  • Introduction to NetBeans Platform
  • A First NetBeans Platform Application
  • Lookup/Architecture
  • System FileSystem
  • Nodes
  • Data Objects
  • Window System
  • Contributing to NetBeans
  • Some Ideas for Modules
  • Wrap up

And now the students need to complete an assignment (here are our suggested assignments) by Friday, 18 January 2008, in order to qualify as a 'NetBeans Certified Engineer'. Here's a pic of the whole group, inc., Jarda and me:

Let us know if there are other institutions/universities/organizations/whatever that would appreciate such a course.

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today