Package javafx.scene.control

Examples of javafx.scene.control.Menu


  {
    borderPane = new BorderPane();
   
    //Menus
    menuBar = new MenuBar();
    fileMenu = new Menu("Fichier");
    singlePlayerGame = new MenuItem("Cr�er partie solo");
    singlePlayerGame.setOnAction(new StartGameHandler());
    multiPlayerGame = new MenuItem("Cr�er partie en ligne");
    multiPlayerGame.setOnAction(new StartOnlineGameHandler());
    joinGame = new MenuItem("Rejoindre une partie");
    joinGame.setOnAction(new JoinOnlineGameHandler());
    MenuItem logonMenuItem = new MenuItem("Connexion");
    logonMenuItem.setOnAction(new LogonHandler());
    accountCreation = new MenuItem("Creer un Compte");
    accountCreation.setOnAction(new DisplayAccountCreation());

    fileMenu.getItems().add(accountCreation);
    fileMenu.getItems().add(logonMenuItem);
    fileMenu.getItems().add(singlePlayerGame);

    Menu accountMenu = new Menu("Compte");
    MenuItem infoMenuItem = new MenuItem("Mes infos");
    infoMenuItem.setOnAction(new DisplayUserInfoHandler());
    MenuItem rightMenuItem = new MenuItem("Mes droits");
    rightMenuItem.setOnAction(new DisplayPermissionHandler());
    MenuItem editRightMenuItem = new MenuItem("Gerer les droits");
    editRightMenuItem.setOnAction(new EditPermissionHandler());
   
    accountMenu.getItems().addAll(infoMenuItem, rightMenuItem, editRightMenuItem);
   
    team = new Menu("Equipe");
    teamCreation = new MenuItem("Cr�er une �quipe");
    teamCreation.setOnAction(new DisplayTeamHandler());
   
    team.getItems().add(teamCreation);
   
    stat = new Menu("Statistique");
    yourStat = new MenuItem("Vos Statistiques");
    yourStat.setOnAction(new DisplayStatistics());
   
    stat.getItems().add(yourStat);
    Menu roomMenu = new Menu("Salon");
   
    roomJoin = new MenuItem("Rejoindre un salon");
    roomJoin.setOnAction(new RoomHandler());
   
    roomRemove = new MenuItem("Supprimer un salon");
    roomRemove.setOnAction(new RemoveRoomHandler());
   
    roomMenu.getItems().addAll(roomJoin, roomRemove);
   
    menuBar.getMenus().addAll(fileMenu, accountMenu, team, roomMenu, stat);
    borderPane.setTop(menuBar);
    gameBorderPane = new BorderPane();
    gameBorderPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
View Full Code Here


  {
    borderPane = new BorderPane();
   
    //Menus
    menuBar = new MenuBar();
    fileMenu = new Menu("Fichier");
    singlePlayerGame = new MenuItem("Cr�er partie solo");
    singlePlayerGame.setOnAction(new StartGameHandler());
    multiPlayerGame = new MenuItem("Cr�er partie en ligne");
    multiPlayerGame.setOnAction(new StartOnlineGameHandler());
    joinGame = new MenuItem("Rejoindre une partie");
    joinGame.setOnAction(new JoinOnlineGameHandler());
    MenuItem logonMenuItem = new MenuItem("Connexion");
    logonMenuItem.setOnAction(new LogonHandler());
    accountCreation = new MenuItem("Creer un Compte");
    accountCreation.setOnAction(new DisplayAccountCreation());

    fileMenu.getItems().add(accountCreation);
    fileMenu.getItems().add(logonMenuItem);
    fileMenu.getItems().add(singlePlayerGame);

    Menu accountMenu = new Menu("Compte");
    MenuItem infoMenuItem = new MenuItem("Mes infos");
    infoMenuItem.setOnAction(new DisplayUserInfoHandler());
    MenuItem rightMenuItem = new MenuItem("Mes droits");
    rightMenuItem.setOnAction(new DisplayPermissionHandler());
    MenuItem editRightMenuItem = new MenuItem("Gerer les droits");
    editRightMenuItem.setOnAction(new EditPermissionHandler());
   
    accountMenu.getItems().addAll(infoMenuItem, rightMenuItem, editRightMenuItem);
   
    team = new Menu("Equipe");
    teamCreation = new MenuItem("Cr�er une �quipe");
    teamCreation.setOnAction(new DisplayTeamHandler());
   
    team.getItems().add(teamCreation);
   
    stat = new Menu("Statistique");
    yourStat = new MenuItem("Vos Statistiques");
    yourStat.setOnAction(new DisplayStatistics());
   
    stat.getItems().add(yourStat);
    Menu roomMenu = new Menu("Salon");
   
    roomJoin = new MenuItem("Rejoindre un salon");
    roomJoin.setOnAction(new RoomHandler());
   
    roomRemove = new MenuItem("Supprimer un salon");
    roomRemove.setOnAction(new RemoveRoomHandler());
   
    roomMenu.getItems().addAll(roomJoin, roomRemove);
   
    menuBar.getMenus().addAll(fileMenu, accountMenu, team, roomMenu, stat);
    borderPane.setTop(menuBar);
    gameBorderPane = new BorderPane();
    gameBorderPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
View Full Code Here

     * @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;
    }
View Full Code Here

            } catch (TskCoreException ex) {
                Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
            }

            // Create a "Quick Tag" sub-menu.
            Menu quickTagMenu = new Menu("Quick Tag");
            getItems().add(quickTagMenu);

            // Each tag name in the current set of tags gets its own menu item in
            // the "Quick Tags" sub-menu. Selecting one of these menu items adds
            // a tag with the associated tag name.
            if (null != tagNames && !tagNames.isEmpty()) {
                for (final TagName tagName : tagNames) {
                    if (tagName.getDisplayName().startsWith(Category.CATEGORY_PREFIX) == false) {
                        MenuItem tagNameItem = new MenuItem(tagName.getDisplayName());
                        tagNameItem.setOnAction((ActionEvent t) -> {
                            addTag(tagName, NO_COMMENT);
                            refreshDirectoryTree();
                        });
                        quickTagMenu.getItems().add(tagNameItem);
                    }
                }
            } else {
                MenuItem empty = new MenuItem("No tags");
                empty.setDisable(true);
                quickTagMenu.getItems().add(empty);
            }

            //   quickTagMenu.addSeparator();
            // The "Quick Tag" menu also gets an "Choose Tag..." menu item.
            // Selecting this item initiates a dialog that can be used to create
            // or select a tag name and adds a tag with the resulting name.
            MenuItem newTagMenuItem = new MenuItem("New Tag...");
            newTagMenuItem.setOnAction((ActionEvent t) -> {
                try {
                    SwingUtilities.invokeAndWait(() -> {
                        TagName tagName = GetTagNameDialog.doDialog();
                        if (tagName != null) {
                            addTag(tagName, NO_COMMENT);
                            refreshDirectoryTree();
                        }
                    });
                } catch (InterruptedException | InvocationTargetException ex) {
                    Exceptions.printStackTrace(ex);
                }
            });
            quickTagMenu.getItems().add(newTagMenuItem);

            // Create a "Choose Tag and Comment..." menu item. Selecting this item initiates
            // a dialog that can be used to create or select a tag name with an
            // optional comment and adds a tag with the resulting name.
            MenuItem tagAndCommentItem = new MenuItem("Tag and Comment...");
View Full Code Here

                        t.getValue().setActive(Boolean.TRUE);
                    }
                });
            });
            final ContextMenu rowMenu = new ContextMenu();
            Menu select = new Menu("select");
            select.setOnAction(e -> {
                row.getItem().setActive(!row.getItem().isActive());
            });
            select.getItems().addAll(all, none, only, others);
            rowMenu.getItems().addAll(select);
            row.setContextMenu(rowMenu);

            return row;
        });
View Full Code Here

    private ToggleGroup group;
    Runnable showingCallback;
   
    @Override
    protected Menu createWidget() {
      final Menu m = new Menu();
      m.setMnemonicParsing(true);
      m.setOnShowing(new EventHandler<Event>() {
       
        @Override
        public void handle(Event event) {
          //TODO Work around for JIRA 24505
          if( ! m.isShowing() ) {
            if( showingCallback != null ) {
              showingCallback.run();
           
          }
        }
View Full Code Here

TOP

Related Classes of javafx.scene.control.Menu

Copyright © 2018 www.massapicom. 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.