本文整理汇总了Java中javafx.scene.control.PopupControl类的典型用法代码示例。如果您正苦于以下问题:Java PopupControl类的具体用法?Java PopupControl怎么用?Java PopupControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PopupControl类属于javafx.scene.control包,在下文中一共展示了PopupControl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PreviewCodeAreaBind
import javafx.scene.control.PopupControl; //导入依赖的package包/类
public PreviewCodeAreaBind(CodeArea area) {
this.codeArea = area;
this.popup = new PopupControl();
this.contentPane = new AnchorPane();
this.canvas = new Canvas(width, height);
this.region = new Region();
this.svgPath = new SVGPath();
contentPane.setBorder(LayoutUtil.getSimpleBorder(Color.BLACK, line));
contentPane.setPrefWidth(width + 2 * line);
contentPane.setPrefHeight(height + 2 * line);
LayoutUtil.setAnchorZero(canvas);
LayoutUtil.setAnchorZero(svgPath);
LayoutUtil.setAnchorZero(region);
region.setPrefSize(width, height);
region.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)));
popup.setConsumeAutoHidingEvents(false);
popup.setAutoHide(true);
popup.setAutoFix(true);
popup.setHideOnEscape(true);
popup.getScene().setRoot(contentPane);
area.setPopupWindow(popup);
area.setPopupAlignment(PopupAlignment.CARET_BOTTOM);
DragSupport.bind(popup);
}
示例2: getPopup
import javafx.scene.control.PopupControl; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected PopupControl getPopup()
{
if (popup == null)
{
super.getPopup();
popup.addEventFilter(KeyEvent.KEY_PRESSED, this::onPopupKeyPressed);
}
return super.getPopup();
}
示例3: setPopupControl
import javafx.scene.control.PopupControl; //导入依赖的package包/类
public void setPopupControl(PopupControl pc) {
this.popupControl = pc;
}