/** * * @param p */ static public void printHierarchy(Popup p) { StringBuilder lStringBuilder = new StringBuilder(); lStringBuilder.append("Popup (owner=" + p.getOwnerNode() + ")"); for (Object lChild : p.getContent()) { printHierarchy(lStringBuilder, (Node)lChild, 1); } if (lStringBuilder.length() > 0) { lStringBuilder.append("\n"); } System.out.println(lStringBuilder.toString()); }
private void hide(Popup popup, Pos p) { popup.hide(); removePopupFromMap(p, popup); }
@Override public void relocateInParent(double x, double y) { // this allows for us to slide the notification upwards switch (p) { case BOTTOM_LEFT: case BOTTOM_CENTER: case BOTTOM_RIGHT: popup.setAnchorY(y - padding); break; default: // no-op break; } } };
final Popup popup = new Popup(); popup.setAutoFix(false); popup.getContent().add(notificationBar); popup.show(owner, 0, 0); popup.setAnchorX(anchorX); popup.setAnchorY(anchorY);
popup.setHideOnEscape(true); popup.setOnHiding( windowEvent -> { hide(); }); popup.getContent().add(circularPane); popup.hide(); });
final double newPopupHeight = changedPopup.getContent().get(0).getBoundsInParent().getHeight(); Popup _popup = popups.get(i); final double popupHeight = _popup.getContent().get(0).getBoundsInParent().getHeight(); } else { if (i == popups.size() - 1) { sum = changedPopup.getAnchorY() - popupHeight; } else { sum -= popupHeight; final double anchorYTarget = targetAnchors[i]; if(anchorYTarget < 0){ _popup.hide(); final double oldAnchorY = _popup.getAnchorY(); final double distance = anchorYTarget - oldAnchorY;
/** * * @param x origin of the circle * @param y origin of the circle */ public void show(double x, double y) { // show popup popup.show(node, x - (circularPane.prefWidth(-1) / 2), y - (circularPane.prefHeight(-1) / 2)); // animated pane in circularPane.animateIn(); // set status setShown(true); }
protected void assertPopupIsNotVisible(Node ownedBy) { TestUtil.waitForPaintPulse(); for (Window w : listWindows() ) { if (w instanceof Popup) { Popup lPopup = (Popup)w; if (ownedBy.equals(lPopup.getOwnerNode())) { throw new IllegalStateException("Popup is visible (and should not be), owner = " + lPopup.getOwnerNode()); } } } }
protected void assertPopupIsVisible(Node ownedBy) { TestUtil.waitForPaintPulse(); for (Window w : listWindows() ) { if (w instanceof Popup) { Popup lPopup = (Popup)w; if (ownedBy.equals(lPopup.getOwnerNode())) { return; } } } throw new IllegalStateException("Popup is not visible (and should be)"); }
protected void forceCloseAllPopups() { TestUtil.waitForPaintPulse(); for (Window w : listWindows() ) { if (w instanceof Popup) { Popup lPopup = (Popup)w; System.out.println("force closing popup: " + lPopup); TestUtil.runThenWaitForPaintPulse( () -> { lPopup.hide(); }); } } }
@Override protected void interpolate(double frac) { Popup popup = popupWeakReference.get(); if (popup != null) { double newAnchorY = oldAnchorY + distance * frac; popup.setAnchorY(newAnchorY); } }