/**
* Sets {@link Tooltip} for a {@link Node} which nicely shows {@link ImageView} inside.
*
* @param nodeToHaveTooltip
* The Node for installing Tooltip.
*
* @param imageView
* The ImageView to show inside Tooltip.
*/
public static void setImageViewTooltip(Node nodeToHaveTooltip,
ImageView imageView) {
// Add shadow to ImageView so the actual image will be clearly distinguishable from
// tooltip's background.
DropShadow shadow = new DropShadow(BlurType.ONE_PASS_BOX, Color.GREY, 5.0, 1.0, 0.0, 0.0);
imageView.setEffect(shadow);
// TODO: If image is big and StreamSis window is close to the edge, Tooltip is hiding right
// after it is shown. Need to find workaround.
Tooltip fullPreviewTP = new Tooltip();
fullPreviewTP.setGraphic(imageView);
fullPreviewTP.setAnchorLocation(AnchorLocation.WINDOW_BOTTOM_LEFT);
// fullPreviewTP.setStyle("-fx-effect: dropshadow(three-pass-box, black, 10,0.5,0,0);");
Tooltip.install(nodeToHaveTooltip, fullPreviewTP);
}
GUIUtil.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:StreamSis
作者:
评论列表
文章目录