Examples of ContextMenu


Examples of javafx.scene.control.ContextMenu

            }
        };

        private void removeListeners(Tab tab) {
            listener.dispose();
            ContextMenu menu = tab.getContextMenu();
            if (menu != null) {
                menu.getItems().clear();
            }
            inner.getChildren().clear();
            getChildren().clear();
        }

Examples of javafx.scene.control.ContextMenu

            timeline.play();
        }

        private void setupPopupMenu() {
            if (popup == null) {
                popup = new ContextMenu();
//                popup.setManaged(false);
            }
            popup.getItems().clear();
            ToggleGroup group = new ToggleGroup();
            ObservableList<RadioMenuItem> menuitems = FXCollections.<RadioMenuItem>observableArrayList();

Examples of javafx.scene.control.ContextMenu

      {
        return new MetaMethodCell();
      }
    });
   
    final ContextMenu menuCompiled = buildContextMenuCompiledMember(parent);
    final ContextMenu menuUncompiled = buildContextMenuUncompiledMember(parent);
   
    memberList.addEventHandler(MouseEvent.MOUSE_CLICKED, getEventHandlerContextMenu(menuCompiled, menuUncompiled));


    memberList.addEventHandler(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>()
    {
      @Override
      public void handle(MouseEvent e)
      {
        menuCompiled.hide();
        menuUncompiled.hide();
      }
    });
   
   
    getChildren().add(cbOnlyCompiled);

Examples of javafx.scene.control.ContextMenu

    };
  }

  private ContextMenu buildContextMenuCompiledMember(JITWatchUI parent)
  {
    final ContextMenu menu = new ContextMenu();

    MenuItem menuItemTriView = new MenuItem("Show TriView");
    MenuItem menuItemJournal = new MenuItem("Show JIT journal");
    MenuItem menuItemIntrinsics = new MenuItem("Show intrinsics used");
    MenuItem menuItemCallChain = new MenuItem("Show compile chain");
    MenuItem menuItemOptimizedVCalls = new MenuItem("Show optimized virtual calls");

    menu.getItems().add(menuItemTriView);
    menu.getItems().add(menuItemJournal);
    menu.getItems().add(menuItemIntrinsics);
    menu.getItems().add(menuItemCallChain);
    menu.getItems().add(menuItemOptimizedVCalls);


    menuItemTriView.setOnAction(getEventHandlerMenuItemTriView(parent));

    menuItemJournal.setOnAction(getEventHandlerMenuItemJournal(parent));

Examples of javafx.scene.control.ContextMenu

    return menu;
  }

  private ContextMenu buildContextMenuUncompiledMember(JITWatchUI parent)
  {
    ContextMenu menu = new ContextMenu();

    MenuItem menuItemTriView = new MenuItem("Show TriView");
    MenuItem menuItemJournal = new MenuItem("Show JIT journal");

    menu.getItems().add(menuItemTriView);
    menu.getItems().add(menuItemJournal);

    menuItemTriView.setOnAction(getEventHandlerMenuItemTriView(parent));

    menuItemJournal.setOnAction(getEventHandlerMenuItemJournal(parent));
   

Examples of javafx.scene.control.ContextMenu

    return (int) (scrollPane.getHeight() / 10);
  }

  private void setUpContextMenu()
  {
    final ContextMenu contextMenu = new ContextMenu();

    MenuItem menuItemCopyToClipboard = new MenuItem("Copy to Clipboard");

    contextMenu.getItems().add(menuItemCopyToClipboard);

    vBoxRows.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>()
    {
      @Override
      public void handle(MouseEvent e)
      {
        if (e.getButton() == MouseButton.SECONDARY)
        {
          contextMenu.show(vBoxRows, e.getScreenX(), e.getScreenY());
        }
      }
    });

    menuItemCopyToClipboard.setOnAction(new EventHandler<ActionEvent>()

Examples of javafx.scene.control.ContextMenu

            @Override
            public void handle(final MouseEvent me) {
                //This is so we can set our machine position when a machine does not have homing switches
                if (me.getButton().equals(MouseButton.SECONDARY)) {
                    //Right Clicked
                    ContextMenu cm = new ContextMenu();
                    MenuItem menuItem1 = new MenuItem("Set Machine Position");
                    menuItem1.setOnAction(new EventHandler<ActionEvent>() {
                        @Override
                        public void handle(ActionEvent t) {
                            Draw2d.setFirstDraw(true); //We do not want to draw a line from our previous position
                            TinygDriver.getInstance().cmdManager.setMachinePosition(getNormalizedX(me.getX()), getNormalizedY(me.getY()));
                            Draw2d.setFirstDraw(true); //This allows us to move our drawing to a new place without drawing a line from the old.
                            try {
                                TinygDriver.getInstance().write(CommandManager.CMD_APPLY_SYSTEM_ZERO_ALL_AXES);
                                TinygDriver.getInstance().write(CommandManager.CMD_QUERY_STATUS_REPORT);
                            } catch (Exception ex) {
                                Logger.getLogger(CNCMachine.class.getName()).log(Level.SEVERE, null, ex);
                            }
                            //G92 does not invoke a status report... So we need to generate one to have
                            //Our GUI update the coordinates to zero


                        }
                    });
                    cm.getItems().add(menuItem1);
                    cm.show((Node) me.getSource(), me.getScreenX(), me.getScreenY());
                }

            }
        });

Examples of javafx.scene.control.ContextMenu

     * Creates the context menu.
     *
     * @return The context menu.
     */
    private ContextMenu createContextMenu() {
        final ContextMenu menu = new ContextMenu();
      
        Menu export = new Menu("Export As");
       
        MenuItem pngItem = new MenuItem("PNG...");
        pngItem.setOnAction((ActionEvent e) -> { handleExportToPNG(); });       
        export.getItems().add(pngItem);
       
        MenuItem jpegItem = new MenuItem("JPEG...");
        jpegItem.setOnAction((ActionEvent e) -> { handleExportToJPEG(); });       
        export.getItems().add(jpegItem);
       
        if (ExportUtils.isOrsonPDFAvailable()) {
            MenuItem pdfItem = new MenuItem("PDF...");
            pdfItem.setOnAction((ActionEvent e) -> {
                handleExportToPDF();
            });
            export.getItems().add(pdfItem);
        }
        if (ExportUtils.isJFreeSVGAvailable()) {
            MenuItem svgItem = new MenuItem("SVG...");
            svgItem.setOnAction((ActionEvent e) -> {
                handleExportToSVG();
            });
            export.getItems().add(svgItem);       
        }
        menu.getItems().add(export);
        return menu;
    }

Examples of javafx.scene.control.ContextMenu

     * Manage buttons and menu items
     */
    public void initDecoration() {
        MenuItem minimizeMenuItem = null;
        // Menu
        final ContextMenu contextMenu = new ContextMenu();
        contextMenu.setAutoHide(true);
        if (minimize != null) { // Utility Stage
            minimizeMenuItem = new MenuItem(LOC.getString("Minimize"));
            minimizeMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.M, KeyCombination.SHORTCUT_DOWN));

            minimizeMenuItem.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent e) {
                    switchMinimize();
                }
            });
            contextMenu.getItems().add(minimizeMenuItem);
        }
        if (maximize != null && stage.isResizable()) { // Utility Stage type
            maximizeMenuItem = new MenuItem(LOC.getString("Maximize"));
            maximizeMenuItem.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent e) {
                    switchMaximize();
                    contextMenu.hide(); // Stay stuck on screen
                }
            });
            contextMenu.getItems().addAll(maximizeMenuItem, new SeparatorMenuItem());
        }

        // Fullscreen
        if (stageStyle != StageStyle.UTILITY && stage.isResizable()) {
            fullScreenMenuItem = new CheckMenuItem(LOC.getString("FullScreen"));
            fullScreenMenuItem.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent e) {
                    // fake
                    //maximizeProperty().set(!maximizeProperty().get());
                    switchFullscreen();
                }
            });
            fullScreenMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F, KeyCombination.CONTROL_DOWN, KeyCombination.SHORTCUT_DOWN));

            contextMenu.getItems().addAll(fullScreenMenuItem, new SeparatorMenuItem());
        }

        // Close
        MenuItem closeMenuItem = new MenuItem(LOC.getString("Close"));
        closeMenuItem.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                switchClose();
            }
        });
        closeMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN));

        contextMenu.getItems().add(closeMenuItem);

        menu.setOnMousePressed(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent t) {
                if (contextMenu.isShowing()) {
                    contextMenu.hide();
                } else {
                    contextMenu.show(menu, Side.BOTTOM, 0, 0);
                }
            }
        });

        // Close button

Examples of net.rim.device.api.ui.ContextMenu

        /**
         * @see net.rim.device.api.ui.Field#getContextMenu()
         */
        public ContextMenu getContextMenu() {
            final ContextMenu contextMenu = ContextMenu.getInstance();
            contextMenu.setTarget(this);
            makeContextMenu(contextMenu);
            return contextMenu;
        }
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.