Java 类javafx.scene.layout.AnchorPane 实例源码

项目:Squid    文件:SquidUI.java   
@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);
}
项目:octoBubbles    文件:TabController.java   
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;
}
项目:cemu_UI    文件:MainWindowController.java   
@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();
}
项目:charts    文件:GridTest.java   
@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");
}
项目:marathonv5    文件:AnchorPaneSample.java   
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);
}
项目:marathonv5    文件:AnchorPaneSample.java   
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);
}
项目:charts    文件:XYChart.java   
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);
}
项目:charts    文件:YChart.java   
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);
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutPrincipal.java   
@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);       
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutInicial.java   
/**
 * 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);       
}
项目:QuickNote_Plus    文件:main.java   
@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();
    }
}
项目:Hive_Game    文件:Main.java   
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();
    }
}
项目:Hive_Game    文件:Main.java   
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();
    }
}
项目:Hive_Game    文件:Main.java   
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();
    }

}
项目:Hive_Game    文件:Main.java   
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();
    }
}
项目:nitrite-database    文件:NitriteManager.java   
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();
    }
}
项目:dynamo    文件:DynamoTest.java   
@Override
public void start(final Stage primaryStage) {
    GridPane gridPane = new GridPane();
    gridPane.setStyle("-fx-background-color: #252525");
    gridPane.setHgap(5.0);
    gridPane.setGridLinesVisible(true);

    gridPane.add(new AnchorPane(new Alarm()),       0, 0);
    gridPane.add(new AnchorPane(new Display()),     1, 0);
    gridPane.add(new AnchorPane(new Generator()),   2, 0);
    gridPane.add(new AnchorPane(new LevelBar()),    3, 0);
    gridPane.add(new AnchorPane(new Load()),        4, 0);
    gridPane.add(new AnchorPane(new Switch()),      5, 0);
    gridPane.add(new AnchorPane(new Transformer()), 6, 0);

    Scene scene = new Scene(gridPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}
项目:CNU_TermProject_SoftwareEngineering    文件:ShoppingBasketController.java   
public void settingTab(Tab tab, String CategoryName) {
    AnchorPane content = (AnchorPane) tab.getContent();
    ArrayList singleList = getItemListByCategory(CategoryName);
    for (int i = 0; i < singleList.size(); i++) {
        DAOItem temp = (DAOItem) singleList.get(i);
        int indexX = i % 4;
        int indexY = i / 4;
        Button button = new Button();
        button.setPrefWidth(buttonSize);
        button.setPrefHeight(buttonSize);
        button.setLayoutX(startX + indexX * gap + (buttonSize * indexX));
        button.setLayoutY(startY + indexY * gap + (buttonSize * indexY));
        button.setText(temp.getItemName() + "\n" + "(" + temp.getItemPrice() + ")");
        button.setTextAlignment(TextAlignment.CENTER);
        button.setOnAction(this::menuItemAction);
        button.setWrapText(true);
        button.setId(temp.getItemName());
        content.getChildren().add(button);
    }
}
项目:Steam-trader-tools    文件:AddGameController.java   
@FXML
void openAddCustomGame(ActionEvent event) throws IOException
{
    Stage stage = new Stage();
    ResourceBundle bundle = I18n.getResourceBundle();
    AddCustomGameController addCustomGameController = new AddCustomGameController(userAppList, controllerBinder);
    FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/matthieu42/steamtradertools/view/addcustomgameview.fxml"), bundle);
    loader.setController(addCustomGameController);
    AnchorPane root = loader.load();
    Scene addGameScene = new Scene(root);
    String css = AppController.class.getResource("/com/matthieu42/steamtradertools/view/style.css").toExternalForm();
    addGameScene.getStylesheets().add(css);
    stage.setScene(addGameScene);
    stage.show();

}
项目:FloydWarshallSimulation    文件:FXMLDocumentController.java   
@FXML
private void nextButtonAction(ActionEvent e) throws IOException{
    value = vertex.getValue();


    //Will Initialize the number of vertex in targeted classes

    TableViewerController.steps = value;
    ManualInputController.steps = value;

    AnchorPane temp = null;

    if(matrixInput.isSelected())
    {
        temp  = FXMLLoader.load(getClass().getResource("VertexAndEdge.fxml"));
        CategoryChooserController.manualChecker = false;
    }

    else
    {
        temp  = FXMLLoader.load(getClass().getResource("ManualInput.fxml"));
        CategoryChooserController.manualChecker = true;
    }
    rootPane.getChildren().setAll(temp);
}
项目:cemu_UI    文件:JFXInfoDialog.java   
public void show() {
    JFXDialogLayout content = new JFXDialogLayout();
    content.setHeading(new Text(headingText));
    content.setBody(new Text(bodyText));
    content.setPrefSize(dialogWidth, dialogHeight);
    StackPane stackPane = new StackPane();
    stackPane.autosize();
    JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
    JFXButton button = new JFXButton("Okay");
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            dialog.close();
        }
    });
    button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
    button.setPrefHeight(32);
    button.setStyle(dialogBtnStyle);
    content.setActions(button);
    pane.getChildren().add(stackPane);
    AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
    AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
    dialog.show();
}
项目:stvs    文件:SpecificationsPane.java   
/**
 * Creates an empty instance.
 */
public SpecificationsPane() {
  this.tabPane = new TabPane();
  this.addButton = new Button("+");
  ViewUtils.setupClass(this);


  AnchorPane.setTopAnchor(tabPane, 0.0);
  AnchorPane.setLeftAnchor(tabPane, 0.0);
  AnchorPane.setRightAnchor(tabPane, 0.0);
  AnchorPane.setBottomAnchor(tabPane, 0.0);
  AnchorPane.setTopAnchor(addButton, 5.0);
  AnchorPane.setRightAnchor(addButton, 5.0);

  this.getChildren().addAll(tabPane, addButton);
}
项目:charts    文件:XYChart.java   
private void adjustAxisAnchors() {
    axis.forEach(axis -> {
        if (Orientation.HORIZONTAL == axis.getOrientation()) {
            AnchorPane.setLeftAnchor(axis, hasLeftYAxis ? leftAxisWidth : 0d);
            AnchorPane.setRightAnchor(axis, hasRightYAxis ? rightAxisWidth : 0d);

            AnchorPane.setLeftAnchor(xyPane, hasLeftYAxis ? leftAxisWidth : 0d);
            AnchorPane.setRightAnchor(xyPane, hasRightYAxis ? rightAxisWidth : 0d);
        } else {
            AnchorPane.setTopAnchor(axis, hasTopXAxis ? topAxisHeight : 0d);
            AnchorPane.setBottomAnchor(axis, hasBottomXAxis ? bottomAxisHeight : 0d);

            AnchorPane.setTopAnchor(xyPane, hasTopXAxis ? topAxisHeight : 0d);
            AnchorPane.setBottomAnchor(xyPane, hasBottomXAxis ? bottomAxisHeight : 0d);
        }
    });
    if (hasCenterYAxis) { AnchorPane.setLeftAnchor(yAxisC, yAxisC.getZeroPosition()); }
    if (hasCenterXAxis) { AnchorPane.setTopAnchor(xAxisC, xAxisC.getZeroPosition()); }
}
项目:charts    文件:PlayfairTest.java   
private Axis createCenterXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.CENTER);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setBottomAnchor(axis, axis.getZeroPosition());
    AnchorPane.setLeftAnchor(axis, 25d);
    AnchorPane.setRightAnchor(axis, 25d);

    return axis;
}
项目:EasyFXML    文件:ExceptionHandler.java   
public Pane asPane(final String userReadableError) {
    LOG.debug("Generating node corresponding to ExceptionPane...");
    final Label messageLabel = new Label(userReadableError);
    final TextArea throwableDataLabel = new TextArea(formatErrorMessage(this.exception));

    AnchorPane.setLeftAnchor(messageLabel, ERROR_FIELD_MARGIN_SIZE);
    DomUtils.centerNode(throwableDataLabel, ERROR_FIELD_MARGIN_SIZE);
    return new AnchorPane(messageLabel, throwableDataLabel);
}
项目:charts    文件:LogGridTest.java   
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.RIGHT);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

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

    return axis;
}
项目:charts    文件:TimeAxisTest.java   
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.LEFT);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

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

    return axis;
}
项目:MythRedisClient    文件:HashPanel.java   
/**
 * 显示连接属性面板.
 * @param isHash 是否为hash
 * @param key 键
 * @return 是否点击确认
 */
public boolean showPanel(boolean isHash, String key) {
    boolean ok = false;

    // 创建 FXMLLoader 对象
    FXMLLoader loader = new FXMLLoader();
    // 加载文件
    loader.setLocation(this.getClass().getResource("/views/HashAddLayout.fxml"));
    AnchorPane pane = null;
    try {
        pane = loader.load();
    } catch (IOException e) {
        e.printStackTrace();
    }

    // 创建对话框
    Stage dialogStage = new Stage();
    dialogStage.setTitle("添加键值对");
    dialogStage.initModality(Modality.WINDOW_MODAL);
    Scene scene = new Scene(pane);
    dialogStage.setScene(scene);


    hashAddController = loader.getController();
    hashAddController.setDialogStage(dialogStage);
    isAddHash(isHash);
    setHashKey(key);

    // 显示对话框, 并等待, 直到用户关闭
    dialogStage.showAndWait();

    ok = hashAddController.isOkChecked();

    return ok;
}
项目:charts    文件:GridTest.java   
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.RIGHT);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

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

    return axis;
}
项目:charts    文件:LineChartTest.java   
private Axis createTopXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.TOP);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setTopAnchor(axis, AXIS_WIDTH);
    AnchorPane.setLeftAnchor(axis, AXIS_WIDTH);
    AnchorPane.setRightAnchor(axis, AXIS_WIDTH);

    return axis;
}
项目:cayenne-modeler    文件:LayoutSupport.java   
default void displayView(final AnchorPane anchorPane, final Node view)
{
    // Remove anything already there.
    anchorPane.getChildren().removeAll(anchorPane.getChildren());

    // Make the view fill the anchor pane.
    AnchorPane.setTopAnchor(view, 0.0);
    AnchorPane.setLeftAnchor(view, 0.0);
    AnchorPane.setRightAnchor(view, 0.0);
    AnchorPane.setBottomAnchor(view, 0.0);

    // Add the view into the anchor pane.
    anchorPane.getChildren().add(view);
}
项目:stvs    文件:TimingDiagramCollectionController.java   
/**
 * Generates a {@link TimingDiagramController} for a given {@link ValidIoVariable}. The method
 * adds multiple views to the {@link TimingDiagramCollectionView view} of this controller:
 * <ul>
 * <li>A {@link TimingDiagramView} wrapped in a
 * {@link edu.kit.iti.formal.stvs.view.spec.timingdiagram.renderer.VerticalResizeContainerView}
 * will be added to {@link TimingDiagramCollectionView#diagramContainer}</li>
 * <li>A {@link Label} (title of the {@link ValidIoVariable}) will be added to
 * {@link TimingDiagramCollectionView#labelContainer}</li>
 * <li>A {@link Axis} will be added to the {@link TimingDiagramCollectionView#yaxisContainer}</li>
 * </ul>
 *
 * @param concreteSpec the concrete specification which should be used to extract the needed
 *        information
 * @param validIoVariable the variable for which a diagram should be generated
 */
private void createTimingDiagram(ConcreteSpecification concreteSpec,
    ValidIoVariable validIoVariable) {
  Pair<TimingDiagramController, Axis> diagramAxisPair = validIoVariable.getValidType().match(
      () -> TimingDiagramController.createIntegerTimingDiagram(concreteSpec, validIoVariable,
          view.getXaxis(), selection, activated),
      () -> TimingDiagramController.createBoolTimingDiagram(concreteSpec, validIoVariable,
          view.getXaxis(), selection, activated),
      (e) -> TimingDiagramController.createEnumTimingDiagram(concreteSpec, validIoVariable, e,
          view.getXaxis(), selection, activated));
  TimingDiagramView timingDiagramView = diagramAxisPair.getLeft().getView();

  if (concreteSpec.isCounterExample()) {
    timingDiagramView.getStyleClass().add("counterexample");
  }
  Axis externalYAxis = diagramAxisPair.getRight();
  VerticalResizeContainerController verticalResizeContainerController =
      new VerticalResizeContainerController(timingDiagramView);

  this.view.getDiagramContainer().getChildren().add(verticalResizeContainerController.getView());
  this.view.getyAxisContainer().getChildren().add(externalYAxis);
  timingDiagramView.getyAxis().layoutBoundsProperty()
      .addListener(change -> updateAxisExternalPosition(timingDiagramView, externalYAxis));
  verticalResizeContainerController.getView().layoutYProperty()
      .addListener(change -> updateAxisExternalPosition(timingDiagramView, externalYAxis));
  AnchorPane.setRightAnchor(externalYAxis, 0.0);

  Label label = new Label(validIoVariable.getName());
  label.getStyleClass().add(validIoVariable.getCategory().name().toLowerCase());
  this.view.getLabelContainer().getChildren().add(label);
  // Ensures that labels are always centered vertically relative to their diagram
  label.layoutYProperty().bind(externalYAxis.layoutYProperty()
      .add(externalYAxis.heightProperty().divide(2)).subtract(label.heightProperty().divide(2)));
}
项目:Conan    文件:InstructionsView.java   
/**
    * Sets the bounds for the contents of the anchor pane.
    * @param contents
    */
   private void setAnchorBounds(Node contents) {
    AnchorPane.setTopAnchor(contents, 0.0);
    AnchorPane.setRightAnchor(contents, 0.0);
    AnchorPane.setBottomAnchor(contents, 0.0);
    AnchorPane.setLeftAnchor(contents, 0.0);
}
项目:stvs    文件:VerticalResizeContainerView.java   
/**
 * Creates an instance of this container class.
 */
public VerticalResizeContainerView() {
  this.getChildren().add(container);
  container.getChildren().addAll(contentContainer);
  contentContainer.getChildren().addAll(content, dragLine);
  AnchorPane.setLeftAnchor(container, 0.0);
  AnchorPane.setRightAnchor(container, 0.0);
  AnchorPane.setTopAnchor(container, 0.0);
  dragLine.widthProperty().bind(container.widthProperty());
  // AnchorPane.setBottomAnchor(dragLine, 0.0);
  ViewUtils.setupView(this, "resizeContainer.css");

  this.getStyleClass().add("resizeContainer");
  dragLine.getStyleClass().add("dragLine");
}
项目:charts    文件:LineChartTest.java   
private Axis createCenterXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.CENTER);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setBottomAnchor(axis, axis.getZeroPosition());
    AnchorPane.setLeftAnchor(axis, AXIS_WIDTH);
    AnchorPane.setRightAnchor(axis, AXIS_WIDTH);

    return axis;
}
项目:charts    文件:TimeAxisTest.java   
private Axis createBottomTimeAxis(final LocalDateTime START, final LocalDateTime END, final String PATTERN, final boolean AUTO_SCALE) {
    Axis axis = new Axis(START, END, Orientation.HORIZONTAL, Position.BOTTOM);
    axis.setDateTimeFormatPattern(PATTERN);
    axis.setPrefHeight(AXIS_WIDTH);

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

    return axis;
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutCMPergunta.java   
private void loadScreenPlay(String path) throws IOException {
    AnchorPane pane = FXMLLoader.load(getClass().getResource(path));
    if (path.substring(6, path.length()).equals("LayoutTelaPerguntas.fxml")) {
        pane.getStylesheets().add("css/buttonDialogStyle.css");
    }
    Scene scene = new Scene(pane, 800, 600);
    ApplicationShowMilhao.changeScene(scene);       
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutTelaCreditos.java   
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");
    }
    Scene scene = new Scene(pane, 800, 600);
    ApplicationShowMilhao.changeScene(scene);       
}
项目:FxTreeMap    文件:FxTreeMap.java   
public FxTreeMap(MapData mapData, boolean withLayoutDelay) {
    super(withLayoutDelay);
    //
    treeMapLayout = new TreeMapLayout();
    mapLevels = new HashMap<>();
    treeItems = new HashMap<>();
    model = new FxMapModel(FxTreeMap.this, mapData, getWidth(), getHeight());
    mapData.addPropertyChangeListener(this::handleModelChange);
    mapLevels.put(model.getData(), model);
    currentModel = model;
    model.setTreeMapStyle(style);
    style.addPropertyChangeListener(this::handleStyleChanged);
    //
    layout = new VBox(8);
    layout.setPadding(new Insets(8));
    //
    breadCrumbBar = new BreadCrumbBar();
    pane = new Pane();
    pane.getChildren().addAll(model.getFxItems().stream().map(i -> i.getNode()).collect(Collectors.toList()));
    layout.getChildren().add(breadCrumbBar);
    layout.getChildren().add(pane);
    VBox.setVgrow(breadCrumbBar, Priority.NEVER);
    VBox.setVgrow(pane, Priority.ALWAYS);
    getContainer().getChildren().add(layout);
    AnchorPane.setBottomAnchor(layout, 0.0);
    AnchorPane.setLeftAnchor(layout, 0.0);
    AnchorPane.setRightAnchor(layout, 0.0);
    AnchorPane.setTopAnchor(layout, 0.0);
    //
    createBar();
    //
    breadCrumbBar.setAutoNavigationEnabled(true);
    breadCrumbBar.setOnCrumbAction((BreadCrumbActionEvent<MapData> bae) -> handleBreadCrumbEvent(bae));
    breadCrumbBar.setCrumbFactory((TreeItem<MapData> param) -> {
        String label = param != null && param.getValue() != null ? param.getValue().getName() : "?";
        return new BreadCrumbBarSkin.BreadCrumbButton(label);
    });
    //
    runLater(() -> requestLayoutUpdate());
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutTelaVencedor.java   
private void loadScreenPlay(String path) throws IOException{
    AnchorPane pane = FXMLLoader.load(getClass().getResource(path));
    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);       
}