Java 类javafx.event.EventDispatchChain 实例源码

项目:Gargoyle    文件:SqlTab.java   
@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;
}
项目:CalendarFX    文件:Calendar.java   
@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;
    });
}
项目:travelimg    文件:GoogleMapScene.java   
@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);
}
项目:mars-sim    文件:WebEventDispatcher.java   
@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);
}
项目:GMapsFX    文件:GoogleMapView.java   
@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);
}
项目:Suji    文件:LocalGame.java   
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    return publisher.buildEventDispatchChain(tail);
}
项目:Suji    文件:SpectatorGameHandler.java   
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    return publisher.buildEventDispatchChain(tail);
}
项目:Gargoyle    文件:AbstractFxVoAutoCompletionBinding.java   
/** {@inheritDoc} */
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    return tail.prepend(eventHandlerManager);
}
项目:Gargoyle    文件:DockTab.java   
/**
 * @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);
}
项目:JGitFX    文件:GitDialog.java   
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    return dialog.buildEventDispatchChain(tail);
}
项目:Gamma-Music-Manager    文件:CustomEventDispatcher.java   
/**
 * 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);
}
项目:JFoenix    文件:JFXAlert.java   
/**
 * {@inheritDoc}
 */
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    return super.buildEventDispatchChain(tail).prepend(eventHandlerManager);
}
项目:javafx-widgets    文件:AutoCompletePopup.java   
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
  return super.buildEventDispatchChain(tail).append(eventHandlerManager);
}
项目:javafx-widgets    文件:AutoCompletionBinding.java   
@Override
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
  return tail.prepend(eventHandlerManager);
}
项目:botcoin    文件:InputFieldSkin.java   
@Override public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
    EventDispatchChain chain = new EventDispatchChainImpl();
    chain.append(textField.getEventDispatcher());
    return chain;
}