@Override public Event dispatchEvent(Event event, EventDispatchChain tail) { KeyEvent keyE = (KeyEvent) event; // 저장키를 누른경우 * 탭명에 *을 지우기 위한 작업처리 String text2 = getText(); if (keyE != null) { if (KeyCode.O == keyE.getCode() && keyE.isControlDown() && !keyE.isAltDown() && !keyE.isShiftDown()) { miOenOnAction(new ActionEvent()); keyE.consume(); } else if (KeyCode.S == keyE.getCode() && keyE.isControlDown() && !keyE.isAltDown() && !keyE.isShiftDown()) { muSaveOnAction(new ActionEvent()); keyE.consume(); } } if (!text2.contains("*")) setText(text2 + "*"); // } return event; }
@Override public final EventDispatchChain buildEventDispatchChain(EventDispatchChain givenTail) { return givenTail.append((event, tail) -> { if (event instanceof CalendarEvent) { for (EventHandler<CalendarEvent> handler : eventHandlers) { handler.handle((CalendarEvent) event); } } return event; }); }
@Override public Event dispatchEvent(Event event, EventDispatchChain tail) { if (event instanceof MouseEvent) { MouseEvent mouseEvent = (MouseEvent) event; //workaround to deny doubleclicks. this is // a jdk related bug: https://bugs.openjdk.java.net/browse/JDK-8092649 if(mouseEvent.getClickCount()>=2){ mouseEvent.consume(); } } return originalDispatcher.dispatchEvent(event, tail); }
@Override public Event dispatchEvent(Event event, EventDispatchChain tail) { if (event instanceof MouseEvent){ MouseEvent m = (MouseEvent)event; if (event.getEventType().equals(MouseEvent.MOUSE_CLICKED) || event.getEventType().equals(MouseEvent.MOUSE_PRESSED)) { Point2D origin = new Point2D(m.getX(),m.getY()); if (limit != null) allowDrag = !(origin.getX() < limit.getX() && origin.getY() < limit.getY()); } // avoid selection with mouse dragging, allowing dragging the scrollbars if (event.getEventType().equals(MouseEvent.MOUSE_DRAGGED)) { if(!allowDrag){ event.consume(); } } // Avoid selection of word, line, paragraph with mouse click if(m.getClickCount() > 1){ event.consume(); } } if (event instanceof KeyEvent && event.getEventType().equals(KeyEvent.KEY_PRESSED)){ KeyEvent k = (KeyEvent)event; // Avoid copy with Ctrl+C or Ctrl+Insert if((k.getCode().equals(KeyCode.C) || k.getCode().equals(KeyCode.INSERT)) && k.isControlDown()){ event.consume(); } // Avoid selection with shift+Arrow if(k.isShiftDown() && (k.getCode().equals(KeyCode.RIGHT) || k.getCode().equals(KeyCode.LEFT) || k.getCode().equals(KeyCode.UP) || k.getCode().equals(KeyCode.DOWN))){ event.consume(); } } return oldDispatcher.dispatchEvent(event, tail); }
@Override public Event dispatchEvent(Event event, EventDispatchChain tail) { if (event instanceof MouseEvent) { MouseEvent mouseEvent = (MouseEvent) event; if (mouseEvent.getClickCount() > 1) { if (disableDoubleClick) { mouseEvent.consume(); } } } return originalDispatcher.dispatchEvent(event, tail); }
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return publisher.buildEventDispatchChain(tail); }
/** {@inheritDoc} */ @Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return tail.prepend(eventHandlerManager); }
/** * @treatAsPrivate implementation detail * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ @Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return tail.prepend(eventHandlerManager); }
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return dialog.buildEventDispatchChain(tail); }
/** * Override the default collapse/expand behaviour of TreeViewItems, only show content in center panel * @param event * @param tail * @return dispatch event */ @Override public Event dispatchEvent(Event event, EventDispatchChain tail) { if (event instanceof MouseEvent) { MouseEvent mouseEvent = (MouseEvent) event; boolean isPrimaryMouseButton = mouseEvent.getButton() == MouseButton.PRIMARY; boolean isDoubleClick = mouseEvent.getClickCount() == 2; if (isPrimaryMouseButton && isDoubleClick) { if (!event.isConsumed()) { if (m_selectedItem != null) { boolean isFolder = m_selectedItem.getFile().isDirectory(); //Only notify center panel if this is a left panel and if this is a directory if (m_isLeftPane && isFolder) { System.out.println("Selected Item: " + m_selectedItem); m_model.setM_selectedCenterFolder(m_selectedItem.getFile()); m_model.notifyCenterFolderObservers(); } else if (!isFolder) { Song songToPlay = (Song) m_selectedItem; if (!songToPlay.equals(m_musicPlayerManager.getCurrentSongPlaying())) { m_musicPlayerManager.playSongRightNow(songToPlay); } } } } event.consume(); } /*else if (mouseEvent.isControlDown() && mouseEvent.isPrimaryButtonDown()) { if (!event.isConsumed()) { if (m_selectedItem instanceof Song) { Song songSelected = (Song) m_selectedItem; if (m_playbackContextMenuInstance != null) { m_playbackContextMenuInstance.hide(); } m_playbackContextMenuInstance = MusicPlayerHistoryUI.createSubmenu(m_musicPlayerManager, songSelected); m_playbackContextMenuInstance.show(m_tree, mouseEvent.getScreenX(), mouseEvent.getScreenY()); } } event.consume(); }*/ } return m_originalDispatcher.dispatchEvent(event, tail); }
/** * {@inheritDoc} */ @Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return super.buildEventDispatchChain(tail).prepend(eventHandlerManager); }
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return super.buildEventDispatchChain(tail).append(eventHandlerManager); }
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { return tail.prepend(eventHandlerManager); }
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) { EventDispatchChain chain = new EventDispatchChainImpl(); chain.append(textField.getEventDispatcher()); return chain; }