Search in sources :

Example 6 with Tooltip

use of javafx.scene.control.Tooltip in project fx2048 by brunoborges.

the class GamePane method createButtonItem.

private Button createButtonItem(String symbol, String text, EventHandler<ActionEvent> t) {
    Button g = new Button();
    g.setPrefSize(40, 40);
    g.setId(symbol);
    g.setOnAction(t);
    g.setTooltip(new Tooltip(text));
    return g;
}
Also used : Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip)

Example 7 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 8 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)

Example 9 with Tooltip

use of javafx.scene.control.Tooltip in project jgnash by ccavanaugh.

the class OpenDatabaseController method setDatabaseField.

private void setDatabaseField(final String database) {
    localDatabaseField.setText(database);
    localDatabaseField.setTooltip(new Tooltip(database));
}
Also used : Tooltip(javafx.scene.control.Tooltip)

Example 10 with Tooltip

use of javafx.scene.control.Tooltip in project jgnash by ccavanaugh.

the class IncomeExpenseBarChartDialogController method updateChart.

private void updateChart() {
    final Engine engine = EngineFactory.getEngine(EngineFactory.DEFAULT);
    Objects.requireNonNull(engine);
    final List<Account> incomeAccounts = engine.getIncomeAccountList();
    final List<Account> expenseAccounts = engine.getExpenseAccountList();
    barChart.getData().clear();
    final List<ReportPeriodUtils.Descriptor> descriptors = ReportPeriodUtils.getDescriptors(periodComboBox.getValue(), startDatePicker.getValue(), endDatePicker.getValue());
    // Income Series
    final XYChart.Series<String, Number> incomeSeries = new XYChart.Series<>();
    incomeSeries.setName(AccountType.INCOME.toString());
    barChart.getData().add(incomeSeries);
    // Expense Series
    final XYChart.Series<String, Number> expenseSeries = new XYChart.Series<>();
    expenseSeries.setName(AccountType.EXPENSE.toString());
    barChart.getData().add(expenseSeries);
    // Profit Series
    final XYChart.Series<String, Number> profitSeries = new XYChart.Series<>();
    profitSeries.setName(resources.getString("Word.NetIncome"));
    barChart.getData().add(profitSeries);
    for (final ReportPeriodUtils.Descriptor descriptor : descriptors) {
        final BigDecimal income = getSum(incomeAccounts, descriptor.getStartDate(), descriptor.getEndDate());
        final BigDecimal expense = getSum(expenseAccounts, descriptor.getStartDate(), descriptor.getEndDate());
        incomeSeries.getData().add(new XYChart.Data<>(descriptor.getLabel(), income));
        expenseSeries.getData().add(new XYChart.Data<>(descriptor.getLabel(), expense));
        profitSeries.getData().add(new XYChart.Data<>(descriptor.getLabel(), income.add(expense)));
    }
    int descriptorsIndex = 0;
    for (final XYChart.Data<String, Number> data : incomeSeries.getData()) {
        Tooltip.install(data.getNode(), new Tooltip(numberFormat.format(data.getYValue())));
        setupPieChartLaunch(data, AccountType.INCOME, descriptors.get(descriptorsIndex).getStartDate(), descriptors.get(descriptorsIndex).getEndDate());
        descriptorsIndex++;
    }
    descriptorsIndex = 0;
    for (final XYChart.Data<String, Number> data : expenseSeries.getData()) {
        Tooltip.install(data.getNode(), new Tooltip(numberFormat.format(data.getYValue())));
        setupPieChartLaunch(data, AccountType.EXPENSE, descriptors.get(descriptorsIndex).getStartDate(), descriptors.get(descriptorsIndex).getEndDate());
        descriptorsIndex++;
    }
    for (final XYChart.Data<String, Number> data : profitSeries.getData()) {
        Tooltip.install(data.getNode(), new Tooltip(numberFormat.format(data.getYValue())));
    }
}
Also used : Account(jgnash.engine.Account) ReportPeriodUtils(jgnash.report.ReportPeriodUtils) Tooltip(javafx.scene.control.Tooltip) BigDecimal(java.math.BigDecimal) XYChart(javafx.scene.chart.XYChart) Engine(jgnash.engine.Engine)

Aggregations

Tooltip (javafx.scene.control.Tooltip)34 Button (javafx.scene.control.Button)12 Label (javafx.scene.control.Label)9 Node (javafx.scene.Node)5 IOException (java.io.IOException)4 Account (jgnash.engine.Account)4 DockTab (com.kyj.fx.voeditor.visual.component.dock.tab.DockTab)3 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)3 Contract (io.bitsquare.trade.Contract)3 BigDecimal (java.math.BigDecimal)3 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 PieChart (javafx.scene.chart.PieChart)3 TextField (javafx.scene.control.TextField)3 NotNull (org.jetbrains.annotations.NotNull)3 BusyAnimation (io.bitsquare.gui.components.BusyAnimation)2 TextFieldWithCopyIcon (io.bitsquare.gui.components.TextFieldWithCopyIcon)2 PaymentAccountContractData (io.bitsquare.payment.PaymentAccountContractData)2 Offer (io.bitsquare.trade.offer.Offer)2 NumberFormat (java.text.NumberFormat)2