Search in sources :

Example 1 with ContextMenuEvent

use of javafx.scene.input.ContextMenuEvent in project completable-reactor by ru-fix.

the class TransitionLine method initializePopupMenu.

void initializePopupMenu() {
    val contextMenu = buildTooltipContent();
    EventHandler<ContextMenuEvent> contextMenuHandler = contextMenuEvent -> {
        contextMenu.show(line, contextMenuEvent.getScreenX(), contextMenuEvent.getScreenY());
        contextMenuEvent.consume();
    };
    labelsPane.setOnContextMenuRequested(contextMenuHandler);
    pointer.setOnContextMenuRequested(contextMenuHandler);
    line.setOnContextMenuRequested(contextMenuHandler);
    menuArea.setOnContextMenuRequested(contextMenuHandler);
}
Also used : lombok.val(lombok.val) EventHandler(javafx.event.EventHandler) ReactorGraphModel(ru.fix.completable.reactor.api.ReactorGraphModel) java.util(java.util) Label(javafx.scene.control.Label) MenuItem(javafx.scene.control.MenuItem) Rotate(javafx.scene.transform.Rotate) Node(javafx.scene.Node) lombok.val(lombok.val) Polygon(javafx.scene.shape.Polygon) Group(javafx.scene.Group) VBox(javafx.scene.layout.VBox) Collectors(java.util.stream.Collectors) ContextMenuEvent(javafx.scene.input.ContextMenuEvent) Text(javafx.scene.text.Text) Line(javafx.scene.shape.Line) ContextMenu(javafx.scene.control.ContextMenu) lombok.experimental.var(lombok.experimental.var) Point2D(javafx.geometry.Point2D) ContextMenuEvent(javafx.scene.input.ContextMenuEvent)

Aggregations

java.util (java.util)1 Collectors (java.util.stream.Collectors)1 EventHandler (javafx.event.EventHandler)1 Point2D (javafx.geometry.Point2D)1 Group (javafx.scene.Group)1 Node (javafx.scene.Node)1 ContextMenu (javafx.scene.control.ContextMenu)1 Label (javafx.scene.control.Label)1 MenuItem (javafx.scene.control.MenuItem)1 ContextMenuEvent (javafx.scene.input.ContextMenuEvent)1 VBox (javafx.scene.layout.VBox)1 Line (javafx.scene.shape.Line)1 Polygon (javafx.scene.shape.Polygon)1 Text (javafx.scene.text.Text)1 Rotate (javafx.scene.transform.Rotate)1 lombok.experimental.var (lombok.experimental.var)1 lombok.val (lombok.val)1 ReactorGraphModel (ru.fix.completable.reactor.api.ReactorGraphModel)1