Adding Mouse Events to Connectors......

14 views
Skip to first unread message

IT-networking

unread,
Jan 7, 2010, 12:12:20 AM1/7/10
to gwt-connectors
Hi.,

How can i add mouse listeners/click listeners to connectors
(arrows) .......i'm using GWT Connectors......my requirement is that
on clicking(right click) the connector(arrow), a dialog box opens.

KenJi_getpowered

unread,
Mar 5, 2010, 8:44:01 AM3/5/10
to gwt-connectors
I don't know if that is the best way to do because the right click is
not really well implemented in GWT...
I wanted to use the doubleclick but it is the same problem.
Maybe it is better that when you click on the object then it is loaded
into an handler then you can do what you want (even open a dialog box)

But if you found any solution I would love to know it :)

KenJi_getpowered

unread,
Mar 5, 2010, 11:27:33 AM3/5/10
to gwt-connectors
I tried to extend the connector class and implements the
HasDoubleClickHandlers interface with this code but it didn't work,
the connector class somehow intercept the double click event. You can
see it when you join two corner points and double click on the
connector as it merge the two corners.

************************************************************************************************

@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler
handler) {
return ensureHandlers().addHandler(DoubleClickEvent.getType(),
handler);
}

@Override
public void fireEvent(GwtEvent<?> event) {
if (handlerManager != null) {
handlerManager.fireEvent(event);
}
}

/**
* Ensures the existence of the handler manager.
*
* @return the handler manager
* */
HandlerManager ensureHandlers() {
return handlerManager == null ? handlerManager = new
HandlerManager(this)
: handlerManager;
}

************************************************************************************************

KenJi_getpowered

unread,
Mar 5, 2010, 11:55:44 AM3/5/10
to gwt-connectors
It is too hard to re write the implementation, maybe the better way
would be to make the connector class extends the widget class.

Maybe I will try or ask the creator.

On 5 mar, 17:27, KenJi_getpowered <mikael.k...@gmail.com> wrote:
> I tried to extend the connector class and implements the
> HasDoubleClickHandlers interface with this code but it didn't work,

> the connector class somehow intercept the doubleclickevent. You can
> see it when you join two corner points and doubleclickon the

> > Maybe it is better that when youclickon the object then it is loaded


> > into an handler then you can do what you want (even open a dialog box)
>
> > But if you found any solution I would love to know it :)
>
> > On 7 jan, 06:12, IT-networking <deepti0...@gmail.com> wrote:
>
> > > Hi.,
>

> > > How can i add mouse listeners/clicklisteners to connectors


> > > (arrows) .......i'm using GWT Connectors......my requirement is that

> > > on clicking(rightclick) the connector(arrow), a dialog box opens.

KenJi_getpowered

unread,
Mar 18, 2010, 10:59:52 AM3/18/10
to gwt-connectors
I tried to make the connector extend widget, it does not work as it is
not the connector object that is drawn. It does not work either with
sections that I don't know why. And sections are re drawned each time
you move anything.... glurpppp

I don't know.

Reply all
Reply to author
Forward
0 new messages