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


Java AnchorPane类代码示例

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


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

示例1: start

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {

    this.primaryStage = primaryStage;
    Parent root = new AnchorPane();
    Scene scene = new Scene(root);
    primaryStage.setScene(scene);
    primaryStage.getIcons().add(new Image(SQUID_LOGO_SANS_TEXT_URL));
    primaryStage.setTitle("Squid 3.0 pre-release");

    // this produces non-null window after .show()
    primaryStageWindow = primaryStage.getScene().getWindow();

    primaryStage.setOnCloseRequest((WindowEvent e) -> {
        Platform.exit();
        System.exit(0);
    });

    // postpone loading to allow for stage creation and use in controller
    scene.setRoot(FXMLLoader.load(getClass().getResource("SquidUIController.fxml")));
    primaryStage.show();
    primaryStage.setMinHeight(scene.getHeight() + 15);
    primaryStage.setMinWidth(scene.getWidth());

    squidAboutWindow = new SquidAboutWindow(primaryStage);
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:27,代码来源:SquidUI.java

示例2: reloadRomsBtnAction

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
@FXML
void reloadRomsBtnAction() throws IOException {
	
	JFXSpinner spinner = new JFXSpinner();
	spinner.setPrefSize(30, 30);
	spinner.setStyle(" -fx-background-color: #f4f4f4;");
	main.getPane().getChildren().add(spinner);
	AnchorPane.setTopAnchor(spinner, (main.getPane().getHeight()-spinner.getPrefHeight())/2);
   	AnchorPane.setLeftAnchor(spinner, (main.getPane().getWidth()-spinner.getPrefWidth())/2);
   	
   	Thread thread = new Thread(new Runnable() {
		@Override
		public void run() {
			dbController.loadRomDirectory(getRomPath()); // reload the rom directory
			
			Platform.runLater(() -> {
				refreshUIData(); // refresh the list of games displayed on screen
				main.getPane().getChildren().remove(spinner);
               });
		}
	});
	thread.start();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:24,代码来源:MainWindowController.java

示例3: showGithubLoginDialog

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public GithubLoginDialogController showGithubLoginDialog(){
    GithubLoginDialogController controller = null;
    try {
        FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("com/kaanburaksener/octoUML/src/view/fxml/githubLoginDialog.fxml"));
        AnchorPane page = loader.load();
        Stage dialogStage = new Stage();
        dialogStage.initModality(Modality.WINDOW_MODAL);
        dialogStage.initOwner(this.stage);
        dialogStage.setScene(new Scene(page));

        controller = loader.getController();
        controller.setDialogStage(dialogStage);
        dialogStage.showAndWait();

    } catch (IOException e){
        e.printStackTrace();
    }

    return controller;
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:21,代码来源:TabController.java

示例4: start

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
@Override public void start(Stage stage) {
    AnchorPane pane = new AnchorPane(xAxis, yAxis, grid);

    AnchorPane.setTopAnchor(yAxis, 0d);
    AnchorPane.setBottomAnchor(yAxis, 25d);
    AnchorPane.setLeftAnchor(yAxis, 0d);

    AnchorPane.setLeftAnchor(xAxis, 25d);
    AnchorPane.setRightAnchor(xAxis, 0d);
    AnchorPane.setBottomAnchor(xAxis, 0d);

    AnchorPane.setTopAnchor(grid, 0d);
    AnchorPane.setRightAnchor(grid, 0d);
    AnchorPane.setBottomAnchor(grid, 25d);
    AnchorPane.setLeftAnchor(grid, 25d);

    Scene scene = new Scene(pane);

    stage.setTitle("GridTest");
    stage.setScene(scene);
    stage.show();

    //Helper.saveAsPng(pane, "/Users/hansolo/Desktop/grid.png");
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:25,代码来源:GridTest.java

示例5: AnchorPaneSample

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public AnchorPaneSample() {

    AnchorPane anchorPane = new AnchorPane();

    Label label1 = new Label("We are all in an AnchorPane.");        
    ImageView imageView = new ImageView(ICON_48);
    Button button1 = new Button("Submit");

    anchorPane.getChildren().addAll(label1, imageView, button1);

    AnchorPane.setTopAnchor(label1, Double.valueOf(2));
    AnchorPane.setLeftAnchor(label1, Double.valueOf(20));
    AnchorPane.setTopAnchor(button1, Double.valueOf(40));
    AnchorPane.setLeftAnchor(button1, Double.valueOf(20));
    AnchorPane.setTopAnchor(imageView, Double.valueOf(75));
    AnchorPane.setLeftAnchor(imageView, Double.valueOf(20));

    getChildren().add(anchorPane);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:AnchorPaneSample.java

示例6: initGraphics

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
        Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    checkForAxis();

    adjustChartRange();

    adjustAxisAnchors();

    pane = new AnchorPane(xyPane);
    pane.getChildren().addAll(axis);
    setGrid(grid);

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:23,代码来源:XYChart.java

示例7: initGraphics

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
        Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    validateSeries();

    pane = new AnchorPane(yPane);

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:17,代码来源:YChart.java

示例8: loadScreenPlay

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
@Autor("Divino Matheus")
private void loadScreenPlay(String path) throws IOException {
	
	AnchorPane pane = FXMLLoader.load(getClass().getResource(path));
	    
           if (path.substring(6, path.length()).equals("LayoutTelaInicial.fxml")) {
               pane.getStylesheets().add("css/buttonStyle.css");
           } else if(path.substring(6, path.length()).equals("LayoutTelaVencedor.fxml")) {
               pane.getStylesheets().add("css/layoutTelaVencedor.css");
           } else if(path.substring(6, path.length()).equals("LayoutTelaCreditos.fxml")) {
               pane.getStylesheets().add("css/layoutTelaCreditos.css");
           }
	
	Scene scene = new Scene(pane, 800, 600);
	ApplicationShowMilhao.changeScene(scene);		
}
 
开发者ID:tadeuespindolapalermo,项目名称:ShowMilhaoPOOJava,代码行数:17,代码来源:ControllerLayoutPrincipal.java

示例9: loadScreenPlay

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
/**
 * Método que inicia a view LayoutNome para o jogador digitar o nome	 
 */
private void loadScreenPlay(String path) throws IOException {				
	AnchorPane pane = FXMLLoader.load(getClass().getResource(path));
       if (path.substring(6, path.length()).equals("LayoutTelaInicial.fxml")) {
           pane.getStylesheets().add("css/buttonStyle.css");
       } else if (path.substring(6, path.length()).equals("LayoutTelaPerguntas.fxml")) {
           pane.getStylesheets().add("css/buttonDialogStyle.css");
       } else if (path.substring(6, path.length()).equals("LayoutRanking.fxml")) {
           pane.getStylesheets().add("css/layoutRanking.css");
       } else if (path.substring(6, path.length()).equals("LayoutTelaRegras.fxml")){        	
           pane.getStylesheets().add("css/layoutTelaRegras.css");
       } else if (path.substring(6, path.length()).equals("LayoutNome.fxml")){
           pane.getStylesheets().add("css/buttonDialogStyle.css");
       }		
	Scene scene = new Scene(pane, 800, 600);
	ApplicationShowMilhao.changeScene(scene);		
}
 
开发者ID:tadeuespindolapalermo,项目名称:ShowMilhaoPOOJava,代码行数:20,代码来源:ControllerLayoutInicial.java

示例10: start

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) {
	try {
		AnchorPane root = (AnchorPane)FXMLLoader.load(getClass().getResource("LogInScreen.fxml")); 
		Scene scene = new Scene(root, 340, 370);
	    scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
		primaryStage.setTitle("QuickNote Plus - Log in");
		primaryStage.setScene(scene);
		primaryStage.setResizable(false);
		primaryStage.show();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:NN-DMt,项目名称:QuickNote_Plus,代码行数:15,代码来源:main.java

示例11: showMainMenu

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public void showMainMenu() {
    try {
        // Load person overview.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/main/java/view/MainMenu.fxml"));
        AnchorPane mainAnchor = (AnchorPane) loader.load();
        
        MainMenuController controller = loader.getController();
        controller.setMainApp(this);
        
        primaryStage.getScene().setRoot(mainAnchor);
        
        if(OptionManager.isFullscreen())
            primaryStage.setFullScreen(true);
        else
            primaryStage.setFullScreen(false);

        // Set person overview into the center of root layout.
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:23,代码来源:Main.java

示例12: showNewGameScreen

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public void showNewGameScreen(){
    try {
        // Load person overview.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/main/java/view/NewGameScreen.fxml"));
        AnchorPane mainAnchor = (AnchorPane) loader.load();
        
        NewGameScreenController controller = loader.getController();
        controller.setMainApp(this);
        controller.majColorButton();
        
        primaryStage.getScene().setRoot(mainAnchor);
        if(OptionManager.isFullscreen())
            primaryStage.setFullScreen(true);
        else
            primaryStage.setFullScreen(false);
        

        // Set person overview into the center of root layout.
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:24,代码来源:Main.java

示例13: showLoadGameScreen

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public void showLoadGameScreen(){
    try {
        // Load person overview.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/main/java/view/LoadGameScreen.fxml"));
        AnchorPane mainAnchor = (AnchorPane) loader.load();
        
        LoadGameScreenController controller = loader.getController();
        controller.setMainApp(this);
        controller.initGameList();
        
        primaryStage.getScene().setRoot(mainAnchor);
        if(OptionManager.isFullscreen())
            primaryStage.setFullScreen(true);
        else
            primaryStage.setFullScreen(false);

        // Set person overview into the center of root layout.
    } catch (IOException e) {
        e.printStackTrace();
    }
    
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:24,代码来源:Main.java

示例14: showOptionsScreen

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
public void showOptionsScreen(){
    try {
        // Load person overview.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/main/java/view/OptionsScreen.fxml"));
        AnchorPane mainAnchor = (AnchorPane) loader.load();
        
        OptionsScreenController controller = loader.getController();
        controller.setMainApp(this);
            
        controller.init();
        primaryStage.getScene().setRoot(mainAnchor);
        if(OptionManager.isFullscreen())
            primaryStage.setFullScreen(true);
        else
            primaryStage.setFullScreen(false);
        

        // Set person overview into the center of root layout.
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:24,代码来源:Main.java

示例15: showNitriteOverview

import javafx.scene.layout.AnchorPane; //导入依赖的package包/类
private void showNitriteOverview() {
    try {
        // Load person overview.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(getClass().getClassLoader().getResource("NitriteOverview.fxml"));
        AnchorPane personOverview = loader.load();

        final NitriteOverviewController overViewController = loader.getController();
        if (rootController != null && overViewController != null) {
            rootController.closeHandler(overViewController::close);
            overViewController.init(dbDetails);
            rootLayout.setCenter(personOverview);
        }
    } catch (Throwable t) {
        showErrorDialog(t);
        Platform.exit();
    }
}
 
开发者ID:dizitart,项目名称:nitrite-database,代码行数:19,代码来源:NitriteManager.java


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