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


Java BorderPane.setStyle方法代码示例

本文整理汇总了Java中javafx.scene.layout.BorderPane.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java BorderPane.setStyle方法的具体用法?Java BorderPane.setStyle怎么用?Java BorderPane.setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.BorderPane的用法示例。


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

示例1: start

import javafx.scene.layout.BorderPane; //导入方法依赖的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: Exe

import javafx.scene.layout.BorderPane; //导入方法依赖的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

示例3: constructContentPane

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override
public JFXMasonryPane constructContentPane()
{
    JFXMasonryPane pane = new JFXMasonryPane();

    for (Profile fav : curProfile.getAllFavourites())
    {
        BorderPane tile = new BorderPane();
        tile.setStyle("-fx-background-color: #d3ecff;");

        ImageView profilePicView = new ImageView(fav.getProfileImg());
        profilePicView.setFitHeight(GUIConstants.PROFILE_HEIGHT / 1.5);
        profilePicView.setFitWidth(GUIConstants.PROFILE_WIDTH / 1.5);

        Label label  = new Label(fav.getUsername());
        label.setStyle("-fx-font-weight: bold; -fx-font-size: 16pt;");

        tile.setCenter(profilePicView);
        tile.setBottom(new StackPane(label));

        tile.setOnMouseClicked( e -> {
            GUIController.getPrimaryStage().setScene(new Scene(new ProfileScene(dc,fav,curProfile).getPane(),
                    GUIConstants.SCENE_WIDTH, GUIConstants.SCENE_HEIGHT));
        });

        pane.getChildren().add(tile);
    }

    return pane;
}
 
开发者ID:hadalhw17,项目名称:Artatawe,代码行数:31,代码来源:FavouriteProfileScene.java

示例4: createCenterLoadingBox

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static BorderPane createCenterLoadingBox(final int height)
{
	BorderPane pane = createBorderPane(450, height);
	pane.setStyle("-fx-background-color: rgba(20, 20, 20, 0.6); -fx-background-radius: 10px; -fx-border-radius: 10px; -fx-border-color: rgba(255, 255, 255, 0.1); -fx-border-width: 2px;");
	pane.setPadding(new Insets(10));
	return pane;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:8,代码来源:JavaFxHelper.java

示例5: homeView

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static Scene homeView(){

        BorderPane view = new BorderPane();

        Label title = new Label("Classroom Flipkart");
        title.setFont(new Font("Open Sans", 60));
        title.setTextFill(Color.web("#ededed"));

        HBox header = new HBox(25);
        header.setMinHeight(30);
        header.setAlignment(Pos.TOP_CENTER);

        Label login = new Label("Login");
        login.setPadding(new Insets(5));
        login.setFont(new Font("Open Sans", 20));
        login.setTextFill(Color.web("#ededed"));
        login.setCursor(Cursor.HAND);
        login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");

        Label register = new Label("Register");
        register.setPadding(new Insets(5));
        register.setFont(new Font("Open Sans", 20));
        register.setTextFill(Color.web("#ededed"));
        register.setCursor(Cursor.HAND);

        header.getChildren().addAll(login, register);

        userLogin loginObject = new userLogin();
        userSignUp signUpObject = new userSignUp();

        BorderPane credential = new BorderPane(loginObject.userLogin(), header, null, null, null);
        credential.setMaxWidth(350);
        credential.setStyle("-fx-background-color: rgba(0, 100, 100, 0.5); -fx-border-color: grey; -fx-border-width: 1 1 1 1;");

        login.setOnMouseClicked(e->{
            credential.setCenter(loginObject.userLogin());
            login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
            register.setStyle("");
        });

        register.setOnMouseClicked(e->{
            credential.setCenter(signUpObject.userSignUp());
            login.setStyle("");
            register.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
        });

        VBox centerVB = new VBox(30);
        centerVB.setAlignment(Pos.CENTER);
        centerVB.getChildren().addAll(title, credential);

        view.setCenter(centerVB);

        Scene scene = new Scene(view,800,500);
        scene.getStylesheets().add(loginHome.class.getResource("../../resources/css/main.css").toExternalForm());

        image = loginHome.class.getResource("../../resources/images/splash.jpg").toExternalForm();
        view.setStyle("-fx-background-image: url('" + image + "'); " +
                "-fx-background-position: center center; " +
                "-fx-background-size: cover, auto; " +
                "-fx-background-repeat: stretch;");

        return  scene;
    }
 
开发者ID:madHEYsia,项目名称:ClassroomFlipkart,代码行数:64,代码来源:loginHome.java

示例6: ConfigurationContext

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private ConfigurationContext(GazePlay gazePlay, BorderPane root, Scene scene) {
    super(gazePlay, root, scene);

    HomeButton homeButton = createHomeButtonInConfigurationManagementScreen(gazePlay);

    HBox rightControlPane = new HBox();
    ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(rightControlPane);
    rightControlPane.setAlignment(Pos.CENTER_RIGHT);
    rightControlPane.getChildren().add(homeButton);

    HBox leftControlPane = new HBox();
    ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(leftControlPane);
    leftControlPane.setAlignment(Pos.CENTER_LEFT);

    BorderPane bottomControlPane = new BorderPane();
    bottomControlPane.setLeft(leftControlPane);
    bottomControlPane.setRight(rightControlPane);

    root.setBottom(bottomControlPane);

    GridPane gridPane = buildConfigGridPane(this);
    root.setCenter(gridPane);

    root.setStyle(
            "-fx-background-color: rgba(0, 0, 0, 1); -fx-background-radius: 8px; -fx-border-radius: 8px; -fx-border-width: 5px; -fx-border-color: rgba(60, 63, 65, 0.7); -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.8), 10, 0, 0, 0);");
}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:27,代码来源:ConfigurationContext.java

示例7: HomeMenuScreen

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public HomeMenuScreen(GazePlay gazePlay, List<GameSpec> games, Scene scene, BorderPane root, Configuration config) {
    super(gazePlay, root, scene);
    this.games = games;

    Rectangle exitButton = createExitButton();

    ConfigurationContext configurationContext = ConfigurationContext.newInstance(gazePlay);
    ConfigurationButton configurationButton = ConfigurationButton.createConfigurationButton(configurationContext);

    HBox leftControlPane = new HBox();
    leftControlPane.setAlignment(Pos.CENTER);
    ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(leftControlPane);
    leftControlPane.getChildren().add(configurationButton);

    HBox rightControlPane = new HBox();
    ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(rightControlPane);
    rightControlPane.setAlignment(Pos.CENTER);
    // rightControlPane.getChildren().add(exitButton);

    BorderPane bottomPane = new BorderPane();
    bottomPane.setLeft(leftControlPane);
    bottomPane.setRight(rightControlPane);

    MenuBar menuBar = Utils.buildLicence();

    Node logo = createLogo();
    StackPane topLogoPane = new StackPane();
    topLogoPane.getChildren().add(logo);

    HBox topRightPane = new HBox();
    ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(topRightPane);
    topRightPane.setAlignment(Pos.TOP_CENTER);
    topRightPane.getChildren().add(exitButton);

    cbxGames = createChoiceBox(games, config);
    cbxGames.getSelectionModel().clearSelection();

    StackPane centerCenterPane = new StackPane();
    centerCenterPane.getChildren().add(cbxGames);

    VBox leftPanel = new VBox();
    leftPanel.getChildren().add(menuBar);

    BorderPane centerPanel = new BorderPane();
    centerPanel.setCenter(centerCenterPane);
    centerPanel.setLeft(leftPanel);

    BorderPane topPane = new BorderPane();
    topPane.setTop(menuBar);
    topPane.setCenter(topLogoPane);
    topPane.setRight(topRightPane);

    root.setTop(topPane);
    root.setBottom(bottomPane);
    root.setCenter(centerPanel);

    root.setStyle(
            "-fx-background-color: rgba(0, 0, 0, 1); -fx-background-radius: 8px; -fx-border-radius: 8px; -fx-border-width: 5px; -fx-border-color: rgba(60, 63, 65, 0.7); -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.8), 10, 0, 0, 0);");
}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:60,代码来源:HomeMenuScreen.java

示例8: getPane

import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public BorderPane getPane() {
	TableView<Details> table = new TableView<Details>();
	PieChart chart =new PieChart() ;
	ObservableList<Details> list = FXCollections.observableArrayList();
	TableColumn<Details, String> name = new TableColumn<>("Name");
	name.setPrefWidth(100);
	TableColumn<Details, String> todayExpense = new TableColumn<>("Today Expense");
	todayExpense.setPrefWidth(105);
	TableColumn<Details, String> todayUnits = new TableColumn<>("Today Units");
	todayUnits.setPrefWidth(100);
	TableColumn<Details, String> totalExpense = new TableColumn<>("Total Expense");
	totalExpense.setPrefWidth(100);
	TableColumn<Details, String> totalUnits = new TableColumn<>("Total Units");
	totalUnits.setPrefWidth(100);
	name.setCellValueFactory(new PropertyValueFactory<Details,String>("name"));
	todayExpense.setCellValueFactory(new PropertyValueFactory<Details,String>("todayExpense"));
	todayUnits.setCellValueFactory(new PropertyValueFactory<Details,String>("todayUnits"));
	totalExpense.setCellValueFactory(new PropertyValueFactory<Details,String>("totalExpense"));
	totalUnits.setCellValueFactory(new PropertyValueFactory<Details,String>("totalUnits"));
	table.getColumns().addAll(name,todayExpense,todayUnits,totalExpense,totalUnits);
	Details detail1 = new Details("Lights", "3400", "40", "6000", "67");
	list.addAll(detail1, new Details("Refrigerator", "40000", "40", "8000", "67"),new Details("Television", "3000", "40", "5000", "67"),new Details("Fans", "300", "20", "600", "47"),new Details("A.C", "7000", "80", "10000", "100"),new Details("Oven", "3400", "50", "6500", "70"),new Details("Washing Machine", "3700", "60", "6500", "80"));
	table.setItems(list);
	ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(
			new PieChart.Data("Device 1", 200),
			new PieChart.Data("Device 2", 130),
			new PieChart.Data("Device 3", 100),
			new PieChart.Data("Device 4", 200)
		
			);
	chart.setLabelsVisible(false);
	chart.setLegendVisible(true);
	chart.setMaxSize(400, 400);
	chart.setLegendSide(Side.RIGHT);
	chart.setLabelLineLength(3);
	chart.setLegendSide(Side.BOTTOM);
	chart.setData(pieChartData);
	BorderPane pane = new BorderPane();
	pane.setStyle("-fx-background-color: #1d1d1d");
	pane.setLeft(table);
	pane.setRight(chart);
	
	return pane;
	  
}
 
开发者ID:naeemkhan12,项目名称:IOTproject,代码行数:46,代码来源:ChartControls.java


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