List of usage examples for javafx.scene.control ContextMenu getX
public final double getX()
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); }