Search in sources :

Example 1 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project fxexperience2 by EricCanull.

the class MainController method initToggleGroup.

// Creates toggle group to bind color icon effect
private void initToggleGroup() {
    ToggleGroup toggleGroup = new ToggleGroup();
    toggleGroup.getToggles().addAll(stylerToggle, splineToggle, derivedColorToggle);
    toggleGroup.getToggles().forEach((t) -> setIconBinding((ToggleButton) t));
    toggleGroup.selectToggle(stylerToggle);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) ToggleGroup(javafx.scene.control.ToggleGroup)

Example 2 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project Gargoyle by callakrsos.

the class DesignerFx method createFxMenuBar.

//	private JMenuBar createMenuBar() {
//		JMenuBar menuBar = new JMenuBar();
//		JMenu menu = new JMenu("Language");
//		ButtonGroup group = new ButtonGroup();
//
//		LanguageVersion[] languageVersions = getSupportedLanguageVersions();
//		for (int i = 0; i < languageVersions.length; i++) {
//			LanguageVersion languageVersion = languageVersions[i];
//			MenuItem button = new MenuItem(languageVersion.getShortName());
//			languageVersionMenuItems[i] = button;
//			group.add(button);
//			menu.add(button);
//		}
//		languageVersionMenuItems[DEFAULT_LANGUAGE_VERSION_SELECTION_INDEX].setSelected(true);
//		menuBar.add(menu);
//
//		JMenu actionsMenu = new JMenu("Actions");
//		JMenuItem copyXMLItem = new JMenuItem("Copy xml to clipboard");
//		copyXMLItem.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				copyXmlToClipboard();
//			}
//		});
//		actionsMenu.add(copyXMLItem);
//		JMenuItem createRuleXMLItem = new JMenuItem("Create rule XML");
//		createRuleXMLItem.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				createRuleXML();
//			}
//		});
//		actionsMenu.add(createRuleXMLItem);
//		menuBar.add(actionsMenu);
//
//		return menuBar;
//	}
private MenuBar createFxMenuBar() {
    MenuBar menuBar = new MenuBar();
    Menu menu = new Menu("Language");
    ToggleGroup group = new ToggleGroup();
    LanguageVersion[] languageVersions = getSupportedLanguageVersions();
    for (int i = 0; i < languageVersions.length; i++) {
        LanguageVersion languageVersion = languageVersions[i];
        //			JRadioButtonMenuItem button = new JRadioButtonMenuItem(languageVersion.getShortName());
        RadioMenuItem button = new RadioMenuItem(languageVersion.getShortName());
        button.setToggleGroup(group);
        languageVersionMenuItems[i] = button;
        //			group.add(button);
        menu.getItems().add(button);
    }
    //		languageVersionMenuItems[DEFAULT_LANGUAGE_VERSION_SELECTION_INDEX].setSelected(true);
    languageVersionMenuItems[getDefaultLanguageVersionSelectionIndex()].setSelected(true);
    menuBar.getMenus().add(menu);
    Menu actionsMenu = new Menu("Actions");
    MenuItem copyXMLItem = new MenuItem("Copy xml to clipboard");
    copyXMLItem.setOnAction(e -> copyXmlToClipboard());
    actionsMenu.getItems().add(copyXMLItem);
    MenuItem createRuleXMLItem = new MenuItem("Create rule XML");
    createRuleXMLItem.setOnAction(e -> createRuleXML());
    actionsMenu.getItems().add(createRuleXMLItem);
    menuBar.getMenus().add(actionsMenu);
    return menuBar;
}
Also used : ToggleGroup(javafx.scene.control.ToggleGroup) JMenuBar(javax.swing.JMenuBar) MenuBar(javafx.scene.control.MenuBar) LanguageVersion(net.sourceforge.pmd.lang.LanguageVersion) MenuItem(javafx.scene.control.MenuItem) RadioMenuItem(javafx.scene.control.RadioMenuItem) Menu(javafx.scene.control.Menu) RadioMenuItem(javafx.scene.control.RadioMenuItem)

Example 3 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project bitsquare by bitsquare.

the class MenuItem method initialize.

@Override
public void initialize() {
    listener = viewPath -> {
        if (viewPath.size() != 4 || viewPath.indexOf(AccountSettingsView.class) != 2)
            return;
        selectedViewClass = viewPath.tip();
        loadView(selectedViewClass);
    };
    ToggleGroup toggleGroup = new ToggleGroup();
    paymentAccount = new MenuItem(navigation, toggleGroup, "National currency accounts", FiatAccountsView.class, AwesomeIcon.MONEY);
    altCoinsAccountView = new MenuItem(navigation, toggleGroup, "Altcoin accounts", AltCoinAccountsView.class, AwesomeIcon.LINK);
    arbitratorSelection = new MenuItem(navigation, toggleGroup, "Arbitrator selection", ArbitratorSelectionView.class, AwesomeIcon.USER_MD);
    password = new MenuItem(navigation, toggleGroup, "Wallet password", PasswordView.class, AwesomeIcon.UNLOCK_ALT);
    seedWords = new MenuItem(navigation, toggleGroup, "Wallet seed", SeedWordsView.class, AwesomeIcon.KEY);
    backup = new MenuItem(navigation, toggleGroup, "Backup", BackupView.class, AwesomeIcon.CLOUD_DOWNLOAD);
    leftVBox.getChildren().addAll(paymentAccount, altCoinsAccountView, arbitratorSelection, password, seedWords, backup);
}
Also used : BackupView(io.bitsquare.gui.main.account.content.backup.BackupView) AltCoinAccountsView(io.bitsquare.gui.main.account.content.altcoinaccounts.AltCoinAccountsView) ArbitratorSelectionView(io.bitsquare.gui.main.account.content.arbitratorselection.ArbitratorSelectionView) SeedWordsView(io.bitsquare.gui.main.account.content.seedwords.SeedWordsView) ToggleGroup(javafx.scene.control.ToggleGroup) PasswordView(io.bitsquare.gui.main.account.content.password.PasswordView) FiatAccountsView(io.bitsquare.gui.main.account.content.fiataccounts.FiatAccountsView)

Example 4 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project Board-Instrumentation-Framework by intel.

the class Demo method init.

@Override
public void init() {
    onOffSwitch = new OnOffSwitch();
    ToggleGroup iconSwitchToggleGroup = new ToggleGroup();
    iconSwitchSymbol = new IconSwitch();
    iconSwitchSymbol.setToggleGroup(iconSwitchToggleGroup);
    iconSwitchSymbol.setSelected(true);
    iconSwitchSymbol.setSymbolType(SymbolType.POWER);
    iconSwitchSymbol.setSymbolColor(Color.web("#34495e"));
    iconSwitchText = new IconSwitch();
    iconSwitchText.setToggleGroup(iconSwitchToggleGroup);
    iconSwitchText.setText("A");
    iconSwitchText.setSymbolColor(Color.web("#34495e"));
    iconSwitchSymbol1 = new IconSwitch();
    iconSwitchSymbol1.setSymbolType(SymbolType.ALARM);
    iconSwitchSymbol1.setSymbolColor(Color.web("#34495e"));
    onOffSwitch.setOnSelect(switchEvent -> System.out.println("OnOff Switch switched on"));
    iconSwitchSymbol.setOnSelect(switchEvent -> System.out.println("Icon Switch Symbol switched on"));
    iconSwitchText.setOnSelect(switchEvent -> System.out.println("Icon Switch Text switched on"));
    iconSwitchSymbol1.setOnSelect(switchEvent -> System.out.println("Icon Switch Symbol 1 switched on"));
}
Also used : ToggleGroup(javafx.scene.control.ToggleGroup)

Example 5 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project bisq-desktop by bisq-network.

the class MenuItem method initialize.

@Override
public void initialize() {
    listener = viewPath -> {
        if (viewPath.size() != 4 || viewPath.indexOf(AccountSettingsView.class) != 2)
            return;
        selectedViewClass = viewPath.tip();
        loadView(selectedViewClass);
    };
    ToggleGroup toggleGroup = new ToggleGroup();
    paymentAccount = new MenuItem(navigation, toggleGroup, Res.get("account.menu.paymentAccount"), FiatAccountsView.class, AwesomeIcon.MONEY);
    altCoinsAccountView = new MenuItem(navigation, toggleGroup, Res.get("account.menu.altCoinsAccountView"), AltCoinAccountsView.class, AwesomeIcon.LINK);
    arbitratorSelection = new MenuItem(navigation, toggleGroup, Res.get("account.menu.arbitratorSelection"), ArbitratorSelectionView.class, AwesomeIcon.USER_MD);
    password = new MenuItem(navigation, toggleGroup, Res.get("account.menu.password"), PasswordView.class, AwesomeIcon.UNLOCK_ALT);
    seedWords = new MenuItem(navigation, toggleGroup, Res.get("account.menu.seedWords"), SeedWordsView.class, AwesomeIcon.KEY);
    backup = new MenuItem(navigation, toggleGroup, Res.get("account.menu.backup"), BackupView.class, AwesomeIcon.CLOUD_DOWNLOAD);
    leftVBox.getChildren().addAll(paymentAccount, altCoinsAccountView, arbitratorSelection, password, seedWords, backup);
}
Also used : BackupView(bisq.desktop.main.account.content.backup.BackupView) AltCoinAccountsView(bisq.desktop.main.account.content.altcoinaccounts.AltCoinAccountsView) ArbitratorSelectionView(bisq.desktop.main.account.content.arbitratorselection.ArbitratorSelectionView) SeedWordsView(bisq.desktop.main.account.content.seedwords.SeedWordsView) ToggleGroup(javafx.scene.control.ToggleGroup) PasswordView(bisq.desktop.main.account.content.password.PasswordView) FiatAccountsView(bisq.desktop.main.account.content.fiataccounts.FiatAccountsView)

Aggregations

ToggleGroup (javafx.scene.control.ToggleGroup)28 Insets (javafx.geometry.Insets)10 HBox (javafx.scene.layout.HBox)8 Label (javafx.scene.control.Label)7 RadioButton (javafx.scene.control.RadioButton)7 VBox (javafx.scene.layout.VBox)6 ToggleButton (javafx.scene.control.ToggleButton)5 Button (javafx.scene.control.Button)4 Toggle (javafx.scene.control.Toggle)4 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)3 Scene (javafx.scene.Scene)3 AutoTooltipRadioButton (bisq.desktop.components.AutoTooltipRadioButton)2 BsqReceiveView (bisq.desktop.main.dao.wallet.receive.BsqReceiveView)2 Popup (bisq.desktop.main.overlays.popups.Popup)2 List (java.util.List)2 FXCollections (javafx.collections.FXCollections)2 Node (javafx.scene.Node)2 CheckBox (javafx.scene.control.CheckBox)2 ComboBox (javafx.scene.control.ComboBox)2 MenuItem (javafx.scene.control.MenuItem)2