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);
}
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;
}
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);
}
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"));
}
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);
}
Aggregations