Search in sources :

Example 61 with Tooltip

use of javafx.scene.control.Tooltip in project phoenicis by PhoenicisOrg.

the class ApplicationPanel method refreshScripts.

/**
 * Refreshes the shown scripts.
 * When this method is called it begins by clearing the <code>scriptGrid</code>.
 * Afterwards this method refills it.
 */
private void refreshScripts() {
    scriptGrid.getChildren().clear();
    for (int i = 0; i < filteredScripts.size(); i++) {
        ScriptDTO script = filteredScripts.get(i);
        Label scriptName = new Label(script.getScriptName());
        if (javaFxSettingsManager.isViewScriptSource()) {
            final Tooltip tooltip = new Tooltip(tr("Source: {0}", script.getScriptSource()));
            Tooltip.install(scriptName, tooltip);
        }
        Button installButton = new Button(tr("Install"));
        installButton.setOnMouseClicked(evt -> {
            try {
                onScriptInstall.accept(script);
            } catch (IllegalArgumentException e) {
                LOGGER.error("Failed to get script", e);
                new ErrorMessage(tr("Error while trying to download the installer"), e).show();
            }
        });
        scriptGrid.addRow(i, scriptName, installButton);
        GridPane.setHgrow(scriptName, Priority.ALWAYS);
    }
}
Also used : ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage)

Example 62 with Tooltip

use of javafx.scene.control.Tooltip in project dolphin-platform by canoo.

the class Utils method registerTooltip.

public static void registerTooltip(Control node, WithDescription bean) {
    Tooltip tooltip = new Tooltip();
    tooltip.textProperty().bind(FXWrapper.wrapStringProperty(bean.descriptionProperty()));
    FXWrapper.wrapStringProperty(bean.descriptionProperty()).addListener(e -> {
        if (bean.getDescription() == null || bean.getDescription().isEmpty()) {
            node.setTooltip(null);
        } else {
            node.setTooltip(tooltip);
        }
    });
    if (bean.getDescription() == null || bean.getDescription().isEmpty()) {
        node.setTooltip(null);
    } else {
        node.setTooltip(tooltip);
    }
}
Also used : Tooltip(javafx.scene.control.Tooltip)

Example 63 with Tooltip

use of javafx.scene.control.Tooltip in project jvarkit by lindenb.

the class JfxNgs method start.

/*
    private void showPreferenceDialoge(Window parentStage)
	    {
	    Stage dialog = new Stage();


	     dialog.setTitle("Preferences");
		 dialog.initOwner(parentStage);
		 dialog.initModality(Modality.APPLICATION_MODAL);
		 dialog.showAndWait();
	    }*/
@Override
public void start(final Stage primaryStage) throws Exception {
    final Parameters params = this.getParameters();
    primaryStage.setTitle(getClass().getSimpleName());
    Menu menu = new Menu("File");
    menu.getItems().addAll(createCommonMenuItems(primaryStage));
    menu.getItems().add(new SeparatorMenuItem());
    MenuItem menuItem = new MenuItem("Quit...");
    menuItem.setOnAction(AE -> doMenuQuit());
    menu.getItems().add(menuItem);
    MenuBar bar = new MenuBar(menu);
    FlowPane flow = new FlowPane(5, 5);
    flow.setPadding(new Insets(10));
    flow.getChildren().add(new Label("Set Location of all frames to:"));
    final TextField textField = new TextField();
    textField.setPrefColumnCount(25);
    textField.setPromptText("Location. e:g '2:1234-5678'");
    flow.getChildren().add(textField);
    Button button = new Button("Go");
    flow.getChildren().add(button);
    textField.setTooltip(new Tooltip("set genomic location can be: empty, 'contig', 'contig:pos', 'contig:start-end' and (\"unmapped\" for bam)"));
    final EventHandler<ActionEvent> handler = new EventHandler<ActionEvent>() {

        @Override
        public void handle(final ActionEvent event) {
            final String loc = textField.getText().trim();
            LOG.info("moveTo all to " + loc);
            for (final NgsStage<?, ?> sc : all_opened_stages) {
                LOG.info("moveTo " + sc.getTitle() + " to " + loc);
                sc.moveTo(loc);
            }
        }
    };
    button.setOnAction(handler);
    button.setTooltip(new Tooltip("Go the specified genomic location."));
    textField.setOnAction(handler);
    BorderPane pane = new BorderPane();
    pane.setPadding(new Insets(5));
    pane.setBottom(new Label("Author: Pierre Lindenbaum PhD."));
    VBox vbox1 = new VBox(bar, flow, pane);
    final Scene scene = new Scene(vbox1, 500, 300);
    primaryStage.setScene(scene);
    Exception lastException = null;
    primaryStage.addEventHandler(WindowEvent.WINDOW_SHOWING, new EventHandler<WindowEvent>() {

        @Override
        public void handle(final WindowEvent event) {
            final List<String> unnamedParams = new ArrayList<>(params.getUnnamed());
            String startPos = "";
            int optind = 0;
            while (optind + 1 < unnamedParams.size()) {
                if (unnamedParams.get(optind).equals("-h") || unnamedParams.get(optind).equals("--help")) {
                    unnamedParams.remove(optind);
                    System.out.println("JfxNgs : Pierre Lindenbaum PhD 2017");
                    System.out.println("Options:");
                    System.out.println(" -h|--help this screen.");
                    System.out.println(" -p|--position (string) the starting position");
                    Platform.exit();
                } else if (unnamedParams.get(optind).equals("-p") || unnamedParams.get(optind).equals("--position")) {
                    startPos = unnamedParams.get(optind + 1);
                    unnamedParams.remove(optind + 1);
                    unnamedParams.remove(optind);
                } else {
                    optind++;
                }
            }
            for (final String arg : unnamedParams) {
                VcfFile vcfin = null;
                BamFile bamin = null;
                try {
                    if (IOUtil.isUrl(arg)) {
                        if (arg.endsWith(".bam")) {
                            bamin = BamFile.newInstance(arg);
                        } else if (arg.endsWith(".vcf.gz")) {
                            vcfin = VcfFile.newInstance(arg);
                        }
                    } else {
                        final File f = new File(arg);
                        if (fileMatchExtensionFilter(f.getName(), BamStage.EXTENSION_FILTERS)) {
                            bamin = BamFile.newInstance(f);
                        } else if (fileMatchExtensionFilter(f.getName(), VcfStage.EXTENSION_FILTERS)) {
                            vcfin = VcfFile.newInstance(f);
                        } else {
                            JfxNgs.showExceptionDialog(primaryStage, "Cannot open " + f);
                        }
                    }
                    if (vcfin != null) {
                        new VcfStage(JfxNgs.this, vcfin).setLocationOnOpen(startPos).show();
                    } else if (bamin != null) {
                        new BamStage(JfxNgs.this, bamin).show();
                    }
                } catch (Exception e) {
                    CloserUtil.close(vcfin);
                    CloserUtil.close(bamin);
                    showExceptionDialog(primaryStage, e);
                }
            }
        }
    });
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Insets(javafx.geometry.Insets) ActionEvent(javafx.event.ActionEvent) Label(javafx.scene.control.Label) MenuBar(javafx.scene.control.MenuBar) EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) FlowPane(javafx.scene.layout.FlowPane) TextField(javafx.scene.control.TextField) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) List(java.util.List) Menu(javafx.scene.control.Menu) Tooltip(javafx.scene.control.Tooltip) CheckMenuItem(javafx.scene.control.CheckMenuItem) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) Scene(javafx.scene.Scene) ScriptException(javax.script.ScriptException) BackingStoreException(java.util.prefs.BackingStoreException) IOException(java.io.IOException) WindowEvent(javafx.stage.WindowEvent) VBox(javafx.scene.layout.VBox) File(java.io.File)

Example 64 with Tooltip

use of javafx.scene.control.Tooltip in project jvarkit by lindenb.

the class NgsStage method createHyperLink.

protected Hyperlink createHyperLink(final String label, final String url) {
    final Hyperlink a = new Hyperlink(label == null || label.isEmpty() ? url : label);
    a.setTooltip(new Tooltip(url));
    a.setOnAction(event -> {
        NgsStage.this.owner.getHostServices().showDocument(url);
    });
    return a;
}
Also used : Tooltip(javafx.scene.control.Tooltip) Hyperlink(javafx.scene.control.Hyperlink)

Example 65 with Tooltip

use of javafx.scene.control.Tooltip in project uPMT by coco35700.

the class RootInterviewTreeViewController method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomRoot.setText(interview.getName());
    Node icon = new ImageView(ResourceLoader.loadImage("new.png"));
    this.addInterview.setGraphic(icon);
    rootIcon.setImage(ResourceLoader.loadImage("rootInterview.gif"));
    Tooltip addInter = new Tooltip(main._langBundle.getString("add_interview"));
    addInterview.setTooltip(addInter);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView)

Aggregations

Tooltip (javafx.scene.control.Tooltip)173 Button (javafx.scene.control.Button)61 Label (javafx.scene.control.Label)51 Insets (javafx.geometry.Insets)38 ImageView (javafx.scene.image.ImageView)34 VBox (javafx.scene.layout.VBox)32 List (java.util.List)31 TableColumn (javafx.scene.control.TableColumn)29 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)28 FXML (javafx.fxml.FXML)27 TableCell (javafx.scene.control.TableCell)27 ObservableList (javafx.collections.ObservableList)26 Node (javafx.scene.Node)26 TableView (javafx.scene.control.TableView)26 ArrayList (java.util.ArrayList)25 Inject (javax.inject.Inject)25 Res (bisq.core.locale.Res)24 FxmlView (bisq.desktop.common.view.FxmlView)23 HyperlinkWithIcon (bisq.desktop.components.HyperlinkWithIcon)23 Collectors (java.util.stream.Collectors)23