Java 类javafx.scene.control.PopupControl 实例源码

项目:CSS-Editor-FX    文件:PreviewCodeAreaBind.java   
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);
}
项目:CSS-Editor-FX    文件:PreviewCodeAreaBind.java   
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);
}
项目:JVx.javafx    文件:FXCustomComboBoxSkin.java   
/**
 * {@inheritDoc}
 */
@Override
protected PopupControl getPopup()
{
    if (popup == null)
    {
        super.getPopup();

        popup.addEventFilter(KeyEvent.KEY_PRESSED, this::onPopupKeyPressed);
    }

    return super.getPopup();
}
项目:JFoenix    文件:JFXColorPalette.java   
public void setPopupControl(PopupControl pc) {
    this.popupControl = pc;
}