Adding a Google Search Web Element to a Wordpress theme

The newly released Google Web element: custom search is awesome. To add it to my wordpress theme (which doesn’t have a top sidebar for widgets) I had to edit (Appearance ⇒ Editor) the header.php file and add the snippet I got from Google there, at just at the end of the header.php. So the search web element is show right after the banner and before the posts. ...

September 16, 2009

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

NullPointerException in FontDesignMetrics$MetricsKey.init when using Netbeans Visual Library

If you’re getting a NullPointerException stacktrace like the one below while using the Netbeans Visual Library to create your own GraphScene, check that your adding your widgets propertly to scene. A good idea is to use LayerWidgets, declaring them in the constructor of your GraphScene: mainLayer = new LayerWidget(this); addChild(mainLayer); connectionLayer = new LayerWidget(this); addChild(connectionLayer); and then add the widgets to those layers in attachNodeWidget and attachEdgeWidget: @Override protected Widget attachNodeWidget(String node) { LabelWidget w = new LabelWidget(this, node); w.setBorder(BORDER4); w.getActions().addAction(createSelectAction()); w.getActions().addAction(createObjectHoverAction()); w.getActions().addAction(ActionFactory.createMoveAction()); this.mainLayer.addChild(w); return w; } @Override protected Widget attachEdgeWidget(String edge) { ConnectionWidget w = new ConnectionWidget(this); w.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED); this.connectionLayer.addChild(w); return w; } The stacktrace: ...

April 30, 2009

Changed to Sandbox theme today

I think it was about time to change theme. I opted for Sandbox, I like the clean look. I was surprised on how well the change theme procedure was, just switch theme and the sidebar (with all the widgets) it’s still there.

March 28, 2009