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