Example usage for javafx.scene.control ContextMenu getX

List of usage examples for javafx.scene.control ContextMenu getX

Introduction

In this page you can find the example usage for javafx.scene.control ContextMenu getX.

Prototype

public final double getX() 

Source Link

Usage

From source file:org.beryx.viewreka.fxapp.codearea.ViewrekaCodeArea.java

public ViewrekaCodeArea() {
    applyConfiguration(CONFIG);/*from  w  ww  .j  a  v a 2  s.  c  om*/

    ContextMenu cm = new ContextMenu();
    setPopupWindow(cm);
    setPopupAlignment(PopupAlignment.CARET_BOTTOM);
    setPopupAnchorOffset(new Point2D(-20, 1));
    cm.setOnShown(ev -> codeTemplatesCoordinates = new double[] { cm.getX(), cm.getY() });

    EventHandler<? super KeyEvent> tabHandler = EventHandlerHelper
            .on(EventPattern.keyPressed(KeyCode.SPACE, KeyCombination.CONTROL_DOWN))
            .act(ev -> showContextMenu(cm)).create();
    EventHandlerHelper.install(onKeyPressedProperty(), tabHandler);
}