Painting LabelWidgets on top of the ConnectionWidget - Netbeans Visual Library

I was fiddling with the Netbeans Visual Library again, trying to show a complex graph on screen and I run into a problem: There were so many connection in the graph that some widgets were hard to read because the ConnectionWidget arrows were printed over them. So I tried to I try to rearrange the order of my LayerWidgets to paint the LabelWidgets on top of ConnectionWidgets. A call to mainLayer.bringToFront() should be enough, but this is what I got when I tried that: ...

May 7, 2009

Force Directed Layout in NetBeans

I just came up with the idea of reproducing the GraphView demo I saw in prefuse by using the Netbeans Visual Library API. The GraphView demo uses a Force Directed Layout algorithm to dinamically position the nodes on the screen. It’s really fast and cool. Download prefuse and experiment with it by yourself. I wanted to achieve something similiar with the Visual Library and I succeed up to a point. The force based layout algorithm that I implemented is much simpler that the used in prefuse, so there is no spring-like movement. It looks way cooler with springs. It just uses repulsion between nodes and attraction between connected nodes. ...

March 9, 2009

Simple Interactions Between NetBeans TopComponents

Basic stuff: how to communicate / interact bewteen two TopComponent in Netbeans. LIke a updating a JTable inside a TopComponent from a JButton in another TopComponent. The key is in the TopComponent.findInstance method as explained by Geertjan in p. Simple Interactions Between NetBeans TopComponents.

March 3, 2009

Netbeans: "Problem when deserializing TopComponent for tcID"

Today I experienced a strange problem. Or I thought it was strange . I just checkout a my project from Subversion into Netbeans and it didn’t work!. How come? I have another working copy that works just ok. So I check the logs in $app/build/testuserdir/var/log/messages.log and I found INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'XBeeTopComponent'. Reason: com/rapplogic/xbee/api/XBeeException java.lang.NoClassDefFoundError: com/rapplogic/xbee/api/XBeeException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2395) at java.lang.Class.getMethod0(Class.java:2642) at java.lang.Class.getMethod(Class.java:1579) at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.createFromMethod(XMLSettingsSupport.java:664) at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.instanceCreate(XMLSettingsSupport.java:581) at org.netbeans.modules.settings.convertors.SerialDataConvertor$SettingsInstance.instanceCreate(SerialDataConvertor.java:420) [catch] at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentPersistentForID(PersistenceManager.java:531) at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentForID(PersistenceManager.java:641) at org.netbeans.core.windows.PersistenceHandler.getTopComponentForID(PersistenceHandler.java:422) at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:162) at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:69) at org.netbeans.core.NonGui$2.run(NonGui.java:178) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) NoClassDefDFoundError. ok. It was working before but I can take look. Guess what I changed the name of the jar that contains that class, long time ago but it didn’t show up until now when I started from a clean directory. I found that in the Library Wrapper Module project..xml still contains the old name ...

March 2, 2009

Firefox detecting wrong Java Plugin version on Windows.

First read this Mozillazine page In my case the problem was that some program overwrote the registry entry HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/BrowserJavaVersion with the old value 1.6.0_01. When I set it back to 1.6.0_06 everything worked fine again. Now the addons window looks like before it showed Java Platform SE 6 U1 instead

December 12, 2008

Java WebStart UnavailableServiceException

If you are getting javax.jnlp.UnavailableServiceException from javax.jnlp.ServiceManager.lookup() or if javax.jnlp.ServiceManager.getServicesNames returns null you must be aware that those call only return useful thing when you run your code from the Java Web Start environment. It’s not enough to include the jnlp.jar or javaws.jar in the classpath. For example to make it work from Netbeans you must enable WebStart in the project and Set Configuration to WebStart.

August 7, 2008

Typing tilde on Netbeans 6.1 - annoying java bug

It seems that is imposible to type the ˜ symbol (named also tilde,squiggle,twiddle,not,approx,wiggle,swung,dash,enyay,sqiggle) in Netbeans with a Swedish keyboard at least. It seems that it’s a long known java bug (bug 6353098, bug 6253172). At least I can use the Alt+126 code to type it.

July 11, 2008

Adding Netbeans API source navigation to your Netbeans IDE

It took a while to find this entry describing how to include the Netbeans APIs source code. In short, you have to download the actual sources (the link in Geertjan’s Weblog is outdated) at http://download.netbeans.org/netbeans/6.0/final/zip/ (file netbeans-*-platform-src.zip) and then link that zip file to the platform in the platform manager. Make sure that the path doesn’t contains whitespaces (it didn’t work for me). To access the Netbeans Platform Manager just do Tools -> Netbeans Platforms ...

February 14, 2008

More graphs

I continue looking for graph visualization software. I rn into prefuse. Looks promising, take a look into the gallery to see some examples. But it’s still only a toolkit so it means that I have to develop at least a little application to be able to visualize my graph. I tried using the examples that come with prefuse and they work but they are not enough. I just converted my data to GraphML and I was able to load it into the GraphView example. But I need to add some functionality to it before I can actually use it to analyze my graph. I’m not sure I can use prefuse to print out the graph anyway so I’m giving up for a while. This graph thing it’s taking too much time, but I will try to come back to it some day.

November 18, 2007

Graph visualization

After spending a bunch of time with the graphviz utilities (neato, dot, circo and twopi) trying to create a graph to understand the software dependencies between modules in a project I’ve been I assigned I realized that those tools don’t work well with large graphs. I tried and tried with no luck, I thought that the old linux kernel map poster used graphviz to create the poster but after googling a bit and reading the code for the FCGP project I found that they write PostScript directly. I was looking for something simpler. ...

November 14, 2007