Search in sources :

Example 1 with Tooltip

use of javafx.scene.control.Tooltip in project POL-POM-5 by PlayOnLinux.

the class AppPanel 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 (settingsManager.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 2 with Tooltip

use of javafx.scene.control.Tooltip in project jphp by jphp-compiler.

the class UXTooltip method of.

@Signature
public static Tooltip of(String text, @Nullable Node graphic) {
    Tooltip tooltip = new Tooltip(text);
    tooltip.setGraphic(graphic);
    return tooltip;
}
Also used : Tooltip(javafx.scene.control.Tooltip) Signature(php.runtime.annotation.Reflection.Signature)

Example 3 with Tooltip

use of javafx.scene.control.Tooltip in project jphp by jphp-compiler.

the class UXControl method setTooltipText.

@Setter
public void setTooltipText(Memory value) {
    if (value.isNull()) {
        if (getWrappedObject().tooltipProperty().isBound()) {
            getWrappedObject().tooltipProperty().unbind();
        }
        getWrappedObject().setTooltip(null);
        return;
    }
    Tooltip tooltip = getWrappedObject().getTooltip();
    if (tooltip == null) {
        tooltip = new Tooltip();
        if (getWrappedObject().tooltipProperty().isBound()) {
            getWrappedObject().tooltipProperty().unbind();
        }
        getWrappedObject().setTooltip(tooltip);
    }
    tooltip.setText(value.toString());
}
Also used : Tooltip(javafx.scene.control.Tooltip)

Example 4 with Tooltip

use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.

the class SvnChagnedCodeComposite method initialize.

@FXML
public void initialize() {
    createContextMenu();
    Collection<SVNLogEntry> allLogs = supplier.getAllLogs();
    LOGGER.debug("Log Count : {}", allLogs.size());
    String dateString = supplier.getStart().toDateString();
    String dateString2 = supplier.getEnd().toDateString();
    piChartChagendCode.setTitle(String.format("Chaned Code Count ( Rank %d )\n%s ~ %s", supplier.getRankSize(), dateString, dateString2));
    //		collectedTable = supplier.createStream(allLogs).collect(Collectors.groupingBy(v -> v.getPath()));
    Map<String, Long> collect = supplier.createStream(allLogs).collect(Collectors.groupingBy(v -> v.getPath(), LinkedHashMap::new, Collectors.counting()));
    dataList = collect.entrySet().stream().sorted((o1, o2) -> {
        return -Long.compare(o1.getValue(), o2.getValue());
    }).map(v -> new Data(v.getKey(), v.getValue())).limit(supplier.getRankSize()).collect(Collectors.toList());
    piChartChagendCode.getData().addAll(dataList);
    Set<Node> lookupAll = piChartChagendCode.lookupAll(".chart-pie-label");
    for (Data d : piChartChagendCode.getData()) {
        Node node = d.getNode();
        Tooltip.install(node, new Tooltip(String.format("Source Code : %s\nModify Count:%d", d.getName(), (int) d.getPieValue())));
        node.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
            dataOnMouseClick(e, d);
            e.consume();
        });
        /*animation effect. */
        node.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, ev -> {
            Platform.runLater(() -> node.setStyle("-fx-background-color:derive(-fx-color,-5%);"));
        });
        /*animation effect. */
        node.addEventHandler(MouseEvent.MOUSE_EXITED_TARGET, ev -> {
            Platform.runLater(() -> node.setStyle(null));
        });
    }
    lookupAll.stream().map(v -> (Text) v).forEach(v -> {
        String text = v.getText();
        String displayText = text;
        int count = supplier.getCollectedTable().get(displayText).size();
        int textLength = displayText.length();
        if (textLength > 15) {
            displayText = "... " + displayText.substring(textLength - 15);
            Tooltip.install(v, new Tooltip(text));
        }
        displayText = displayText.concat("   [").concat(String.valueOf(count)).concat("]");
        v.setText(displayText);
    });
//		Platform.runLater(() -> {
//			this.getScene().addEventFilter(KeyEvent.KEY_PRESSED, this::sceneOnKeyPressed);
//		});
}
Also used : MouseButton(javafx.scene.input.MouseButton) ListView(javafx.scene.control.ListView) MouseEvent(javafx.scene.input.MouseEvent) LoggerFactory(org.slf4j.LoggerFactory) FXCollections(javafx.collections.FXCollections) LinkedHashMap(java.util.LinkedHashMap) ContextMenu(javafx.scene.control.ContextMenu) Map(java.util.Map) Tooltip(javafx.scene.control.Tooltip) Data(javafx.scene.chart.PieChart.Data) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) Logger(org.slf4j.Logger) Label(javafx.scene.control.Label) MenuItem(javafx.scene.control.MenuItem) SVNException(org.tmatesoft.svn.core.SVNException) Collection(java.util.Collection) Node(javafx.scene.Node) FXMLController(com.kyj.fx.voeditor.visual.framework.annotation.FXMLController) Set(java.util.Set) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) Text(javafx.scene.text.Text) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) PieChart(javafx.scene.chart.PieChart) List(java.util.List) Region(javafx.scene.layout.Region) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) Data(javafx.scene.chart.PieChart.Data) Text(javafx.scene.text.Text) FXML(javafx.fxml.FXML)

Example 5 with Tooltip

use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.

the class SystemLayoutViewController method loadNewSystemTab.

/**
	 * 탭에 대해 로드함.
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2015. 11. 4.
	 * @param tableName
	 * @param fxmlName
	 */
public void loadNewSystemTab(String tableName, Parent parent, String skin) {
    Platform.runLater(() -> {
        try {
            if (beforeParentLoad != null && beforeParentLoad.filter(parent)) {
                beforeParentLoad.beforeLoad(parent);
                if (beforeParentLoad.isUnloadParent()) {
                    return;
                }
            }
            DockTab tab = new DockTab(tableName, parent);
            // 툴팁 처리 (클래스위치)
            tab.setTooltip(new Tooltip(parent.getClass().getName()));
            addTabItem(tab);
            if (skin != null) {
                parent.getStylesheets().clear();
            //					parent.getStylesheets().add(skin);
            //					tab.getstyle.add(skin);
            }
            tabPanWorkspace.getSelectionModel().select(tab);
            // 리스너 호출.
            onParentloaded.forEach(v -> v.onLoad(parent));
        // _parent.getStylesheets().clear();
        } catch (Exception e1) {
            DialogUtil.showExceptionDailog(e1);
        }
    });
}
Also used : DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) Tooltip(javafx.scene.control.Tooltip) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException)

Aggregations

Tooltip (javafx.scene.control.Tooltip)169 Button (javafx.scene.control.Button)60 Label (javafx.scene.control.Label)50 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