Dispatch native event: produce appropriate AWT events,
update component's fields when needed
int eventId = event.getEventId();
if (eventId == NativeEvent.ID_CREATED) {
return toolkit.onWindowCreated(event.getWindowId());
} else if (eventId == NativeEvent.ID_MOUSE_GRAB_CANCELED) {
return mouseGrabManager.onGrabCanceled();
//???AWT
// } else if (popupDispatcher.onEvent(event)) {
// return false;
} else {
Component src = toolkit.getComponentById(event.getWindowId());
if (src != null) {
if (((eventId >= ComponentEvent.COMPONENT_FIRST) && (eventId <= ComponentEvent.COMPONENT_LAST))
|| ((eventId >= WindowEvent.WINDOW_FIRST) && (eventId <= WindowEvent.WINDOW_LAST))
|| (eventId == NativeEvent.ID_INSETS_CHANGED)
|| (eventId == NativeEvent.ID_BOUNDS_CHANGED)
|| (eventId == NativeEvent.ID_THEME_CHANGED)) {
return componentDispatcher.dispatch(src, event);
} else if ((eventId >= MouseEvent.MOUSE_FIRST)
&& (eventId <= MouseEvent.MOUSE_LAST)) {
return mouseDispatcher.dispatch(src, event);
} else if (eventId == PaintEvent.PAINT) {
//???AWT: src.redrawManager.addPaintRegion(src, event.getClipRects());
return true;
}
}
if ((eventId >= FocusEvent.FOCUS_FIRST)
&& (eventId <= FocusEvent.FOCUS_LAST)) {
//???AWT: return focusDispatcher.dispatch(src, event);
return false;
} else if ((eventId >= KeyEvent.KEY_FIRST)
&& (eventId <= KeyEvent.KEY_LAST)) {
return keyDispatcher.dispatch(src, event);
}
}
return false;