src/macosx/classes/sun/lwawt/macosx/CPlatformView.java

Print this page




 183      */
 184     private void deliverResize(int x, int y, int w, int h) {
 185         peer.notifyReshape(x, y, w, h);
 186     }
 187 
 188 
 189     private void deliverMouseEvent(NSEvent event) {
 190         int x = event.getX();
 191         int y = getBounds().height - event.getY();
 192 
 193         if (event.getType() == CocoaConstants.NSScrollWheel) {
 194             responder.handleScrollEvent(x, y, event.getModifierFlags(),
 195                                         event.getScrollDeltaX(), event.getScrollDeltaY());
 196         } else {
 197             responder.handleMouseEvent(event.getType(), event.getModifierFlags(), event.getButtonNumber(),
 198                                        event.getClickCount(), x, y, event.getAbsX(), event.getAbsY());
 199         }
 200     }
 201 
 202     private void deliverKeyEvent(NSEvent event) {
 203         responder.handleKeyEvent(event.getType(), event.getModifierFlags(),
 204                                  event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
 205     }
 206 
 207     /**
 208      * Called by the native delegate in layer backed view mode or in the simple
 209      * NSView mode. See NSView.drawRect().
 210      */
 211     private void deliverWindowDidExposeEvent() {
 212         peer.notifyExpose(peer.getSize());
 213     }
 214 }


 183      */
 184     private void deliverResize(int x, int y, int w, int h) {
 185         peer.notifyReshape(x, y, w, h);
 186     }
 187 
 188 
 189     private void deliverMouseEvent(NSEvent event) {
 190         int x = event.getX();
 191         int y = getBounds().height - event.getY();
 192 
 193         if (event.getType() == CocoaConstants.NSScrollWheel) {
 194             responder.handleScrollEvent(x, y, event.getModifierFlags(),
 195                                         event.getScrollDeltaX(), event.getScrollDeltaY());
 196         } else {
 197             responder.handleMouseEvent(event.getType(), event.getModifierFlags(), event.getButtonNumber(),
 198                                        event.getClickCount(), x, y, event.getAbsX(), event.getAbsY());
 199         }
 200     }
 201 
 202     private void deliverKeyEvent(NSEvent event) {
 203         responder.handleKeyEvent(event.getType(), event.getModifierFlags(), event.getCharacters(),
 204                                  event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
 205     }
 206 
 207     /**
 208      * Called by the native delegate in layer backed view mode or in the simple
 209      * NSView mode. See NSView.drawRect().
 210      */
 211     private void deliverWindowDidExposeEvent() {
 212         peer.notifyExpose(peer.getSize());
 213     }
 214 }