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