下面列出了javafx.scene.text.Text#setOnMouseEntered ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected Text buildThreadLink(final TableCell<ThreadElement, Set<ThreadElement>> cell, final ThreadElement thread) {
final Text threadText = new Text(thread.getName());
threadText.getStyleClass().add("text");
threadText.setOnMouseClicked(ThreadListCellFactory.this.buildMouseClickedEventHandler(cell, thread));
threadText.setOnMouseEntered(event -> threadText.setCursor(Cursor.HAND));
return threadText;
}
private static Text helpIcon(HelpPopup popup) {
Text icon = MaterialDesignIconFactory.get().createIcon(MaterialDesignIcon.HELP_CIRCLE, "1.1em");
icon.setOnMouseEntered(e -> {
Point2D p = icon.localToScreen(icon.getLayoutBounds().getMaxX(), icon.getLayoutBounds().getMaxY());
popup.show(icon, p.getX(), p.getY());
});
icon.setOnMouseExited(e -> popup.hide());
return icon;
}