Package javafx.stage

Examples of javafx.stage.Popup


 
  protected void assertPopupIsNotVisible(Node ownedBy) {
    TestUtil.waitForPaintPulse();
    for (Window w : getWindows() ) {
      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());
        }
      }
    }
  }
View Full Code Here


 
  protected void assertPopupIsVisible(Node ownedBy) {
    TestUtil.waitForPaintPulse();
    for (Window w : getWindows() ) {
      if (w instanceof Popup) {
        Popup lPopup = (Popup)w;
        if (ownedBy.equals(lPopup.getOwnerNode())) {
          return;
        }
      }
    }
    throw new IllegalStateException("Popup is not visible (and should be)");
View Full Code Here

    hL.endXProperty().bind(localRadius.multiply(2));

    // Adding all parts in a container.
    mainContent.getChildren().addAll(frame, viewer, vL, hL);

    final Popup popUp = new Popup();
    popUp.getContent().add(mainContent);

    final EventHandler<MouseEvent> enteredEvent = new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent e) {
        popUp.show(getSkinnable(), e.getScreenX() - shift, e.getScreenY() - shift);
        takeSnap(e.getX(), e.getY());
      }
    };
    final EventHandler<MouseEvent> exitedEvent = new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent e) {
        popUp.hide();
      }
    };
    final EventHandler<MouseEvent> movedEvent = new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent e) {
        final double r = localRadius.get();
        final double s = localScaleFactor.get();
        if (e.getSceneX() > (scene.getWidth() - (2 * r))) {
          popUp.setX(e.getScreenX() - (2 * r) - shift);
        } else {
          popUp.setX(e.getScreenX() - shift);
        }

        if (e.getSceneY() > (scene.getHeight() - (2 * r))) {
          popUp.setY(e.getScreenY() - (2 * r) - shift);
        } else {
          popUp.setY(e.getScreenY() - shift);
        }
        prevX.set(e.getX());
        prevY.set(e.getY());
        shiftViewerContent(prevX.get(), prevY.get(), r, s);
      }
View Full Code Here

      final StackPane cont = new StackPane();
      cont.setMaxWidth(275);
      cont.getStyleClass().add("doc-tool-tip");
      cont.getChildren().add(tooltipText);

      final Popup popup = new Popup();
      popup.setAutoHide(true);
      popup.setAutoFix(true);
      popup.setHideOnEscape(true);
      popup.getContent().add(cont);
      tooltipPopup = popup;
    }
    return tooltipPopup;
  }
View Full Code Here

            }
        }
    }

    private Popup createPopup(final String INFO_TEXT) {
        Popup popup = new Popup();
        popup.setAutoHide(true);
        popup.setAutoFix(true);
        popup.setHideOnEscape(true);

        popup.getContent().setAll(createPopupContent(INFO_TEXT));

        return popup;
    }
View Full Code Here

    public void start(Stage stage) {
        StyleClassedTextArea area = new StyleClassedTextArea();
        area.setWrapText(true);
        area.appendText("Pause the mouse over the text for 1 second.");

        Popup popup = new Popup();
        Label popupMsg = new Label();
        popupMsg.setStyle(
                "-fx-background-color: black;" +
                "-fx-text-fill: white;" +
                "-fx-padding: 5;");
        popup.getContent().add(popupMsg);

        area.setMouseOverTextDelay(Duration.ofSeconds(1));
        area.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_BEGIN, e -> {
            int chIdx = e.getCharacterIndex();
            Point2D pos = e.getScreenPosition();
            popupMsg.setText("Character '" + area.getText(chIdx, chIdx+1) + "' at " + pos);
            popup.show(area, pos.getX(), pos.getY() + 10);
        });
        area.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_END, e -> {
            popup.hide();
        });

        Scene scene = new Scene(area, 600, 400);
        stage.setScene(scene);
        stage.setTitle("Tooltip Demo");
View Full Code Here

    @Override
    public void start(Stage primaryStage) {
        InlineCssTextArea area = new InlineCssTextArea("Hello popup!");
        area.setWrapText(true);

        Popup popup = new Popup();
        popup.getContent().add(new Button("I am a popup button!"));
        area.setPopupWindow(popup);
        area.setPopupAlignment(PopupAlignment.SELECTION_BOTTOM_CENTER);
        area.setPopupAnchorOffset(new Point2D(4, 4));

        primaryStage.setScene(new Scene(new StackPane(area), 200, 200));
        primaryStage.setTitle("Popup Demo");
        primaryStage.show();
        popup.show(primaryStage);
    }
View Full Code Here

            }
        });
    }

    protected void createPopup() {
        popup = new Popup();
        popup.getContent().add(fxForm);
        fxForm.getStyleClass().add("popup-form");
        popup.setAutoHide(true);
        popup.setHideOnEscape(true);
        popup.setAutoFix(true);
View Full Code Here

TOP

Related Classes of javafx.stage.Popup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.