// Redirects events from component to rendering control so
// that the event handling order is maintained if other controls
// such as overlays are added to the component hierarchy and
// consume events before they reach the rendering control
mxMouseRedirector redirector = new mxMouseRedirector(graphComponent);
addMouseMotionListener(redirector);
addMouseListener(redirector);
}