modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 35,44 **** --- 35,46 ---- import com.sun.glass.ui.ClipboardAssistance; import com.sun.glass.ui.View; import com.sun.glass.ui.Window; import com.sun.javafx.PlatformUtil; import com.sun.javafx.collections.TrackableObservableList; + import com.sun.javafx.logging.PulseLogger; + import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED; import com.sun.javafx.scene.input.KeyCodeMap; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList;
*** 128,137 **** --- 130,140 ---- char[] chars; int modifiers; @Override public Void run() { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(keyEventType(type).toString()); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 177,186 **** --- 180,190 ---- } } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } return null; } }
*** 250,259 **** --- 254,265 ---- boolean isPopupTrigger; boolean isSynthesized; @Override public Void run() { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(mouseEventType(type).toString()); + int buttonMask; switch (button) { case MouseEvent.BUTTON_LEFT: buttonMask = KeyEvent.MODIFIER_BUTTON_PRIMARY; break;
*** 318,327 **** --- 324,334 ---- } } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } return null; } }
*** 347,356 **** --- 354,364 ---- @Override public void handleMenuEvent(final View view, final int x, final int y, final int xAbs, final int yAbs, final boolean isKeyboardTrigger) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("MENU_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 365,384 **** --- 373,394 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public void handleScrollEvent(final View view, final long time, final int x, final int y, final int xAbs, final int yAbs, final double deltaX, final double deltaY, final int modifiers, final int lines, final int chars, final int defaultLines, final int defaultChars, final double xMultiplier, final double yMultiplier) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("SCROLL_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 404,413 **** --- 414,424 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } // TODO: Define these somewhere else. It is Windows specific for now. private final static byte ATTR_INPUT = 0x00;
*** 479,488 **** --- 490,500 ---- @Override public void handleInputMethodEvent(final long time, final String text, final int[] clauseBoundary, final int[] attrBoundary, final byte[] attrValue, final int commitCount, final int cursorPos) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("INPUT_METHOD_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 503,512 **** --- 515,525 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public double[] getInputMethodCandidatePos(int offset) {
*** 564,620 **** --- 577,645 ---- @Override public int handleDragEnter(View view, final int x, final int y, final int xAbs, final int yAbs, final int recommendedDropAction, final ClipboardAssistance dropTargetAssistant) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_ENTER"); TransferMode action = dndHandler.handleDragEnter(x, y, xAbs, yAbs, actionToTransferMode(recommendedDropAction), dropTargetAssistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); return transferModeToAction(action); } @Override public void handleDragLeave(View view, final ClipboardAssistance dropTargetAssistant) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_LEAVE"); dndHandler.handleDragLeave(dropTargetAssistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } @Override public int handleDragDrop(View view, final int x, final int y, final int xAbs, final int yAbs, final int recommendedDropAction, final ClipboardAssistance dropTargetAssistant) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_DROP"); TransferMode action = dndHandler.handleDragDrop(x, y, xAbs, yAbs, actionToTransferMode(recommendedDropAction), dropTargetAssistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); return transferModeToAction(action); } @Override public int handleDragOver(View view, final int x, final int y, final int xAbs, final int yAbs, final int recommendedDropAction, final ClipboardAssistance dropTargetAssistant) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_OVER"); final TransferMode action = dndHandler.handleDragOver(x, y, xAbs, yAbs, actionToTransferMode(recommendedDropAction), dropTargetAssistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); return transferModeToAction(action); } private ClipboardAssistance dropSourceAssistant; @Override public void handleDragStart(View view, final int button, final int x, final int y, final int xAbs, final int yAbs, final ClipboardAssistance assistant) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_START"); dropSourceAssistant = assistant; dndHandler.handleDragStart(button, x, y, xAbs, yAbs, assistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } @Override public void handleDragEnd(View view, final int performedAction) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("DRAG_END"); dndHandler.handleDragEnd(actionToTransferMode(performedAction), dropSourceAssistant); + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } // TODO - dropTargetListener.dropActionChanged // TODO - dragSourceListener.dropActionChanged
*** 682,704 **** return null; } } @Override public void handleViewEvent(View view, long time, final int type) { viewNotification.view = view; viewNotification.time = time; viewNotification.type = type; ! AccessController.doPrivileged(viewNotification, scene.getAccessControlContext()); } @Override public void handleScrollGestureEvent( View view, final long time, final int type, final int modifiers, final boolean isDirect, final boolean isInertia, final int touchCount, final int x, final int y, final int xAbs, final int yAbs, final double dx, final double dy, final double totaldx, final double totaldy, final double multiplierX, final double multiplierY) { WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); } --- 707,735 ---- return null; } } @Override public void handleViewEvent(View view, long time, final int type) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("VIEW_EVENT: "+ViewEvent.getTypeString(type)); viewNotification.view = view; viewNotification.time = time; viewNotification.type = type; ! try { AccessController.doPrivileged(viewNotification, scene.getAccessControlContext()); } + finally { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); + } + } @Override public void handleScrollGestureEvent( View view, final long time, final int type, final int modifiers, final boolean isDirect, final boolean isInertia, final int touchCount, final int x, final int y, final int xAbs, final int yAbs, final double dx, final double dy, final double totaldx, final double totaldy, final double multiplierX, final double multiplierY) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("SCROLL_GESTURE_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 739,748 **** --- 770,780 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public void handleZoomGestureEvent( View view, final long time, final int type,
*** 750,759 **** --- 782,792 ---- final int originx, final int originy, final int originxAbs, final int originyAbs, final double scale, double expansion, final double totalscale, double totalexpansion) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("ZOOM_GESTURE_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 791,810 **** --- 824,845 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public void handleRotateGestureEvent( View view, final long time, final int type, final int modifiers, final boolean isDirect, final boolean isInertia, final int originx, final int originy, final int originxAbs, final int originyAbs, final double dangle, final double totalangle) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("ROTATE_GESTURE_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 842,860 **** --- 877,897 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public void handleSwipeGestureEvent( View view, final long time, int type, final int modifiers, final boolean isDirect, boolean isInertia, final int touchCount, final int dir, final int x, final int y, final int xAbs, final int yAbs) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("SWIPE_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 895,911 **** --- 932,950 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } } @Override public void handleBeginTouchEvent( View view, final long time, final int modifiers, final boolean isDirect, final int touchEventCount) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("BEGIN_TOUCH_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 925,943 **** --- 964,984 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } gestures.notifyBeginTouchEvent(time, modifiers, isDirect, touchEventCount); } @Override public void handleNextTouchEvent( View view, final long time, final int type, final long touchId, final int x, final int y, final int xAbs, final int yAbs) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("NEXT_TOUCH_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 969,984 **** --- 1010,1027 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } gestures.notifyNextTouchEvent(time, type, touchId, x, y, xAbs, yAbs); } @Override public void handleEndTouchEvent(View view, long time) { + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput("END_TOUCH_EVENT"); WindowStage stage = scene.getWindowStage(); try { if (stage != null) { stage.setInEventHandler(true); }
*** 993,1002 **** --- 1036,1046 ---- }, scene.getAccessControlContext()); } finally { if (stage != null) { stage.setInEventHandler(false); } + if (PULSE_LOGGING_ENABLED) PulseLogger.newInput(null); } gestures.notifyEndTouchEvent(time); } }