public void paintHandle(Graphics2D g) {
if (hasVisibleHandle()) {
// Create a canvas with a transparent background.
nodebox.graphics.Canvas canvas = new nodebox.graphics.Canvas();
canvas.setBackground(new nodebox.graphics.Color(0, 0, 0, 0));
CanvasContext ctx = new CanvasContext(canvas);
try {
handle.draw(ctx);
} catch (Exception e) {
e.printStackTrace();
}
ctx.getCanvas().draw(g);
}
}