Java Code Examples for javafx.stage.Stage#setY()

The following examples show how to use javafx.stage.Stage#setY() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReceptionistController.java    From HealthPlus with Apache License 2.0 8 votes vote down vote up
@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();
}
 
Example 2
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
/**
 *
 */
@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();
}
 
Example 3
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewDoctorAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("doctor",admin);
    
    ArrayList<ArrayList<String>> data = admin.getUserInfo("doctor");
    userAccounts.fillUserDetail(data);
    
    
    Scene scene = new Scene(userAccounts);
    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(); 
}
 
Example 4
Source File: NewDoctorTimeSlotController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 5
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewReceptionistAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("receptionist",admin);
    
    ArrayList<ArrayList<String>> data = admin.getUserInfo("receptionist");
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    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(); 
}
 
Example 6
Source File: DoctorController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@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();
}
 
Example 7
Source File: HostelProject.java    From Hostel-Management-System with MIT License 6 votes vote down vote up
@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();
}
 
Example 8
Source File: ReportsController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 9
Source File: PharmacistController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML private void addNewDrug()
{
    
    Stage stage= new Stage();
    AddNewDrugController addDrug = new AddNewDrugController(pharmacist,this);
    addDrug.loadGenericNames();
    Scene scene = new Scene(addDrug);
    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();

}
 
Example 10
Source File: ReadMessageController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 11
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewPharmacistAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("pharmacist",admin);
    ArrayList<ArrayList<String>> data = admin.getUserInfo("pharmacist");
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    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(); 
}
 
Example 12
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewCashierAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("cashier",admin);
    
    ArrayList<ArrayList<String>> data = admin.getUserInfo("cashier");
    System.out.println(data);
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    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(); 
}
 
Example 13
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewOnlineAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("",admin);
    
    ArrayList<ArrayList<String>> data = admin.getOnlineInfo();
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    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(); 
}
 
Example 14
Source File: CashierController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@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();
}
 
Example 15
Source File: StageControllerImpl.java    From scenic-view with GNU General Public License v3.0 6 votes vote down vote up
public void placeStage(final Stage stage) {
    if (targetWindow != null) {
        stage.setX(targetWindow.getX() + targetWindow.getWidth());
        stage.setY(targetWindow.getY());
        try {
            // Prevents putting the stage out of the screen
            final Screen primary = Screen.getPrimary();
            if (primary != null) {
                final Rectangle2D rect = primary.getVisualBounds();
                if (stage.getX() + stage.getWidth() > rect.getMaxX()) {
                    stage.setX(rect.getMaxX() - stage.getWidth());
                }
                if (stage.getY() + stage.getHeight() > rect.getMaxY()) {
                    stage.setX(rect.getMaxY() - stage.getHeight());
                }
            }
        } catch (final Exception e) {
            ExceptionLogger.submitException(e);
        }
    }
}
 
Example 16
Source File: UndecoratorController.java    From DevToolBox with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void restoreSavedBounds(Stage stage, boolean fullscreen) {
    stage.setX(savedBounds.getMinX());
    stage.setY(savedBounds.getMinY());
    stage.setWidth(savedBounds.getWidth());
    stage.setHeight(savedBounds.getHeight());
    savedBounds = null;
}
 
Example 17
Source File: BreakingNewsDemo.java    From htm.java-examples with GNU Affero General Public License v3.0 5 votes vote down vote up
public void showView(Stage stage) {
    Scene scene = new Scene(mainViewScroll, 1370, 1160, Color.WHITE);
    stage.setScene(scene);
    stage.setMinWidth(1370);
    stage.show();

    Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds();
    stage.setX((primScreenBounds.getWidth() - stage.getWidth()) / 2);
    stage.setY((primScreenBounds.getHeight() - stage.getHeight()) / 4);
}
 
Example 18
Source File: MainController.java    From MusicPlayer with MIT License 5 votes vote down vote up
private void createVolumePopup() {
	try {
		
		Stage stage = MusicPlayer.getStage();
    	FXMLLoader loader = new FXMLLoader(this.getClass().getResource(Resources.FXML + "VolumePopup.fxml"));
    	HBox view = loader.load();
    	volumePopupController = loader.getController();
    	Stage popup = new Stage();
    	popup.setScene(new Scene(view));
    	popup.initStyle(StageStyle.UNDECORATED);
    	popup.initOwner(stage);
    	popup.setX(stage.getWidth() - 270);
    	popup.setY(stage.getHeight() - 120);
    	popup.focusedProperty().addListener((x, wasFocused, isFocused) -> {
    		if (wasFocused && !isFocused) {
    			volumeHideAnimation.play();
    		}
    	});
    	volumeHideAnimation.setOnFinished(x -> popup.hide());
    	
    	popup.show();
    	popup.hide();
    	volumePopup = popup;
    	
	} catch (Exception ex) {
		
		ex.printStackTrace();
	}
}
 
Example 19
Source File: FxUtils.java    From stagedisplayviewer with MIT License 4 votes vote down vote up
public void startOnCorrectScreen(Stage stage) {
    Rectangle2D visualBounds = getScreen().getVisualBounds();
    stage.setX(visualBounds.getMinX() + 100);
    stage.setY(visualBounds.getMinY() + 100);
}
 
Example 20
Source File: LabAssistantController.java    From HealthPlus with Apache License 2.0 4 votes vote down vote up
public void showReport(String reportID)
{

        String type = "";
        ArrayList<ArrayList<String>> data = null;
        
        if ( reportID.substring(0,2).equals("ur") ) {
        
            data = lab.getUrineFullReport(reportID);
            type = "ur";
            
        } else if ( reportID.substring(0,2).equals("li") ) {
            
            data = lab.getLipidTestReport(reportID);
            type = "li";
            
        } else if ( reportID.substring(0,2).equals("bg") ) {
        
            data = lab.getBloodGroupingRh(reportID);
            type = "bg";
            
        } else if ( reportID.substring(0,3).equals("cbc") ) {
        
            data = lab.getCompleteBloodCount(reportID);
            type = "cbc";
            
        } else if ( reportID.substring(0,2).equals("lv") ) {
        
            data = lab.getLiverFunctionTest(reportID);
            type = "lv";
            
        } else if ( reportID.substring(0,2).equals("re") ) {
        
            data = lab.getRenalFunctionTest(reportID);
            type = "re";
            
        } else if ( reportID.substring(0,4).equals("scpt") ) {
        
            data = lab.getSeriumCreatinePhosphokinaseTotal(reportID);
            type = "scpt";
            
        } else if ( reportID.substring(0,3).equals("scp") ) {
        
            data = lab.getSeriumCreatinePhosphokinase(reportID);
            type = "scp";
            
        }     
        
        if (data.size() > 1){
            LabReportPreviewController preview = new LabReportPreviewController(lab);
            preview.setData(data,type);

            Stage stage = new Stage();
            Scene scene = new Scene(preview);
            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(); 
        } else {
            
            //showErrorPopup("No Report", appointmentIDtext);
        }

}