Example usage for javafx.scene.control ContextMenu getY

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

Introduction

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

Prototype

public final double getY() 

Source Link

Usage

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

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

    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);
}