283 - (void) keyUp: (NSEvent *)event { 284 [self deliverJavaKeyEventHelper: event]; 285 } 286 287 - (void) flagsChanged: (NSEvent *)event { 288 [self deliverJavaKeyEventHelper: event]; 289 } 290 291 - (BOOL) performKeyEquivalent: (NSEvent *) event { 292 [self deliverJavaKeyEventHelper: event]; 293 return NO; 294 } 295 296 /** 297 * Utility methods and accessors 298 */ 299 300 -(void) deliverJavaMouseEvent: (NSEvent *) event { 301 BOOL isEnabled = YES; 302 NSWindow* window = [self window]; 303 if ([window isKindOfClass: [AWTWindow class]]) { 304 isEnabled = [(AWTWindow*)window isEnabled]; 305 } 306 307 if (!isEnabled) { 308 return; 309 } 310 311 [AWTToolkit eventCountPlusPlus]; 312 313 JNIEnv *env = [ThreadUtilities getJNIEnv]; 314 315 NSPoint eventLocation = [event locationInWindow]; 316 NSPoint localPoint = [self convertPoint: eventLocation fromView: nil]; 317 NSPoint absP = [NSEvent mouseLocation]; 318 NSEventType type = [event type]; 319 320 // Convert global numbers between Cocoa's coordinate system and Java. 321 // TODO: need consitent way for doing that both with global as well as with local coordinates. 322 // The reason to do it here is one more native method for getting screen dimension otherwise. 323 324 NSRect screenRect = [[NSScreen mainScreen] frame]; | 283 - (void) keyUp: (NSEvent *)event { 284 [self deliverJavaKeyEventHelper: event]; 285 } 286 287 - (void) flagsChanged: (NSEvent *)event { 288 [self deliverJavaKeyEventHelper: event]; 289 } 290 291 - (BOOL) performKeyEquivalent: (NSEvent *) event { 292 [self deliverJavaKeyEventHelper: event]; 293 return NO; 294 } 295 296 /** 297 * Utility methods and accessors 298 */ 299 300 -(void) deliverJavaMouseEvent: (NSEvent *) event { 301 BOOL isEnabled = YES; 302 NSWindow* window = [self window]; 303 if ([window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]]) { 304 isEnabled = [(AWTWindow*)[window delegate] isEnabled]; 305 } 306 307 if (!isEnabled) { 308 return; 309 } 310 311 [AWTToolkit eventCountPlusPlus]; 312 313 JNIEnv *env = [ThreadUtilities getJNIEnv]; 314 315 NSPoint eventLocation = [event locationInWindow]; 316 NSPoint localPoint = [self convertPoint: eventLocation fromView: nil]; 317 NSPoint absP = [NSEvent mouseLocation]; 318 NSEventType type = [event type]; 319 320 // Convert global numbers between Cocoa's coordinate system and Java. 321 // TODO: need consitent way for doing that both with global as well as with local coordinates. 322 // The reason to do it here is one more native method for getting screen dimension otherwise. 323 324 NSRect screenRect = [[NSScreen mainScreen] frame]; |