Search in sources :

Example 66 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class BindingTest method start.

@Override
public void start(Stage primaryStage) {
    VBox root = new VBox();
    root.setSpacing(20);
    Label label = new AutoTooltipLabel();
    StringProperty txt = new SimpleStringProperty();
    txt.set("-");
    label.textProperty().bind(txt);
    Button button = new AutoTooltipButton("count up");
    button.setOnAction(e -> txt.set("counter " + counter++));
    root.getChildren().addAll(label, button);
    primaryStage.setScene(new Scene(root, 400, 400));
    primaryStage.show();
}
Also used : Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 67 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class MainView method setupNotificationIcon.

private void setupNotificationIcon(Pane buttonHolder) {
    Label label = new AutoTooltipLabel();
    label.textProperty().bind(model.numPendingTradesAsString);
    label.relocate(5, 1);
    label.setId("nav-alert-label");
    ImageView icon = new ImageView();
    icon.setId("image-alert-round");
    Pane notification = new Pane();
    notification.relocate(30, 9);
    notification.setMouseTransparent(true);
    notification.setEffect(new DropShadow(4, 1, 2, Color.GREY));
    notification.getChildren().addAll(icon, label);
    notification.visibleProperty().bind(model.showPendingTradesNotification);
    buttonHolder.getChildren().add(notification);
}
Also used : AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) AnchorPane(javafx.scene.layout.AnchorPane) BorderPane(javafx.scene.layout.BorderPane) DropShadow(javafx.scene.effect.DropShadow)

Example 68 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class MainView method createFooter.

private AnchorPane createFooter() {
    // line
    Separator separator = new Separator();
    separator.setId("footer-pane-line");
    separator.setPrefHeight(1);
    setLeftAnchor(separator, 0d);
    setRightAnchor(separator, 0d);
    setTopAnchor(separator, 0d);
    // BTC
    Label btcInfoLabel = new AutoTooltipLabel();
    btcInfoLabel.setId("footer-pane");
    btcInfoLabel.textProperty().bind(model.btcInfo);
    ProgressBar blockchainSyncIndicator = new ProgressBar(-1);
    blockchainSyncIndicator.setPrefWidth(120);
    blockchainSyncIndicator.setMaxHeight(10);
    blockchainSyncIndicator.progressProperty().bind(model.btcSyncProgress);
    model.walletServiceErrorMsg.addListener((ov, oldValue, newValue) -> {
        if (newValue != null) {
            btcInfoLabel.setId("splash-error-state-msg");
            btcInfoLabel.getStyleClass().add("error-text");
            if (btcNetworkWarnMsgPopup == null) {
                btcNetworkWarnMsgPopup = new Popup<>().warning(newValue);
                btcNetworkWarnMsgPopup.show();
            }
        } else {
            btcInfoLabel.setId("footer-pane");
            if (btcNetworkWarnMsgPopup != null)
                btcNetworkWarnMsgPopup.hide();
        }
    });
    model.btcSyncProgress.addListener((ov, oldValue, newValue) -> {
        if ((double) newValue >= 1) {
            blockchainSyncIndicator.setVisible(false);
            blockchainSyncIndicator.setManaged(false);
        }
    });
    HBox blockchainSyncBox = new HBox();
    blockchainSyncBox.setSpacing(10);
    blockchainSyncBox.setAlignment(Pos.CENTER);
    blockchainSyncBox.getChildren().addAll(btcInfoLabel, blockchainSyncIndicator);
    setLeftAnchor(blockchainSyncBox, 10d);
    setBottomAnchor(blockchainSyncBox, 7d);
    // version
    versionLabel = new AutoTooltipLabel();
    versionLabel.setId("footer-pane");
    versionLabel.setTextAlignment(TextAlignment.CENTER);
    versionLabel.setAlignment(Pos.BASELINE_CENTER);
    versionLabel.setText("v" + Version.VERSION);
    root.widthProperty().addListener((ov, oldValue, newValue) -> {
        versionLabel.setLayoutX(((double) newValue - versionLabel.getWidth()) / 2);
    });
    setBottomAnchor(versionLabel, 7d);
    model.newVersionAvailableProperty.addListener((observable, oldValue, newValue) -> {
        versionLabel.getStyleClass().removeAll("version-new", "version");
        if (newValue) {
            versionLabel.getStyleClass().add("version-new");
            versionLabel.setOnMouseClicked(e -> model.openDownloadWindow());
            versionLabel.setText("v" + Version.VERSION + " " + Res.get("mainView.version.update"));
        } else {
            versionLabel.getStyleClass().add("version");
            versionLabel.setOnMouseClicked(null);
            versionLabel.setText("v" + Version.VERSION);
        }
    });
    // P2P Network
    Label p2PNetworkLabel = new AutoTooltipLabel();
    p2PNetworkLabel.setId("footer-pane");
    setRightAnchor(p2PNetworkLabel, 33d);
    setBottomAnchor(p2PNetworkLabel, 7d);
    p2PNetworkLabel.textProperty().bind(model.p2PNetworkInfo);
    ImageView p2PNetworkIcon = new ImageView();
    setRightAnchor(p2PNetworkIcon, 10d);
    setBottomAnchor(p2PNetworkIcon, 7d);
    p2PNetworkIcon.setOpacity(0.4);
    p2PNetworkIcon.idProperty().bind(model.p2PNetworkIconId);
    p2PNetworkLabel.idProperty().bind(model.p2pNetworkLabelId);
    model.p2pNetworkWarnMsg.addListener((ov, oldValue, newValue) -> {
        if (newValue != null) {
            p2PNetworkWarnMsgPopup = new Popup<>().warning(newValue);
            p2PNetworkWarnMsgPopup.show();
        } else if (p2PNetworkWarnMsgPopup != null) {
            p2PNetworkWarnMsgPopup.hide();
        }
    });
    model.bootstrapComplete.addListener((observable, oldValue, newValue) -> {
        p2PNetworkIcon.setOpacity(1);
    });
    return new AnchorPane(separator, blockchainSyncBox, versionLabel, p2PNetworkLabel, p2PNetworkIcon) {

        {
            setId("footer-pane");
            setMinHeight(30);
            setMaxHeight(30);
        }
    };
}
Also used : HBox(javafx.scene.layout.HBox) Popup(bisq.desktop.main.overlays.popups.Popup) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) ProgressBar(javafx.scene.control.ProgressBar) AnchorPane(javafx.scene.layout.AnchorPane) Separator(javafx.scene.control.Separator)

Example 69 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class FiatAccountsView method initialize.

@Override
public void initialize() {
    buildForm();
    paymentAccountChangeListener = (observable, oldValue, newValue) -> {
        if (newValue != null)
            onSelectAccount(newValue);
    };
    Label placeholder = new AutoTooltipLabel(Res.get("shared.noAccountsSetupYet"));
    placeholder.setWrapText(true);
    paymentAccountsListView.setPlaceholder(placeholder);
}
Also used : AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 70 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class BisqApp method showFPSWindow.

private void showFPSWindow() {
    Label label = new AutoTooltipLabel();
    EventStreams.animationTicks().latestN(100).map(ticks -> {
        int n = ticks.size() - 1;
        return n * 1_000_000_000.0 / (ticks.get(n) - ticks.get(0));
    }).map(// Don't translate, just for dev
    d -> String.format("FPS: %.3f", d)).feedTo(label.textProperty());
    Pane root = new StackPane();
    root.getChildren().add(label);
    Stage stage = new Stage();
    stage.setScene(new Scene(root));
    // Don't translate, just for dev
    stage.setTitle("FPS");
    stage.initModality(Modality.NONE);
    stage.initStyle(StageStyle.UTILITY);
    stage.initOwner(scene.getWindow());
    stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10);
    stage.setY(primaryStage.getY());
    stage.setWidth(200);
    stage.setHeight(100);
    stage.show();
}
Also used : StageStyle(javafx.stage.StageStyle) ManualPayoutTxWindow(bisq.desktop.main.overlays.windows.ManualPayoutTxWindow) Arrays(java.util.Arrays) Utilities(bisq.common.util.Utilities) DaoManager(bisq.core.dao.DaoManager) Key(com.google.inject.Key) LoggerFactory(org.slf4j.LoggerFactory) Security(java.security.Security) StackPane(javafx.scene.layout.StackPane) DisputeManager(bisq.core.arbitration.DisputeManager) User(bisq.core.user.User) Application(javafx.application.Application) Parent(javafx.scene.Parent) ViewLoader(bisq.desktop.common.view.ViewLoader) AddressEntryList(bisq.core.btc.AddressEntryList) Res(bisq.core.locale.Res) SendAlertMessageWindow(bisq.desktop.main.overlays.windows.SendAlertMessageWindow) BlockStoreException(org.bitcoinj.store.BlockStoreException) INITIAL_SCENE_WIDTH(bisq.desktop.util.Layout.INITIAL_SCENE_WIDTH) VoteService(bisq.core.dao.vote.VoteService) Pane(javafx.scene.layout.Pane) Navigation(bisq.desktop.Navigation) Popup(bisq.desktop.main.overlays.popups.Popup) ClosedTradableManager(bisq.core.trade.closed.ClosedTradableManager) Capabilities(bisq.common.app.Capabilities) P2PService(bisq.network.p2p.P2PService) CachingViewLoader(bisq.desktop.common.view.CachingViewLoader) ArbitratorManager(bisq.core.arbitration.ArbitratorManager) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FilterManager(bisq.core.filter.FilterManager) PersistedDataHost(bisq.common.proto.persistable.PersistedDataHost) ShowWalletDataWindow(bisq.desktop.main.overlays.windows.ShowWalletDataWindow) KeyEvent(javafx.scene.input.KeyEvent) BaseCurrencyNetwork(bisq.core.btc.BaseCurrencyNetwork) BsqWalletService(bisq.core.btc.wallet.BsqWalletService) Platform(javafx.application.Platform) List(java.util.List) WalletsSetup(bisq.core.btc.wallet.WalletsSetup) DevEnv(bisq.common.app.DevEnv) TradeManager(bisq.core.trade.TradeManager) Logger(ch.qos.logback.classic.Logger) EmptyWalletWindow(bisq.desktop.main.overlays.windows.EmptyWalletWindow) AppOptionKeys(bisq.core.app.AppOptionKeys) Preferences(bisq.core.user.Preferences) UserThread(bisq.common.UserThread) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) EventStreams(org.reactfx.EventStreams) INITIAL_SCENE_HEIGHT(bisq.desktop.util.Layout.INITIAL_SCENE_HEIGHT) ExceptionUtils(org.apache.commons.lang3.exception.ExceptionUtils) BtcWalletService(bisq.core.btc.wallet.BtcWalletService) Scene(javafx.scene.Scene) AlertManager(bisq.core.alert.AlertManager) WalletService(bisq.core.btc.wallet.WalletService) CommonOptionKeys(bisq.common.CommonOptionKeys) ArrayList(java.util.ArrayList) WalletsManager(bisq.core.btc.wallet.WalletsManager) UITimer(bisq.desktop.common.UITimer) CurrencyUtil(bisq.core.locale.CurrencyUtil) Profiler(bisq.common.util.Profiler) LimitedKeyStrengthException(bisq.common.crypto.LimitedKeyStrengthException) InjectorViewFactory(bisq.desktop.common.view.guice.InjectorViewFactory) KeyCode(javafx.scene.input.KeyCode) Version(bisq.common.app.Version) Modality(javafx.stage.Modality) Label(javafx.scene.control.Label) FailedTradesManager(bisq.core.trade.failed.FailedTradesManager) ResultHandler(bisq.common.handlers.ResultHandler) Log(bisq.common.app.Log) IOException(java.io.IOException) BisqEnvironment(bisq.core.app.BisqEnvironment) Names(com.google.inject.name.Names) OpenOfferManager(bisq.core.offer.OpenOfferManager) BouncyCastleProvider(org.bouncycastle.jce.provider.BouncyCastleProvider) DebugView(bisq.desktop.main.debug.DebugView) Injector(com.google.inject.Injector) TimeUnit(java.util.concurrent.TimeUnit) View(bisq.desktop.common.view.View) MainView(bisq.desktop.main.MainView) Level(ch.qos.logback.classic.Level) Stage(javafx.stage.Stage) ImageUtil(bisq.desktop.util.ImageUtil) Paths(java.nio.file.Paths) Storage(bisq.common.storage.Storage) FilterWindow(bisq.desktop.main.overlays.windows.FilterWindow) SystemTray(bisq.desktop.SystemTray) Guice(com.google.inject.Guice) Image(javafx.scene.image.Image) ProposalCollectionsService(bisq.core.dao.proposal.ProposalCollectionsService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) Stage(javafx.stage.Stage) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) StackPane(javafx.scene.layout.StackPane)

Aggregations

AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)90 Label (javafx.scene.control.Label)55 Insets (javafx.geometry.Insets)45 HBox (javafx.scene.layout.HBox)29 TableCell (javafx.scene.control.TableCell)27 TableColumn (javafx.scene.control.TableColumn)27 VBox (javafx.scene.layout.VBox)23 AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)22 Button (javafx.scene.control.Button)22 ImageView (javafx.scene.image.ImageView)19 Res (bisq.core.locale.Res)18 InputTextField (bisq.desktop.components.InputTextField)18 Popup (bisq.desktop.main.overlays.popups.Popup)17 FxmlView (bisq.desktop.common.view.FxmlView)16 Callback (javafx.util.Callback)16 Inject (javax.inject.Inject)16 Coin (org.bitcoinj.core.Coin)16 Tooltip (javafx.scene.control.Tooltip)15 TableView (javafx.scene.control.TableView)14 BSFormatter (bisq.desktop.util.BSFormatter)13