Java 类javafx.stage.Screen 实例源码

项目:stvs    文件:StvsPreloader.java   
@Override
public void start(Stage stage) {
  this.stage = stage;

  stage.initStyle(StageStyle.TRANSPARENT);

  VBox box = new VBox(20);
  box.setMaxWidth(Region.USE_PREF_SIZE);
  box.setMaxHeight(Region.USE_PREF_SIZE);
  box.setBackground(Background.EMPTY);
  String style = "-fx-background-color: rgba(255, 255, 255, 0.5);";
  box.setStyle(style);

  box.setPadding(new Insets(50));
  BorderPane root = new BorderPane(box);
  root.setStyle(style);
  root.setBackground(Background.EMPTY);
  Scene scene = new Scene(root);
  scene.setFill(Color.TRANSPARENT);
  stage.setScene(scene);

  ImageView splashView = new ImageView(splashImage);
  box.getChildren().addAll(splashView, new Label("ST Verification Studio is loading.."));
  stage.show();
  Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds();
  stage.setX((primScreenBounds.getWidth() - stage.getWidth()) / 2);
  stage.setY((primScreenBounds.getHeight() - stage.getHeight()) / 2);
}
项目:Mafia-TCoS-CS319-Group2A    文件:Main.java   
@Override
public void start(Stage primaryStage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("menuSample.fxml"));
    primaryStage.setTitle("Hello World");

    Screen screen = Screen.getPrimary();
    Rectangle2D bounds = screen.getVisualBounds();
    primaryStage.setX(bounds.getMinX());
    primaryStage.setY(bounds.getMinY());
    primaryStage.setWidth(bounds.getWidth());
    primaryStage.setHeight(bounds.getHeight());
    primaryStage.setMaximized(true);
    Scene menuScene = new Scene(root, 1080, 720);
    //primaryStage.setFullScreen(true);
    primaryStage.setScene(menuScene);


    //primaryStage.setFullScreen(true);
    primaryStage.show();
}
项目:ChessBot    文件:ChessBotAppSplash.java   
private void showSplash(final Stage initStage, Task<?> task, InitCompletionHandler initCompletionHandler) {
    progressText.textProperty().bind(task.messageProperty());
    loadProgress.progressProperty().bind(task.progressProperty());
    task.stateProperty().addListener((observableValue, oldState, newState) -> {
        if (newState == Worker.State.SUCCEEDED) {
            loadProgress.progressProperty().unbind();
            loadProgress.setProgress(1);
            initStage.toFront();
            FadeTransition fadeSplash = new FadeTransition(Duration.seconds(1.2), splashLayout);
            fadeSplash.setFromValue(1.0);
            fadeSplash.setToValue(0.0);
            fadeSplash.setOnFinished(actionEvent -> initStage.hide());
            fadeSplash.play();

            initCompletionHandler.complete();
        }
    });

    Scene splashScene = new Scene(splashLayout);
    initStage.initStyle(StageStyle.UNDECORATED);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();
    initStage.setScene(splashScene);
    initStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - SPLASH_WIDTH / 2);
    initStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - SPLASH_HEIGHT / 2);
    initStage.show();
}
项目:CapsLock    文件:OverLayWindow.java   
void Exe(int i) {
    if(i==1) {
        warnmesse="プレイ開始から5分経過しました\n混雑している場合は次の人に\n交代してください";
        fontsize=25;
    }else if(i==2) {
        warnmesse="プレイ開始から10分経過しました\n混雑している場合は次の人に\n交代してください";
        fontsize=25;
    }else if(i==-1) {
        warnmesse="user timer is reset";
        fontsize=35;
    }

    final Stage primaryStage = new Stage(StageStyle.TRANSPARENT);
    primaryStage.initModality(Modality.NONE);
    final StackPane root = new StackPane();

    final Scene scene = new Scene(root, 350, 140);
    scene.setFill(null);

    final Label label = new Label(warnmesse);
    label.setFont(new Font("Arial", fontsize));
    BorderPane borderPane = new BorderPane();
    borderPane.setCenter(label);
    borderPane.setStyle("-fx-background-radius: 10;-fx-background-color: rgba(0,0,0,0.3);");

    root.getChildren().add(borderPane);

    final Rectangle2D d = Screen.getPrimary().getVisualBounds();
    primaryStage.setScene(scene);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.setX(d.getWidth()-350);
    primaryStage.setY(d.getHeight()-300);

    primaryStage.show();

    final Timeline timer = new Timeline(new KeyFrame(Duration.seconds(CLOSE_SECONDS), (ActionEvent event) -> primaryStage.close()));
    timer.setCycleCount(Timeline.INDEFINITE);
    timer.play();
}
项目:Conan    文件:InferenceRuleView.java   
/**
 * Adds the content for showing the inference rules to the TabPane in the proof
 * @param tabPane
 *
 */
public InferenceRuleView(TabPane tabPane) {


    //load the image
    Image image = new Image("inferenceRules.png");
    ImageView iv1 = new ImageView();
    iv1.setImage(image);
    iv1.setSmooth(true);
    iv1.setPreserveRatio(true);

    //putting the image on a scrollpane
    ScrollPane sp=new ScrollPane();
    sp.getStyleClass().add("rulesView");
    tab = new ViewTab("Inference Rules",this);
    sp.setContent(iv1);
    tabPane.getTabs().add(tab);
    tab.setContent(sp);
    tabPane.getSelectionModel().select(tab);

    //used for getting screensize
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //Avoids scaling too much
    double w=primaryScreenBounds.getWidth()/2;
    iv1.setFitWidth(w);
}
项目:Conan    文件:ShortcutsView.java   
/**
 * Adds the content for showing the shortcuts to the TabPane in the proof
 * @param tabPane
 *
 */
public ShortcutsView(TabPane tabPane) {

    Label label = new Label(loadInstructions());
    label.getStyleClass().add("infoText");

    //putting the image on a scrollpane
    ScrollPane sp = new ScrollPane();
    sp.getStyleClass().add("shortcutsView");
    tab = new ViewTab("Shortcuts",this);
    sp.setContent(label);
    tabPane.getTabs().add(tab);
    tab.setContent(sp);
    tabPane.getSelectionModel().select(tab);

    //used for getting screensize
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //Avoids scaling too much
    double w=primaryScreenBounds.getWidth();
    label.setPrefWidth(w); 
}
项目:Conan    文件:ParseInfoView.java   
/**
 * Adds the content for showing the parser info to the TabPane
 * @param tabPane
 *
 */
public ParseInfoView(TabPane tabPane) {

    Label label = new Label(loadInstructions());
    label.getStyleClass().add("infoText");

    //putting the image on a scrollpane
    ScrollPane sp = new ScrollPane();
    sp.getStyleClass().add("rulesView");
    tab = new ViewTab("Input format",this);
    sp.setContent(label);
    tabPane.getTabs().add(tab);
    tab.setContent(sp);
    tabPane.getSelectionModel().select(tab);

    //used for getting screensize
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //Avoids scaling too much
    double w=primaryScreenBounds.getWidth();
    label.setPrefWidth(w); 
}
项目:lttng-scope    文件:JfxUtils.java   
/**
     * Utility method to center a Dialog/Alert on the middle of the current
     * screen. Used to workaround a "bug" with the current version of JavaFX (or
     * the SWT/JavaFX embedding?) where alerts always show on the primary
     * screen, not necessarily the current one.
     *
     * @param dialog
     *            The dialog to reposition. It must be already shown, or else
     *            this will do nothing.
     * @param referenceNode
     *            The dialog should be moved to the same screen as this node's
     *            window.
     */
    public static void centerDialogOnScreen(Dialog<?> dialog, Node referenceNode) {
        Window window = referenceNode.getScene().getWindow();
        if (window == null) {
            return;
        }
        Rectangle2D windowRectangle = new Rectangle2D(window.getX(), window.getY(), window.getWidth(), window.getHeight());

        List<Screen> screens = Screen.getScreensForRectangle(windowRectangle);
        Screen screen = screens.stream()
                .findFirst()
                .orElse(Screen.getPrimary());

        Rectangle2D screenBounds = screen.getBounds();
        dialog.setX((screenBounds.getWidth() - dialog.getWidth()) / 2 + screenBounds.getMinX());
//        dialog.setY((screenBounds.getHeight() - dialog.getHeight()) / 2 + screenBounds.getMinY());
    }
项目:marathonv5    文件:DisplayWindow.java   
public ControllerStage(DisplayWindow stage) {
    this.displayWindow = stage;
    setTitle("Marathon Control Center");
    getIcons().add(FXUIUtils.getImageURL("logo16"));
    getIcons().add(FXUIUtils.getImageURL("logo32"));
    initComponents();
    setScene(new Scene(content));
    setAlwaysOnTop(true);
    setOnShown((e) -> {
        Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
        setX(screenBounds.getWidth() - getWidth());
        setY(0);
    });
    sizeToScene();
    setResizable(false);
    setOnCloseRequest(e -> displayWindow.onStop());
}
项目:MineIDE    文件:MineIDEPreloader.java   
@Override
public void start(final Stage primaryStage) throws Exception
{

    this.preloaderStage = primaryStage;

    final ImageView splash = new ImageView(new Image(Constant.IMG_DIR + "banner.png"));

    this.loadProgressPhase = new JFXProgressBar();
    this.loadProgressPhase.setPrefWidth(Constant.SPLASH_WIDTH);

    this.splashLayout = new VBox();
    this.splashLayout.getChildren().addAll(splash, this.loadProgressPhase);

    this.splashLayout.setStyle("-fx-padding: 5; " + "-fx-background-color: gainsboro; " + "-fx-border-width:2; "
            + "-fx-border-color: " + "linear-gradient(" + "to bottom, " + "MediumSeaGreen, "
            + "derive(MediumSeaGreen, 50%)" + ");");
    this.splashLayout.setEffect(new DropShadow());

    final Scene splashScene = new Scene(this.splashLayout, Color.TRANSPARENT);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();

    primaryStage.setScene(splashScene);
    primaryStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - Constant.SPLASH_WIDTH / 2);
    primaryStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - Constant.SPLASH_HEIGHT / 2);
    primaryStage.getIcons().add(new Image(Constant.IMG_DIR + "icon.png"));
    primaryStage.setTitle(Constant.APP_NAME);

    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.show();

}
项目:util4j    文件:Game2048.java   
/**
 *
 * @param primaryStage
 */
@Override
public void start(Stage primaryStage) {
    gameManager = new GameManager();
    gameBounds = gameManager.getLayoutBounds();

    StackPane root = new StackPane(gameManager);
    root.getStyleClass().addAll("game-root");
    ChangeListener<Number> resize = (ov, v, v1) -> {
        double scale = Math.min((root.getWidth() - MARGIN) / gameBounds.getWidth(), (root.getHeight() - MARGIN) / gameBounds.getHeight());
        gameManager.setScale(scale);
        gameManager.setLayoutX((root.getWidth() - gameBounds.getWidth()) / 2d);
        gameManager.setLayoutY((root.getHeight() - gameBounds.getHeight()) / 2d);
    };
    root.widthProperty().addListener(resize);
    root.heightProperty().addListener(resize);

    Scene scene = new Scene(root);
    scene.getStylesheets().add(CSS);
    addKeyHandler(scene);
    addSwipeHandlers(scene);

    if (isARMDevice()) {
        primaryStage.setFullScreen(true);
        primaryStage.setFullScreenExitHint("");
    }

    if (Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
        scene.setCursor(Cursor.NONE);
    }

    Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
    double factor = Math.min(visualBounds.getWidth() / (gameBounds.getWidth() + MARGIN),
            visualBounds.getHeight() / (gameBounds.getHeight() + MARGIN));
    primaryStage.setTitle("2048FX");
    primaryStage.setScene(scene);
    primaryStage.setMinWidth(gameBounds.getWidth() / 2d);
    primaryStage.setMinHeight(gameBounds.getHeight() / 2d);
    primaryStage.setWidth((gameBounds.getWidth() + MARGIN) * factor);
    primaryStage.setHeight((gameBounds.getHeight() + MARGIN) * factor);
    primaryStage.show();
}
项目:GazePlay    文件:SecondScreen.java   
public static SecondScreen launch() {

        ObservableList<Screen> screens = Screen.getScreens();

        if (screens.size() < 2)
            return null;

        Screen screen1 = screens.get(0);
        Screen screen2 = screens.get(1);
        log.info("screen1.getBounds() = " + screen1.getBounds());
        log.info("screen2.getBounds() = " + screen2.getBounds());
        Stage stage2 = new Stage();
        stage2.setScene(new Scene(new Label("primary")));
        stage2.setX(screen2.getVisualBounds().getMinX());
        stage2.setY(screen2.getVisualBounds().getMinY());
        stage2.setWidth(screen1.getBounds().getWidth());
        stage2.setHeight(screen1.getBounds().getHeight());
        Group root = new Group();
        Scene scene = new Scene(root, screen1.getBounds().getWidth(), screen1.getBounds().getHeight(), Color.BLACK);

        makeLighting(root, screen2.getBounds());

        stage2.setScene(scene);

        stage2.show();

        SecondScreen sc = new SecondScreen();

        Configuration config = ConfigurationBuilder.createFromPropertiesResource().build();

        /*
         * if (config.eyetracker.equals("tobii")) Tobii.execProg(sc); else
         */
        if (config.isGazeMode())
            gazeListener = new EyeTribeGazeListener(sc);
        else
            gazeListener = new FuzzyGazeListener(sc);

        return sc;
    }
项目:Clipcon-Client    文件:MainScene.java   
/** Show progress bar */
public void showProgressBar() {
    Platform.runLater(() -> {
        try {
            Parent toProgressBar = FXMLLoader.load(getClass().getResource("/view/ProgressBar.fxml"));
            Scene scene = new Scene(toProgressBar);
            scene.getStylesheets().add("resources/myprogressbar.css");
            progressBarStage = new Stage();

            int progressBarIndex = ProgressBarScene.getIndex();

            progressBarStage.initStyle(StageStyle.TRANSPARENT);
            progressBarStage.setScene(scene);
            progressBarStage.getIcons().add(new javafx.scene.image.Image("resources/Logo.png"));
            progressBarStage.initModality(Modality.WINDOW_MODAL);
            progressBarStage.show();
            progressBarStage.setX(Screen.getPrimary().getBounds().getWidth() - progressBarStage.getWidth() - 10);
            progressBarStage.setY(Screen.getPrimary().getBounds().getHeight() - progressBarStage.getHeight() - 50 - progressBarIndex * 55);

            progressBarStageArray[progressBarIndex] = progressBarStage;
        } catch (Exception e) {
            e.printStackTrace();
        }
    });
}
项目:JHosts    文件:Main.java   
@Override
public void start(Stage stage) throws Exception {
    Flow flow = new Flow(MainController.class);
    DefaultFlowContainer container = new DefaultFlowContainer();
    flowContext = new ViewFlowContext();
    flowContext.register("Stage", stage);
    flow.createHandler(flowContext).start(container);

    JFXDecorator decorator = new JFXDecorator(stage, container.getView());
    decorator.setCustomMaximize(true);

    double width = 700;
    double height = 200;
    try {
        Rectangle2D bounds = Screen.getScreens().get(0).getBounds();
        width = bounds.getWidth() / 2.5;
        height = bounds.getHeight() / 1.35;
    } catch (Exception e) {
    }

    Scene scene = new Scene(decorator, width, height);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(Main.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
            Main.class.getResource("/css/jfoenix-design.css").toExternalForm(),
            Main.class.getResource("/css/jhosts-main.css").toExternalForm());
    stage.setScene(scene);
    stage.show();
}
项目:Higher-Cloud-Computing-Project    文件:Main.java   
@Override
    public void start(Stage primaryStage) throws Exception{
        FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(getClass().getResource("sample.fxml"));
        Parent root = fxmlLoader.load();
        Screen screen = Screen.getPrimary ();

//        界面初始化
        Controller controller = fxmlLoader.getController();
        controller.init(primaryStage);

        Rectangle2D bounds = screen.getVisualBounds ();

        double minX = bounds.getMinX ();
        double minY = bounds.getMinY ();
        double maxX = bounds.getMaxX ();
        double maxY = bounds.getMaxY ();

        screenWidth = maxX - minX;
        screenHeight = maxY - minY;

        Scene scene = new Scene(root, (maxX - minX) * 0.6, (maxY - minY) * 0.6);

        primaryStage.setTitle ("Higher Cloud Compute Platform");
        primaryStage.setScene (scene);
        primaryStage.setFullScreen(true);
        primaryStage.show ();

    }
项目:DeskChan    文件:OverlayStage.java   
static Rectangle2D getDesktopSize() {
    Rectangle2D rect = Screen.getPrimary().getBounds();
    double minX = rect.getMinX(), minY = rect.getMinY();
    double maxX = rect.getMaxX(), maxY = rect.getMaxY();
    for (Screen screen : Screen.getScreens()) {
        Rectangle2D screenRect = screen.getBounds();
        if (minX > screenRect.getMinX()) {
            minX = screenRect.getMinX();
        }
        if (minY > screenRect.getMinY()) {
            minY = screenRect.getMinY();
        }
        if (maxX < screenRect.getMaxX()) {
            maxX = screenRect.getMaxX();
        }
        if (maxY < screenRect.getMaxY()) {
            maxY = screenRect.getMaxY();
        }
    }
    return new Rectangle2D(minX, minY, maxX - minX, maxY - minY);
}
项目:Hostel-Management-System    文件:HostelProject.java   
@Override
public void start(Stage stage) throws SQLException, IOException
{
    Parent root = FXMLLoader.load(getClass().getResource("MainScene.fxml"));
    scene = new Scene(root);
    Screen screen = Screen.getPrimary();
    Rectangle2D bounds = screen.getVisualBounds();
    Image ico=new Image("file:///D:/Study/Java/HostelProjecttest/src/hostelproject/media/net.png");
    stage.setTitle("Banda Singh Bahadur Boys Hostel");
    stage.getIcons().add(ico);
    stage.setX(bounds.getMinX());
    stage.setY(bounds.getMinY());
    stage.setWidth(bounds.getWidth());
    stage.setHeight(bounds.getHeight());
    stage.setScene(scene);
    stage.show();
}
项目:project-cars-replay-enhancer-ui    文件:ConfigurationEditor.java   
@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("ConfigurationEditor.fxml"));
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();

    Scene scene = new Scene(root);

    stage.setScene(scene);
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.show();

    if (stage.getHeight() > primaryScreenBounds.getHeight()) {
        stage.setHeight(primaryScreenBounds.getHeight() * .90);
    }

    if (stage.getWidth() > primaryScreenBounds.getWidth()) {
        stage.setWidth(primaryScreenBounds.getWidth() * .90);
    }

    stage.setTitle("Project CARS Replay Enhancer Configuration Editor");
}
项目:project-cars-replay-enhancer-ui    文件:PacketCapture.java   
@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("PacketCapture.fxml"));
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();

    Scene scene = new Scene(root);

    stage.setScene(scene);
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.show();
    stage.setMinWidth(stage.getWidth());
    stage.setMaxWidth(stage.getWidth());
    stage.setMinHeight(stage.getHeight());
    stage.setMaxHeight(stage.getHeight());
    stage.setTitle("Packet Capture");
}
项目:Gargoyle    文件:DockNode.java   
@Override
protected void invalidated() {
    DockNode.this.pseudoClassStateChanged(MAXIMIZED_PSEUDO_CLASS, get());
    if (borderPane != null) {
        borderPane.pseudoClassStateChanged(MAXIMIZED_PSEUDO_CLASS, get());
    }

    stage.setMaximized(get());

    // TODO: This is a work around to fill the screen bounds and not overlap the task bar when
    // the window is undecorated as in Visual Studio. A similar work around needs applied for
    // JFrame in Swing. http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4737788
    // Bug report filed:
    // https://bugs.openjdk.java.net/browse/JDK-8133330
    if (this.get()) {
        Screen screen = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight()).get(0);
        Rectangle2D bounds = screen.getVisualBounds();

        stage.setX(bounds.getMinX());
        stage.setY(bounds.getMinY());

        stage.setWidth(bounds.getWidth());
        stage.setHeight(bounds.getHeight());
    }
}
项目:javaone2016    文件:OTNPreloader.java   
@Override
public void start(Stage primaryStage) throws Exception {
    stage = primaryStage;

    Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
    double width = IS_DESKTOP ? 350 : visualBounds.getWidth();
    double height = IS_DESKTOP ? 700 : visualBounds.getHeight();

    ImageView imageView = new ImageView(OTNPreloader.class.getResource("preload_small.png").toExternalForm());
    imageView.setPreserveRatio(true);
    imageView.setFitWidth(width * 0.50);

    StackPane stackPane = new StackPane(imageView);
    stackPane.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)));

    Scene scene = new Scene(stackPane, width, height);

    stage.setScene(scene);
    stage.show();
}
项目:HealthPlus    文件:DoctorController.java   
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:DoctorController.java   
@FXML private void addTimeSlot()
{
    Stage stage= new Stage();
    NewDoctorTimeSlotController addslot = new NewDoctorTimeSlotController(doc,this);
    Scene scene = new Scene(addslot);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();        


}
项目:HealthPlus    文件:NewDoctorTimeSlotController.java   
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:ReceptionistController.java   
@FXML private void showAppointments()
{
    Stage stage= new Stage();
    AllAppointmentsController app = new AllAppointmentsController(receptionist);
    app.load();
    Scene scene = new Scene(app);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();

}
项目:HealthPlus    文件:ReceptionistController.java   
@FXML
public void showAppointmentSuccessIndicator(String patientId, String consult, String appDate, String appId)
{
    Stage stage= new Stage();
    AppointmentSuccessController success = new AppointmentSuccessController();

    success.fillAppointmentData(patientId,consult,appDate,appId);

    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:ReceptionistController.java   
@FXML
public void showPatientAccountSuccessIndicator(String patientId, String pName, String pMobile, String pGender)
{
    Stage stage= new Stage();
    PatientAccountSuccessController success = new PatientAccountSuccessController();

    success.fillPatientData( patientId, pName, pMobile, pGender);

    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:ReceptionistController.java   
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:LabAssistantController.java   
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:CashierController.java   
@FXML
public void showRefundTable()
{
    Stage stage= new Stage();
    RefundController refundTable = new RefundController(this);

    refundTable.fillRefundTable();

    Scene scene = new Scene(refundTable);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();

}
项目:HealthPlus    文件:CashierController.java   
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:LoginController.java   
public void loadDoctor(String username)
{
    Stage stage = new Stage();
    DoctorController doctor = new DoctorController(username);

    doctor.fillAreaChart();
    doctor.setAppointments();
    doctor.loadProfileData(); 
    doctor.MakeAvailabilityTable();
    doctor.loadDrugList();
    doctor.loadTestList();
    doctor.setPaceholders();
    doctor.addFocusListener();
    doctor.loadNameList();

    stage.setScene(new Scene(doctor));

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:LoginController.java   
public void loadPharmacist(String username)
{
    Stage stage = new Stage();
    PharmacistController pharmacist = new PharmacistController(username);

    pharmacist.loadProfileData(); 
    pharmacist.makeStockTable();
    pharmacist.fillBarChart();
    pharmacist.fillPieChart();
    pharmacist.setPaceholders();
    pharmacist.loadNameList();
    pharmacist.addFocusListener();

    stage.setScene(new Scene(pharmacist));

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:LoginController.java   
public void loadReceptionist(String username)
{
    Stage stage = new Stage();
    ReceptionistController receptionist = new ReceptionistController(username);

    receptionist.loadProfileData(); 
    receptionist.makeSummaryTable();
    receptionist.fillLineChart();
    receptionist.fillCurrentDoctors();
    //receptionist.fillConsultationAreas();
    receptionist.setPaceholders();
    stage.setScene(new Scene(receptionist));

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:LoginController.java   
public void loadCashier(String username)
{
    Stage stage = new Stage();
    CashierController cashier = new CashierController(username);

    cashier.loadProfileData(); 
    cashier.makeHistoryTable();
    cashier.fillLineChart();
    cashier.setPaceholders();
    cashier.loadNameList();
    cashier.addFocusListener();
    cashier.loadRefunds();

    stage.setScene(new Scene(cashier));

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:LoginController.java   
public void loadLabAssistant(String username)
{
    Stage stage = new Stage();
    LabAssistantController lab = new LabAssistantController(username);
    lab.loadProfileData(); 
    lab.fillPieChart();
    lab.setAppointments();
    lab.fillLabAppiontments();
    lab.addFocusListener();
    lab.setPaceholders();
    lab.fillTodayAppointments();

    stage.setScene(new Scene(lab));

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:LogoutController.java   
@FXML
private void logout()
{

    user.saveLogout(user.username);

    Stage stage = (Stage) mainLogoutButton.getScene().getWindow();
    stage.close();

    stage = (Stage) cancelButton.getScene().getWindow();
    stage.close();

    LoginController login = new LoginController();
    stage.setScene(new Scene(login));
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    //stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
项目:HealthPlus    文件:AllMessagesController.java   
@FXML private void showMessage()
{
    AllMessages message = (AllMessages)messagesTable.getSelectionModel().getSelectedItem();
    //System.out.println(message.getMessage());

    Stage stage= new Stage();
    ReadMessageController newMessage = new ReadMessageController(message,newSysUser);
    newMessage.fillMessage();
    Scene scene = new Scene(newMessage);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();   

}
项目:HealthPlus    文件:NewMessageController.java   
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
项目:HealthPlus    文件:ReadMessageController.java   
@FXML private void reply()
{
    Stage stage2; 
    stage2 = (Stage) close.getScene().getWindow();
    stage2.close();

    Stage stage= new Stage();
    NewMessageController newMessage = new NewMessageController(newSysUser);
    System.out.println(msgID.getText());
    newMessage.load(msgID.getText());
    Scene scene = new Scene(newMessage);
    stage.setScene(scene);

    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());

    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();   

}