tags:

views:

613

answers:

1

Hi everybody.

I'm trying to build a Mind Mapping application within GWT by using RDF to store the Mind Map (I'm using Jena as the RDF Library).

But I'm having to problems:

  1. When I load the map, In java swt theres is a way a canvas draw an string as an image. But with the GWT canvas I can't do that. So, how can I convert an string to an "image" in order to put it within the GWT canvas.

  2. Im have kind of concepts (boxes) displayed within the GWT canvas. Its posible to have a "click handler" that can identify the coordinates there the user clicks the canvas?

Thank you very much for the help :)

+1  A: 

1) I noticed the following library which provides font rendering for the GWT Canvas. Hope that helps.

2) In a comment on the GWTCanvas wiki the following code was pasted by 'matt.d.hilliard' (direct linking appears impossible alas):

import com.google.gwt.event.dom.client.HasMouseDownHandlers;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.widgetideas.graphics.client.GWTCanvas;

public class Canvas extends GWTCanvas implements HasMouseDownHandlers {

    public Canvas() {
        super();
    }

    public Canvas(int coordX, int coordY) {
        super(coordX, coordY);
    }

    public Canvas(int coordX, int coordY, int pixelX, int pixelY) {
        super(coordX, coordY, pixelX, pixelY);
    }

    public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
        return addDomHandler(handler, MouseDownEvent.getType());
    }
}
Alexander Kellett