4937 env->FindClass("java/awt/event/MouseWheelEvent");
4938 CHECK_NULL(mouseWheelEventClsLocal);
4939 mouseWheelEventCls = (jclass)env->NewGlobalRef(mouseWheelEventClsLocal);
4940 env->DeleteLocalRef(mouseWheelEventClsLocal);
4941 }
4942 RECT insets;
4943 GetInsets(&insets);
4944
4945 static jmethodID mouseWheelEventConst;
4946 if (mouseWheelEventConst == NULL) {
4947 mouseWheelEventConst =
4948 env->GetMethodID(mouseWheelEventCls, "<init>",
4949 "(Ljava/awt/Component;IJIIIIIIZIIID)V");
4950 DASSERT(mouseWheelEventConst);
4951 CHECK_NULL(mouseWheelEventConst);
4952 }
4953 if (env->EnsureLocalCapacity(2) < 0) {
4954 return;
4955 }
4956 jobject target = GetTarget(env);
4957 DTRACE_PRINTLN("creating MWE in JNI");
4958
4959 jobject mouseWheelEvent = env->NewObject(mouseWheelEventCls,
4960 mouseWheelEventConst,
4961 target,
4962 id, when, modifiers,
4963 x+insets.left, y+insets.top,
4964 0, 0,
4965 clickCount, popupTrigger,
4966 scrollType, scrollAmount,
4967 roundedWheelRotation, preciseWheelRotation);
4968
4969 DASSERT(mouseWheelEvent != NULL);
4970 if (mouseWheelEvent == NULL || safe_ExceptionOccurred(env)) {
4971 env->ExceptionDescribe();
4972 env->ExceptionClear();
4973 env->DeleteLocalRef(target);
4974 return;
4975 }
4976 if (pMsg != NULL) {
4977 AwtAWTEvent::saveMSG(env, pMsg, mouseWheelEvent);
4978 }
4979 SendEvent(mouseWheelEvent);
4980
4981 env->DeleteLocalRef(mouseWheelEvent);
4982 env->DeleteLocalRef(target);
4983 }
4984
|
4937 env->FindClass("java/awt/event/MouseWheelEvent");
4938 CHECK_NULL(mouseWheelEventClsLocal);
4939 mouseWheelEventCls = (jclass)env->NewGlobalRef(mouseWheelEventClsLocal);
4940 env->DeleteLocalRef(mouseWheelEventClsLocal);
4941 }
4942 RECT insets;
4943 GetInsets(&insets);
4944
4945 static jmethodID mouseWheelEventConst;
4946 if (mouseWheelEventConst == NULL) {
4947 mouseWheelEventConst =
4948 env->GetMethodID(mouseWheelEventCls, "<init>",
4949 "(Ljava/awt/Component;IJIIIIIIZIIID)V");
4950 DASSERT(mouseWheelEventConst);
4951 CHECK_NULL(mouseWheelEventConst);
4952 }
4953 if (env->EnsureLocalCapacity(2) < 0) {
4954 return;
4955 }
4956 jobject target = GetTarget(env);
4957 DWORD curMousePos = ::GetMessagePos();
4958 int xAbs = GET_X_LPARAM(curMousePos);
4959 int yAbs = GET_Y_LPARAM(curMousePos);
4960
4961 DTRACE_PRINTLN("creating MWE in JNI");
4962
4963 jobject mouseWheelEvent = env->NewObject(mouseWheelEventCls,
4964 mouseWheelEventConst,
4965 target,
4966 id, when, modifiers,
4967 x+insets.left, y+insets.top,
4968 xAbs, yAbs,
4969 clickCount, popupTrigger,
4970 scrollType, scrollAmount,
4971 roundedWheelRotation, preciseWheelRotation);
4972
4973 DASSERT(mouseWheelEvent != NULL);
4974 if (mouseWheelEvent == NULL || safe_ExceptionOccurred(env)) {
4975 env->ExceptionDescribe();
4976 env->ExceptionClear();
4977 env->DeleteLocalRef(target);
4978 return;
4979 }
4980 if (pMsg != NULL) {
4981 AwtAWTEvent::saveMSG(env, pMsg, mouseWheelEvent);
4982 }
4983 SendEvent(mouseWheelEvent);
4984
4985 env->DeleteLocalRef(mouseWheelEvent);
4986 env->DeleteLocalRef(target);
4987 }
4988
|