Search in sources :

Example 16 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 17 with ToggleGroup

use of javafx.scene.control.ToggleGroup in project POL-POM-5 by PhoenicisOrg.

the class ListWidgetSelectorSkin method initialise.

/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
    ToggleGroup toggleGroup = new ToggleGroup();
    this.iconsListButton = new ToggleButton();
    this.iconsListButton.setToggleGroup(toggleGroup);
    this.iconsListButton.getStyleClass().addAll("listIcon", "iconsList");
    this.compactListButton = new ToggleButton();
    this.compactListButton.setToggleGroup(toggleGroup);
    this.compactListButton.getStyleClass().addAll("listIcon", "compactList");
    this.detailsListButton = new ToggleButton();
    this.detailsListButton.setToggleGroup(toggleGroup);
    this.detailsListButton.getStyleClass().addAll("listIcon", "detailsList");
    HBox container = new HBox(iconsListButton, compactListButton, detailsListButton);
    container.getStyleClass().add("listChooser");
    getChildren().addAll(container);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) HBox(javafx.scene.layout.HBox) ToggleGroup(javafx.scene.control.ToggleGroup)

Example 18 with ToggleGroup

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

the class TradesChartsView method getToolBox.

// /////////////////////////////////////////////////////////////////////////////////////////
// CurrencyComboBox
// /////////////////////////////////////////////////////////////////////////////////////////
private HBox getToolBox() {
    Label currencyLabel = new AutoTooltipLabel(Res.getWithCol("shared.currency"));
    currencyLabel.setPadding(new Insets(0, 4, 0, 0));
    currencyComboBox = new ComboBox<>();
    currencyComboBox.setPromptText(Res.get("list.currency.select"));
    currencyComboBox.setConverter(GUIUtil.getCurrencyListItemConverter(Res.get("shared.trade"), Res.get("shared.trades"), model.preferences));
    Pane spacer = new Pane();
    HBox.setHgrow(spacer, Priority.ALWAYS);
    Label label = new AutoTooltipLabel("Interval:");
    label.setPadding(new Insets(0, 4, 0, 0));
    toggleGroup = new ToggleGroup();
    ToggleButton year = getToggleButton(Res.get("time.year"), TradesChartsViewModel.TickUnit.YEAR, toggleGroup, "toggle-left");
    ToggleButton month = getToggleButton(Res.get("time.month"), TradesChartsViewModel.TickUnit.MONTH, toggleGroup, "toggle-left");
    ToggleButton week = getToggleButton(Res.get("time.week"), TradesChartsViewModel.TickUnit.WEEK, toggleGroup, "toggle-center");
    ToggleButton day = getToggleButton(Res.get("time.day"), TradesChartsViewModel.TickUnit.DAY, toggleGroup, "toggle-center");
    ToggleButton hour = getToggleButton(Res.get("time.hour"), TradesChartsViewModel.TickUnit.HOUR, toggleGroup, "toggle-center");
    ToggleButton minute10 = getToggleButton(Res.get("time.minute10"), TradesChartsViewModel.TickUnit.MINUTE_10, toggleGroup, "toggle-center");
    HBox hBox = new HBox();
    hBox.setSpacing(0);
    hBox.setPadding(new Insets(5, 9, -10, 10));
    hBox.setAlignment(Pos.CENTER_LEFT);
    hBox.getChildren().addAll(currencyLabel, currencyComboBox, spacer, label, year, month, week, day, hour, minute10);
    return hBox;
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) AutoTooltipToggleButton(bisq.desktop.components.AutoTooltipToggleButton) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) ToggleGroup(javafx.scene.control.ToggleGroup) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TabPane(javafx.scene.control.TabPane) Pane(javafx.scene.layout.Pane)

Example 19 with ToggleGroup

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

the class WithdrawalView method initialize.

@Override
public void initialize() {
    inputsLabel.setText(Res.getWithCol("funds.withdrawal.inputs"));
    useAllInputsRadioButton.setText(Res.get("funds.withdrawal.useAllInputs"));
    useCustomInputsRadioButton.setText(Res.get("funds.withdrawal.useCustomInputs"));
    amountLabel.setText(Res.getWithCol("funds.withdrawal.receiverAmount", Res.getBaseCurrencyCode()));
    feeExcludedRadioButton.setText(Res.get("funds.withdrawal.feeExcluded"));
    feeIncludedRadioButton.setText(Res.get("funds.withdrawal.feeIncluded"));
    fromLabel.setText(Res.get("funds.withdrawal.fromLabel", Res.getBaseCurrencyCode()));
    toLabel.setText(Res.get("funds.withdrawal.toLabel", Res.getBaseCurrencyCode()));
    withdrawButton.setText(Res.get("funds.withdrawal.withdrawButton"));
    addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address")));
    balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())));
    selectColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.select")));
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.withdrawal.noFundsAvailable")));
    tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    setAddressColumnCellFactory();
    setBalanceColumnCellFactory();
    setSelectColumnCellFactory();
    addressColumn.setComparator((o1, o2) -> o1.getAddressString().compareTo(o2.getAddressString()));
    balanceColumn.setComparator((o1, o2) -> o1.getBalance().compareTo(o2.getBalance()));
    balanceColumn.setSortType(TableColumn.SortType.DESCENDING);
    tableView.getSortOrder().add(balanceColumn);
    balanceListener = new BalanceListener() {

        @Override
        public void onBalanceChanged(Coin balance, Transaction tx) {
            updateList();
        }
    };
    amountListener = (observable, oldValue, newValue) -> {
        if (amountTextField.focusedProperty().get()) {
            try {
                amountAsCoin = formatter.parseToCoin(amountTextField.getText());
            } catch (Throwable t) {
                log.error("Error at amountTextField input. " + t.toString());
            }
        }
    };
    amountFocusListener = (observable, oldValue, newValue) -> {
        if (oldValue && !newValue) {
            if (amountAsCoin.isPositive())
                amountTextField.setText(formatter.formatCoin(amountAsCoin));
            else
                amountTextField.setText("");
        }
    };
    feeToggleGroup = new ToggleGroup();
    feeExcludedRadioButton.setToggleGroup(feeToggleGroup);
    feeIncludedRadioButton.setToggleGroup(feeToggleGroup);
    feeToggleGroupListener = (observable, oldValue, newValue) -> {
        feeExcluded = newValue == feeExcludedRadioButton;
        amountLabel.setText(feeExcluded ? Res.getWithCol("funds.withdrawal.receiverAmount", Res.getBaseCurrencyCode()) : Res.getWithCol("funds.withdrawal.senderAmount", Res.getBaseCurrencyCode()));
    };
    inputsToggleGroup = new ToggleGroup();
    useAllInputsRadioButton.setToggleGroup(inputsToggleGroup);
    useCustomInputsRadioButton.setToggleGroup(inputsToggleGroup);
    inputsToggleGroupListener = (observable, oldValue, newValue) -> {
        useAllInputs.set(newValue == useAllInputsRadioButton);
        updateInputSelection();
    };
}
Also used : Coin(org.bitcoinj.core.Coin) BalanceListener(bisq.core.btc.listeners.BalanceListener) Transaction(org.bitcoinj.core.Transaction) ToggleGroup(javafx.scene.control.ToggleGroup) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 20 with ToggleGroup

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

the class ProposalView method initialize.

@Override
public void initialize() {
    listener = viewPath -> {
        if (viewPath.size() != 4 || viewPath.indexOf(ProposalView.class) != 2)
            return;
        selectedViewClass = viewPath.tip();
        loadView(selectedViewClass);
    };
    ToggleGroup toggleGroup = new ToggleGroup();
    dashboard = new MenuItem(navigation, toggleGroup, Res.get("shared.dashboard"), ProposalDashboardView.class, AwesomeIcon.DASHBOARD);
    make = new MenuItem(navigation, toggleGroup, Res.get("dao.proposal.menuItem.make"), MakeProposalView.class, AwesomeIcon.EDIT);
    active = new MenuItem(navigation, toggleGroup, Res.get("dao.proposal.menuItem.active"), ActiveProposalsView.class, AwesomeIcon.LIST_UL);
    myVotes = new MenuItem(navigation, toggleGroup, Res.get("dao.proposal.menuItem.myVotes"), MyVotesView.class, AwesomeIcon.THUMBS_UP);
    votes = new MenuItem(navigation, toggleGroup, Res.get("dao.proposal.menuItem.votes"), VotesView.class, AwesomeIcon.THUMBS_UP_ALT);
    closed = new MenuItem(navigation, toggleGroup, Res.get("dao.proposal.menuItem.closed"), ClosedProposalsView.class, AwesomeIcon.LIST_ALT);
    leftVBox.getChildren().addAll(dashboard, make, active, myVotes, votes, closed);
}
Also used : ProposalDashboardView(bisq.desktop.main.dao.proposal.dashboard.ProposalDashboardView) ToggleGroup(javafx.scene.control.ToggleGroup) VotesView(bisq.desktop.main.dao.proposal.votes.VotesView) MyVotesView(bisq.desktop.main.dao.proposal.myvotes.MyVotesView) MenuItem(bisq.desktop.components.MenuItem) MyVotesView(bisq.desktop.main.dao.proposal.myvotes.MyVotesView) MakeProposalView(bisq.desktop.main.dao.proposal.make.MakeProposalView) ActiveProposalsView(bisq.desktop.main.dao.proposal.active.ActiveProposalsView) ClosedProposalsView(bisq.desktop.main.dao.proposal.closed.ClosedProposalsView)

Aggregations

ToggleGroup (javafx.scene.control.ToggleGroup)32 Insets (javafx.geometry.Insets)10 RadioButton (javafx.scene.control.RadioButton)9 HBox (javafx.scene.layout.HBox)9 ToggleButton (javafx.scene.control.ToggleButton)8 Label (javafx.scene.control.Label)7 VBox (javafx.scene.layout.VBox)6 Toggle (javafx.scene.control.Toggle)5 Button (javafx.scene.control.Button)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