当前位置: 首页>>代码示例>>Java>>正文


Java Screen类代码示例

本文整理汇总了Java中javafx.stage.Screen的典型用法代码示例。如果您正苦于以下问题:Java Screen类的具体用法?Java Screen怎么用?Java Screen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Screen类属于javafx.stage包,在下文中一共展示了Screen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.stage.Screen; //导入依赖的package包/类
@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);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:29,代码来源:StvsPreloader.java

示例2: start

import javafx.stage.Screen; //导入依赖的package包/类
@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();
}
 
开发者ID:gokcan,项目名称:Mafia-TCoS-CS319-Group2A,代码行数:21,代码来源:Main.java

示例3: Exe

import javafx.stage.Screen; //导入依赖的package包/类
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();
}
 
开发者ID:chrootRISCassembler,项目名称:CapsLock,代码行数:40,代码来源:OverLayWindow.java

示例4: start

import javafx.stage.Screen; //导入依赖的package包/类
@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();

}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:34,代码来源:MineIDEPreloader.java

示例5: showSplash

import javafx.stage.Screen; //导入依赖的package包/类
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();
}
 
开发者ID:mhusam,项目名称:ChessBot,代码行数:27,代码来源:ChessBotAppSplash.java

示例6: showAppointments

import javafx.stage.Screen; //导入依赖的package包/类
@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();

}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:22,代码来源:ReceptionistController.java

示例7: showAppointmentSuccessIndicator

import javafx.stage.Screen; //导入依赖的package包/类
@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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:24,代码来源:ReceptionistController.java

示例8: showPatientAccountSuccessIndicator

import javafx.stage.Screen; //导入依赖的package包/类
@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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:24,代码来源:ReceptionistController.java

示例9: showSuccessIndicator

import javafx.stage.Screen; //导入依赖的package包/类
@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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:21,代码来源:ReceptionistController.java

示例10: loadDoctor

import javafx.stage.Screen; //导入依赖的package包/类
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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:27,代码来源:LoginController.java

示例11: loadCashier

import javafx.stage.Screen; //导入依赖的package包/类
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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:25,代码来源:LoginController.java

示例12: loadLabAssistant

import javafx.stage.Screen; //导入依赖的package包/类
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();
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:24,代码来源:LoginController.java

示例13: InferenceRuleView

import javafx.stage.Screen; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:nonilole,项目名称:Conan,代码行数:31,代码来源:InferenceRuleView.java

示例14: ShortcutsView

import javafx.stage.Screen; //导入依赖的package包/类
/**
 * 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); 
}
 
开发者ID:nonilole,项目名称:Conan,代码行数:26,代码来源:ShortcutsView.java

示例15: ParseInfoView

import javafx.stage.Screen; //导入依赖的package包/类
/**
 * 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); 
}
 
开发者ID:nonilole,项目名称:Conan,代码行数:26,代码来源:ParseInfoView.java


注:本文中的javafx.stage.Screen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。