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