Package javafx.scene.control

Examples of javafx.scene.control.ToggleGroup


    Label numberOfPlayersLabel = new Label("NUMBER OF PLAYERS");
    numberOfPlayersLabel.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    numberOfPlayersLabel.setTextFill(Color.LIGHTGRAY);

    numberOfPlayers = new ToggleGroup();

    RadioButton numberOfPlayers1 = new RadioButton("1");
    numberOfPlayers1.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    numberOfPlayers1.setSelected(true);
    numberOfPlayers1.setUserData(1);
    numberOfPlayers1.setToggleGroup(numberOfPlayers);
    numberOfPlayers1.setMinWidth(120);
    numberOfPlayers1.setMaxWidth(120);

    RadioButton numberOfPlayers2 = new RadioButton("2");
    numberOfPlayers2.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    numberOfPlayers2.setUserData(2);
    numberOfPlayers2.setToggleGroup(numberOfPlayers);
    numberOfPlayers2.setMinWidth(120);
    numberOfPlayers2.setMaxWidth(120);

    RadioButton numberOfPlayers3 = new RadioButton("3");
    numberOfPlayers3.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    numberOfPlayers3.setUserData(3);
    numberOfPlayers3.setToggleGroup(numberOfPlayers);

    HBox numberOfPlayersButtons = new HBox();
    numberOfPlayersButtons.setAlignment(Pos.CENTER);
    numberOfPlayersButtons.getChildren().addAll(numberOfPlayers1,
            numberOfPlayers2, numberOfPlayers3);

    Line horizontalLine1 = new Line();
    horizontalLine1.setEndX(480);
    horizontalLine1.setStroke(Color.GRAY);
    horizontalLine1.setStrokeWidth(2);

    Label worldCreationLabel = new Label("CREATION OF THE WORLD");
    worldCreationLabel.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    worldCreationLabel.setTextFill(Color.LIGHTGRAY);

    worldCreation = new ToggleGroup();

    RadioButton worldCreation1 = new RadioButton("1");
    worldCreation1.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation1.setSelected(true);
    worldCreation1.setUserData(new FlatLandWorldGenerator(0.15));
    worldCreation1.setToggleGroup(worldCreation);
    worldCreation1.setMinWidth(120);
    worldCreation1.setMaxWidth(120);

    RadioButton worldCreation2 = new RadioButton("2");
    worldCreation2.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation2.setUserData(new FlatLandWorldGenerator(0.3));
    worldCreation2.setToggleGroup(worldCreation);
    worldCreation2.setMinWidth(120);
    worldCreation2.setMaxWidth(120);

    RadioButton worldCreation3 = new RadioButton("3");
    worldCreation3.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation3.setUserData(new FlatLandWorldGenerator(0.45));
    worldCreation3.setToggleGroup(worldCreation);
    worldCreation3.setMinWidth(120);
    worldCreation3.setMaxWidth(120);

    RadioButton worldCreation4 = new RadioButton("4");
    worldCreation4.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation4.setUserData(new FlatLandWorldGenerator(0.6));
    worldCreation4.setToggleGroup(worldCreation);
    worldCreation4.setMinWidth(120);
    worldCreation4.setMaxWidth(120);

    RadioButton worldCreation5 = new RadioButton("5");
    worldCreation5.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation5.setUserData(new FlatLandWorldGenerator(0.75));
    worldCreation5.setToggleGroup(worldCreation);

    HBox worldCreationButtons = new HBox();
    worldCreationButtons.setAlignment(Pos.CENTER);
    worldCreationButtons.getChildren().addAll(worldCreation1, worldCreation2,
            worldCreation3, worldCreation4, worldCreation5);

    Line horizontalLine2 = new Line();
    horizontalLine2.setEndX(480);
    horizontalLine2.setStroke(Color.GRAY);
    horizontalLine2.setStrokeWidth(2);

    Label gameLevelLabel = new Label("GAME LEVEL");
    gameLevelLabel.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    gameLevelLabel.setTextFill(Color.LIGHTGRAY);

    gameLevel = new ToggleGroup();

    RadioButton gameLevel1 = new RadioButton("BEGINNER");
    gameLevel1.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    gameLevel1.setUserData(Game.Difficulty.BEGINNER);
    gameLevel1.setToggleGroup(gameLevel);
View Full Code Here


            final ProfileListener profileListener) {
        this.logger = logger;
        this.conductor = conductor;
        this.windowModel = windowModel;
        this.profileListener = profileListener;
        toggleMachines = new ToggleGroup();
    }
View Full Code Here

        ToolBar toolBar = new ToolBar();
        ColorPicker colorTB = new ColorPicker(Color.rgb(194, 222, 254));

        Separator seperateIt = new Separator();
        ToggleGroup toolbarGroup = new ToggleGroup();
        ToggleButton sampleButton4 = new ToggleButton("TG1");
        sampleButton4.setToggleGroup(toolbarGroup);
        sampleButton4.setSelected(true);
        AquaFx.createToggleButtonStyler().setType(ButtonType.LEFT_PILL).style(sampleButton4);
        ToggleButton sampleButton5 = new ToggleButton("TG2");
        sampleButton5.setToggleGroup(toolbarGroup);
        sampleButton5.setSelected(true);
        AquaFx.createToggleButtonStyler().setType(ButtonType.CENTER_PILL).style(sampleButton5);
        ToggleButton sampleButton6 = new ToggleButton("TG3");
        sampleButton6.setToggleGroup(toolbarGroup);
        sampleButton6.setSelected(true);
        AquaFx.createToggleButtonStyler().setType(ButtonType.RIGHT_PILL).style(sampleButton6);

        Separator seperateIt2 = new Separator();

        Button menuPillButton1 = new Button("PB 1");
        AquaFx.createButtonStyler().setType(ButtonType.LEFT_PILL).style(menuPillButton1);
        Button menuPillButton2 = new Button("PB 2");
        AquaFx.createButtonStyler().setType(ButtonType.CENTER_PILL).style(menuPillButton2);
        Button menuPillButton3 = new Button("PB 3");
        AquaFx.createButtonStyler().setType(ButtonType.RIGHT_PILL).style(menuPillButton3);

        Button sampleButton = new Button("Button");
        ToggleButton sampleButton1 = new ToggleButton("Toggle");
        sampleButton1.setDisable(true);
        ToggleButton sampleButton2 = new ToggleButton("Toggle");
        ToggleButton sampleButton3 = new ToggleButton("Toggle2");
        sampleButton3.setSelected(true);
        toolBar.getItems().addAll(colorTB, sampleButton, sampleButton1, sampleButton2, sampleButton3, seperateIt, sampleButton4,
                sampleButton5, sampleButton6, seperateIt2, menuPillButton1, menuPillButton2, menuPillButton3);

        pane.setTop(toolBar);

        /**
         * TabPane
         */
        TabPane buttonTabPane = new TabPane();

        // Create Tabs
        Tab tabD = new Tab();
        tabD.setText("Buttons");
        VBox buttonBox = new VBox();
        buttonBox.setSpacing(10);
        buttonBox.setPadding(new Insets(10));
        Button b1 = new Button();
        b1.setText("Default (push to enable Tab 'Progress')");
        b1.setDefaultButton(true);
        b1.setTooltip(new Tooltip("This is a ToolTip"));
        b1.setOnAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent event) {
                tabI.setDisable(false);
                tabH.setDisable(false);
            }
        });
        buttonBox.getChildren().add(b1);
        Button b2 = new Button();
        b2.setText("Default");
        b2.setDisable(true);
        b2.setDefaultButton(true);
        buttonBox.getChildren().add(b2);
        Button b3 = new Button();
        b3.setText("Normal (push to disable Tab 'Progress')");
        b3.setOnAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent event) {
                tabH.setDisable(true);
            }
        });
        buttonBox.getChildren().add(b3);
        Button b4 = new Button();
        b4.setText("Normal");
        b4.setDisable(true);
        buttonBox.getChildren().add(b4);

        Button helpButton = new Button("?");
        AquaFx.createButtonStyler().setType(ButtonType.HELP).style(helpButton);
        buttonBox.getChildren().add(helpButton);

        Hyperlink link = new Hyperlink("Hyperlink");
        Hyperlink link2 = new Hyperlink("disabled Hyperlink");
        link2.setDisable(true);
        buttonBox.getChildren().add(link);
        buttonBox.getChildren().add(link2);
        ScrollBar scBar = new ScrollBar();
        buttonBox.getChildren().add(scBar);

        tabD.setContent(buttonBox);
        buttonTabPane.getTabs().add(tabD);

        Tab tabE = new Tab();
        tabE.setText("RadioButtons");
        VBox radioButtonBox = new VBox();
        radioButtonBox.setSpacing(10);
        radioButtonBox.setPadding(new Insets(10));
        RadioButton raBu1 = new RadioButton("Normal");
        radioButtonBox.getChildren().add(raBu1);
        RadioButton raBu2 = new RadioButton("Normal");
        raBu2.setDisable(true);
        radioButtonBox.getChildren().add(raBu2);
        RadioButton raBu3 = new RadioButton("Selected");
        raBu3.setSelected(true);
        radioButtonBox.getChildren().add(raBu3);
        RadioButton raBu4 = new RadioButton("Selected");
        raBu4.setDisable(true);
        raBu4.setSelected(true);
        radioButtonBox.getChildren().add(raBu4);
        tabE.setContent(radioButtonBox);
        buttonTabPane.getTabs().add(tabE);

        Tab tabF = new Tab();
        tabF.setText("CheckBoxes");
        VBox checkBoxBox = new VBox();
        checkBoxBox.setSpacing(10);
        checkBoxBox.setPadding(new Insets(10));
        CheckBox box1 = new CheckBox("Normal");
        checkBoxBox.getChildren().add(box1);
        CheckBox box2 = new CheckBox("Normal");
        box2.setDisable(true);
        checkBoxBox.getChildren().add(box2);
        CheckBox box3 = new CheckBox("Selected");
        box3.setSelected(true);
        checkBoxBox.getChildren().add(box3);
        CheckBox box4 = new CheckBox("Selected");
        box4.setSelected(true);
        box4.setDisable(true);
        checkBoxBox.getChildren().add(box4);
        CheckBox box5 = new CheckBox("Indeterminate");
        box5.setIndeterminate(true);
        checkBoxBox.getChildren().add(box5);
        CheckBox box6 = new CheckBox("Indeterminate");
        box6.setIndeterminate(true);
        box6.setDisable(true);
        checkBoxBox.getChildren().add(box6);
        tabF.setContent(checkBoxBox);
        buttonTabPane.getTabs().add(tabF);

        Tab tabG = new Tab();
        tabG.setText("Toggles & Pills");
        VBox togglesBox = new VBox();
        togglesBox.setSpacing(10);
        togglesBox.setPadding(new Insets(10));
        HBox toggleGroupBox = new HBox();
        ToggleGroup group = new ToggleGroup();
        ToggleButton tb1 = new ToggleButton("First");
        tb1.setToggleGroup(group);
        tb1.setSelected(true);
        AquaFx.createToggleButtonStyler().setType(ButtonType.LEFT_PILL).style(tb1);
        toggleGroupBox.getChildren().add(tb1);
View Full Code Here

        CheckBox box1 = new CheckBox("Datum und Uhrzeit in der Men\u00FCleiste anzeigen");
        box1.setSelected(true);
        grid.add(box1, 0, 0, 3, 1);

        Label labelTime = new Label("Zeitoptionen:");
        ToggleGroup group = new ToggleGroup();
        RadioButton radioButtonDigital = new RadioButton("Digital");
        radioButtonDigital.setToggleGroup(group);
        radioButtonDigital.setSelected(true);
        RadioButton radioButtonAnalog = new RadioButton("Analog");
        radioButtonAnalog.setToggleGroup(group);
View Full Code Here

        m2.setPopupSide(Side.RIGHT);

        ColorPicker colorTB = new ColorPicker(Color.rgb(194, 222, 254));

        Separator seperateIt = new Separator();
        ToggleGroup toolbarGroup = new ToggleGroup();
        ToggleButton sampleButton4 = new ToggleButton("TG1");
        sampleButton4.setToggleGroup(toolbarGroup);
        sampleButton4.setSelected(true);
        AquaFx.createToggleButtonStyler().setType(ButtonType.LEFT_PILL).style(sampleButton4);
        ToggleButton sampleButton5 = new ToggleButton("TG2");
View Full Code Here

            if (popup == null) {
                popup = new ContextMenu();
//                popup.setManaged(false);
            }
            popup.getItems().clear();
            ToggleGroup group = new ToggleGroup();
            ObservableList<RadioMenuItem> menuitems = FXCollections.<RadioMenuItem>observableArrayList();
            for (final Tab tab : getSkinnable().getTabs()) {
                TabMenuItem item = new TabMenuItem(tab);               
                item.setToggleGroup(group);
                item.setOnAction(new EventHandler<ActionEvent>() {
View Full Code Here

    final RadioButton rbATT = new RadioButton("AT&T syntax");
    final RadioButton rbIntel = new RadioButton("Intel syntax");

    rbIntel.setDisable(true);

    final ToggleGroup groupAssemblySyntax = new ToggleGroup();

    boolean intelMode = config.isSandboxIntelMode();

    rbATT.setToggleGroup(groupAssemblySyntax);
    rbIntel.setToggleGroup(groupAssemblySyntax);

    rbATT.setStyle(DEFAULT_DISPLAY_STYLE);

    rbATT.setSelected(!intelMode);
    rbIntel.setSelected(intelMode);

    groupAssemblySyntax.selectedToggleProperty().addListener(
        getChangeListenerForGroupAssemblySyntax(rbIntel, groupAssemblySyntax));

    HBox hbox = new HBox();
   
    hbox.setSpacing(20);
View Full Code Here

  {
    final RadioButton rbVMDefault = new RadioButton("VM Default");
    final RadioButton rbForceTiered = new RadioButton("-XX:+TieredCompilation");
    final RadioButton rbForceNoTiered = new RadioButton("-XX:-TieredCompilation");

    final ToggleGroup groupTiered = new ToggleGroup();

    rbVMDefault.setStyle(DEFAULT_DISPLAY_STYLE);
    rbForceTiered.setStyle(DEFAULT_DISPLAY_STYLE);

    TieredCompilation tieredMode = config.getTieredCompilationMode();

    switch (tieredMode)
    {
    case VM_DEFAULT:
      rbVMDefault.setSelected(true);
      rbForceTiered.setSelected(false);
      rbForceNoTiered.setSelected(false);
      break;
    case FORCE_TIERED:
      rbVMDefault.setSelected(false);
      rbForceTiered.setSelected(true);
      rbForceNoTiered.setSelected(false);
      break;
    case FORCE_NO_TIERED:
      rbVMDefault.setSelected(false);
      rbForceTiered.setSelected(false);
      rbForceNoTiered.setSelected(true);
      break;
    }

    rbVMDefault.setToggleGroup(groupTiered);
    rbForceTiered.setToggleGroup(groupTiered);
    rbForceNoTiered.setToggleGroup(groupTiered);

    groupTiered.selectedToggleProperty().addListener(
        getChangeListenerForGroupTiered(rbVMDefault, rbForceTiered, rbForceNoTiered, groupTiered));

    HBox hbox = new HBox();

    Label lblMode = new Label("Tiered Compilation:");
View Full Code Here

  {
    final RadioButton rbVMDefault = new RadioButton("VM Default");
    final RadioButton rbForceCompressed = new RadioButton("-XX:+UseCompressedOops");
    final RadioButton rbForceNoCompressed = new RadioButton("-XX:-UseCompressedOops");

    final ToggleGroup groupOops = new ToggleGroup();

    rbVMDefault.setStyle(DEFAULT_DISPLAY_STYLE);
    rbForceCompressed.setStyle(DEFAULT_DISPLAY_STYLE);

    CompressedOops oopsMode = config.getCompressedOopsMode();

    switch (oopsMode)
    {
    case VM_DEFAULT:
      rbVMDefault.setSelected(true);
      rbForceCompressed.setSelected(false);
      rbForceNoCompressed.setSelected(false);
      break;
    case FORCE_COMPRESSED:
      rbVMDefault.setSelected(false);
      rbForceCompressed.setSelected(true);
      rbForceNoCompressed.setSelected(false);
      break;
    case FORCE_NO_COMPRESSED:
      rbVMDefault.setSelected(false);
      rbForceCompressed.setSelected(false);
      rbForceNoCompressed.setSelected(true);
      break;
    }

    rbVMDefault.setToggleGroup(groupOops);
    rbForceCompressed.setToggleGroup(groupOops);
    rbForceNoCompressed.setToggleGroup(groupOops);

    groupOops.selectedToggleProperty().addListener(
        getChangeListenerForGroupOops(rbVMDefault, rbForceCompressed, rbForceNoCompressed, groupOops));

    HBox hbox = new HBox();

    Label lblMode = new Label("Compressed Oops:");
View Full Code Here

    private Pane initBack(final FlipPanel flipPanel, final StackPane FRONT_PANEL) {
        Region backButton = new Region();
        backButton.getStyleClass().add("back-button");
        backButton.addEventHandler(MouseEvent.MOUSE_CLICKED, EVENT -> flipPanel.flipToFront());

        ToggleGroup group = new ToggleGroup();

        final RadioButton standardGreen = new RadioButton("Green");
        standardGreen.setToggleGroup(group);
        standardGreen.setSelected(true);
        standardGreen.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.GREEN, CornerRadii.EMPTY, Insets.EMPTY))));
View Full Code Here

TOP

Related Classes of javafx.scene.control.ToggleGroup

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.