* one found. If the event is not consumed, repeat.
*/
private void dispatchEventUpTree(Figure f, LayerEvent e) {
// Scan up the tree try to dispatch the event
while (f != null) {
Interactor interactor = f.getInteractor();
if (interactor != null) {
// Set the figure source
e.setFigureSource(f);
if (interactor.accept(e)) {
// Send the event to the interactor
switch (e.getID()) {
case MouseEvent.MOUSE_DRAGGED:
interactor.mouseDragged(e);
break;
case MouseEvent.MOUSE_PRESSED:
interactor.mousePressed(e);
break;
case MouseEvent.MOUSE_RELEASED:
interactor.mouseReleased(e);
break;
case MouseEvent.MOUSE_CLICKED:
interactor.mouseClicked(e);
break;
}
}
}