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

项目:Artatawe    文件:ProfileScene.java   
/**
 * Load box with artworks profile is selling
 * @return  bidedPane
 */
private HBox loadSellingAuctions(){
    HBox bidedPane = new HBox();
    for(Auction auction: dc.getAuctions()){
        if(auction
                .getSeller()
                .getUsername()
                .equals(p.getUsername())){
            ImageView imgView2 = new ImageView(new Image(auction
                    .getArtwork()
                    .getPhoto()
                    .getPath())
            );
            imgView2.setFitWidth(200);
            imgView2.setFitHeight(200);
            bidedPane
                    .getChildren()
                    .addAll(new Pane(imgView2)
                    );
        }
    }
    return bidedPane;
}
项目:dialog-tool    文件:TransitionPaneController.java   
protected void addRow (Transition transition) {
    // load fxml
    try {
        FXMLLoader loader = new FXMLLoader(new File(ROW_FXML).toURI().toURL());

        //set controller
        TransitionRowController controller = new TransitionRowController(this, this.entry, this.index, transition);
        this.controllerList.add(controller);
        loader.setController(controller);

        Pane rootPane = loader.load();//FXMLLoader.load(new File(fxmlPath).toURI().toURL());

        //initialize tab controller
        controller.init(stage, null, rootPane);

        this.listView.getItems().add(rootPane);
    } catch (IOException e) {
        e.printStackTrace();
        System.exit(1);
    }
}
项目:legendary-guide    文件:ClickableBitcoinAddress.java   
@FXML
protected void showQRCode(MouseEvent event) {
    // Serialize to PNG and back into an image. Pretty lame but it's the shortest code to write and I'm feeling
    // lazy tonight.
    final byte[] imageBytes = QRCode
            .from(uri())
            .withSize(320, 240)
            .to(ImageType.PNG)
            .stream()
            .toByteArray();
    Image qrImage = new Image(new ByteArrayInputStream(imageBytes));
    ImageView view = new ImageView(qrImage);
    view.setEffect(new DropShadow());
    // Embed the image in a pane to ensure the drop-shadow interacts with the fade nicely, otherwise it looks weird.
    // Then fix the width/height to stop it expanding to fill the parent, which would result in the image being
    // non-centered on the screen. Finally fade/blur it in.
    Pane pane = new Pane(view);
    pane.setMaxSize(qrImage.getWidth(), qrImage.getHeight());
    final Main.OverlayUI<ClickableBitcoinAddress> overlay = Main.instance.overlayUI(pane, this);
    view.setOnMouseClicked(event1 -> overlay.done());
}
项目:EasyFXML    文件:BaseEasyFxmlTest.java   
@Test
public void load_as_pane_multiple() {
    final Pane testPane = this.assertSuccessAndGet(
        this.easyFxml.loadNode(TEST_NODES.PANE, SELECTOR)
    );

    this.assertAppliedStyle(testPane, "");

    this.assertControllerBoundToTestPane(
        testPane,
        this.controllerManager.getMultiple(TEST_NODES.PANE, SELECTOR)
    );

    assertThat(testPane.getChildren()).hasSize(1);
    assertThat(testPane.getChildren().get(0).getClass()).isEqualTo(Button.class);

}
项目:EasyFXML    文件:BaseEasyFxmlTest.java   
/**
 * We have to sleep here because the event firing in JavaFX can't be waited on all the way.
 * So if we don't wait, as soon as the click is actually sent, but not yet registered,
 * we are already asserting.
 * The wait is a horrific thing that the whole async life promised to save us from. But it did
 * not deliver (yet).
 *
 * @param testPane         The pane to test bounding on
 * @param controllerLookup The controller as an {@link Option} so we can know if the test
 *                         actually failed because of some outside reason.
 */
private void assertControllerBoundToTestPane(final Pane testPane, final Option<FxmlController> controllerLookup) {
    assertThat(controllerLookup.isDefined()).isTrue();
    assertThat(controllerLookup.get().getClass()).isEqualTo(SAMPLE_CONTROL_CLASS.class);

    Stages.stageOf("TEST_PANE", testPane)
        .whenCompleteAsync((stage, err) -> Stages.scheduleDisplaying(stage))
        .whenCompleteAsync((stage, err) -> {
            final Button btn = (Button) stage.getScene().getRoot().getChildrenUnmodifiable().get(0);
            btn.fire();
            Stages.asyncStageOperation(stage, Stage::hide);
        })
        .whenCompleteAsync((stage, err) -> {
            final SAMPLE_CONTROL_CLASS testController = (SAMPLE_CONTROL_CLASS) controllerLookup.get();
            assertThat(testController.locatedInstance).isTrue();
        })
        .toCompletableFuture()
        .join();
}
项目:EasyFXML    文件:StagesTest.java   
@Override
public void start(final Stage stage) {
    Platform.setImplicitExit(false);
    STAGE_TITLE = "STAGE_TITLE";
    STAGE_TITLE_2 = "STAGE_TITLE_2";
    STAGE_PANE = new Pane();
    TEST_STAGE = stage;
    stage.show();
    stage.hide();
}
项目:vars-annotation    文件:ControlsPaneController.java   
public ControlsPaneController(UIToolBox toolBox) {
    this.toolBox = toolBox;

    toolBox.getEventBus()
            .toObserverable()
            .ofType(MediaControlsChangedEvent.class)
            .subscribe(e -> updateMediaControlPane(e.get()));

    emptyControlsPane = new Pane();
    emptyControlsPane.setPrefSize(440, 80);
    emptyControlsPane.setMaxSize(440, 80);
    emptyControlsPane.setMinSize(440, 80);

    Runtime.getRuntime()
            .addShutdownHook(new Thread(() -> saveDividerPositions(splitPaneKey, getRoot())));
}
项目:boomer-tuner    文件:RootController.java   
private void displayText(final String s, final String title) {
    final Scene scene = new Scene(new Pane());

    String text = s;
    if (s == null || s.isEmpty()) { text = "Whoops! Nothing to see here"; }
    final Text textItem = new Text(text);

    final Button okButton = new Button("OK");

    final GridPane grid = new GridPane();
    grid.setVgap(4);
    grid.setHgap(10);
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(textItem, 0, 0);
    grid.add(okButton, 1, 0);

    final Pane root = (Pane) scene.getRoot();
    root.getChildren().add(grid);

    if (rootModel.darkModeProperty().get()) {
        scene.getStylesheets().add("root/darkMode.css");
        textItem.getStyleClass().add("text");
    }

    final Stage stage = new Stage();
    stage.setScene(scene);
    stage.setTitle(title);
    stage.show();


    okButton.setOnAction(e -> {
        stage.close();
    });
}
项目:charts    文件:MatrixPane.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);
        }
    }

    getStyleClass().setAll("chart", "matrix-chart");

    matrix = PixelMatrixBuilder.create()
                               .prefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT)
                               .pixelShape(PixelShape.SQUARE)
                               .useSpacer(true)
                               .squarePixels(false)
                               .pixelOnColor(Color.BLACK)
                               .pixelOffColor(Color.TRANSPARENT)
                               .build();

    pane = new Pane(matrix);
    getChildren().setAll(pane);
}
项目:MooProject    文件:ConsoleTab.java   
public ConsoleTab(Button button, Pane pane, TextArea mooConsole, TextField commandInput, Button commandSend) {
    super(button, pane);
    this.mooConsole = mooConsole;
    this.commandInput = commandInput;
    this.commandSend = commandSend;

    // for sending command
    commandSend.setOnAction(event -> {
        String text = commandInput.getText();
        commandInput.clear();
        PacketMessenger.message(new PacketConsoleInput(text));
    });

    // register this as event listener
    EventExecutor.getInstance().register(this);
    PacketAdapting.getInstance().register(this);
}
项目:dialog-tool    文件:RaiseEventTransitionController.java   
@Override
public void init(Stage stage, Scene scene, Pane pane) {
    addButton.setOnMouseClicked(new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
            //add transition

            String eventName = eventNameTextField.getText();

            if (eventName.isEmpty()) {
                return;
            }

            RaiseEventTransition transition = new RaiseEventTransition(eventName);
            entry.getTranstionList(index).add(transition);

            //refresh listview
            paneController.refreshListView();

            stage.close();
        }
    });
}
项目:stvs    文件:SpecificationTableDemo.java   
private Pane createExtractedTableTextArea(ConstraintSpecification spec, ConstraintSpecificationValidator recognizer) {
  final TextArea textArea = new TextArea();
  textArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateText(textArea, spec);

  final Button updateButton = new Button("Refresh");
  updateButton.setOnAction(event -> updateText(textArea, spec));

  final TextArea problemsArea = new TextArea();
  problemsArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateProblemsText(problemsArea, recognizer);

  recognizer.problemsProperty().addListener((Observable o) -> updateProblemsText(problemsArea, recognizer));

  SplitPane splitPane = new SplitPane(textArea, problemsArea);
  splitPane.setOrientation(Orientation.VERTICAL);
  VBox.setVgrow(splitPane, Priority.ALWAYS);
  return new VBox(updateButton, splitPane);
}
项目:easyMvvmFx    文件:BaseDialog.java   
private void create(){
        mStage = new Stage();
        mStage.initModality(Modality.APPLICATION_MODAL);
        mStage.initOwner(null);
        mStage.initStyle(StageStyle.TRANSPARENT);
        mStage.setResizable(false);
        viewTuple = createContent();
        if(viewTuple.getView() instanceof BaseView){
            BaseView view = (BaseView) viewTuple.getView();
            view.onDialogSet(this);
            root = (Pane) viewTuple.getRoot();
            alignCenter(root.getPrefWidth(), root.getPrefHeight());
            if(isDragable)
                dragDialogAbleNode(root);
        }else{
            try {
                throw new Exception("your view is not a BaseView!");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        mScene = new Scene(viewTuple.getRoot());
//        mScene.getStylesheets().setAll(TestinStage.getInstance().getStylesheet());
        mStage.setScene(mScene);
    }
项目:charts    文件:SunburstChart.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);
        }
    }

    segmentPane = new Pane();

    chartCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    chartCanvas.setMouseTransparent(true);

    chartCtx    = chartCanvas.getGraphicsContext2D();

    pane = new Pane(segmentPane, chartCanvas);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);

    prepareData();
}
项目:stvs    文件:VerticalResizeContainerControllerDemo.java   
private Scene simpleScene() {
  try {
    VBox root = new VBox();
    Pane pane = new Pane();
    Rectangle rectangle = new Rectangle(100, 100, Color.AQUA);
    pane.getChildren().addAll(rectangle);
    VerticalResizeContainerController controller = new VerticalResizeContainerController(pane);
    root.getChildren().addAll(controller.getView());
    VBox.setVgrow(controller.getView(), Priority.ALWAYS);
    Scene scene = new Scene(root, 800, 600);
    return scene;
  } catch (Exception e) {
    e.printStackTrace();
    return null;
  }
}
项目:marathonv5    文件:DocPage.java   
private void updateSidebar() {
    if (docPage != null) {
        ObservableList<SamplePage> relatedSamples = docPage.getRelatedSamples();
        if (!(relatedSamples.isEmpty())) {
            sidePane.setContent(createSideBar(relatedSamples));
            sidePane.setVisible(true);
            webView.getStyleClass().remove(WEB_VIEW_WINDOW_CORNER_STYLECLASS);
        } else {
            sidePane.setContent(new Pane());
            sidePane.setVisible(false);
            webView.getStyleClass().add(WEB_VIEW_WINDOW_CORNER_STYLECLASS);
        }
    } else {
        sidePane.setContent(new Pane());
        sidePane.setVisible(false);
        webView.getStyleClass().add(WEB_VIEW_WINDOW_CORNER_STYLECLASS);
    }
    requestLayout();
}
项目:marathonv5    文件:DirectoryChooserSample.java   
@Override public void start(final Stage stage) {
    stage.setTitle("Directory Chooser Sample");

    final DirectoryChooser directoryChooser = new DirectoryChooser();
    final Button openButton = new Button("Select a folder...");

    openButton.setOnAction((final ActionEvent e) -> {
        File file = directoryChooser.showDialog(stage);
        if (file != null) {
            openFile(file);
        }
    });

    final GridPane inputGridPane = new GridPane();

    GridPane.setConstraints(openButton, 0, 1);
    inputGridPane.setHgap(6);
    inputGridPane.setVgap(6);
    inputGridPane.getChildren().addAll(openButton);

    final Pane rootGroup = new VBox(12);
    rootGroup.getChildren().addAll(inputGridPane);
    rootGroup.setPadding(new Insets(12, 12, 12, 12));

    stage.setScene(new Scene(rootGroup));
    stage.show();
}
项目:dialog-tool    文件:TabController.java   
@Override
public void init(Stage stage, Scene scene, Pane pane) {
    System.out.println("entry text: " + entry.getText());

    //fill widgets
    this.textArea.setText(entry.getText());
    this.choise1TextField.setText(entry.getChoise1Text());
    this.choise2TextField.setText(entry.getChoise2Text());
    this.choise3TextField.setText(entry.getChoise3Text());
}
项目:dynamo    文件:TransformerSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    transformer = new Region();
    transformer.getStyleClass().addAll("transformer-shape");

    name = new Text(getSkinnable().getName());
    name.getStyleClass().setAll("name-text");

    pane = new Pane(background, transformer, name);

    getChildren().add(pane);
    resize();
}
项目:fwm    文件:GenericTextController.java   
public void start(Stage primaryStage, Pane rootLayout, String title) throws Exception {
   primaryStage.setTitle(title);
   Scene myScene = new Scene(rootLayout);
   primaryStage.setScene(myScene);
   primaryStage.show();

   primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
       public void handle(WindowEvent we) {
           isOpen = false;
       }
   });
   textArea.setWrapText(true);
   textArea.setEditable(false);
}
项目:fwm    文件:WorldSettingsController.java   
public void start(Stage primaryStage, Pane rootLayout, String title) throws Exception {
   ourStage = primaryStage;
    primaryStage.setTitle(title);
   Scene myScene = new Scene(rootLayout);
   primaryStage.setScene(myScene);
   primaryStage.show();

   popUpOn.setToggleGroup(popUp);
   popUpOff.setToggleGroup(popUp);
   if(WorldConfig.getShowPlayersPopup()) {
       popUpOn.setSelected(true);
   }
   else {
       popUpOff.setSelected(true);
   }

   manualSaveOn.setToggleGroup(manualSaveGroup);
   manualSaveOff.setToggleGroup(manualSaveGroup);
   if(AppConfig.getManualSaveOnly()){
       manualSaveOn.setSelected(true);
   }else{
       manualSaveOff.setSelected(true);
   }

   darkModeOn.setToggleGroup(darkModeGroup);
   darkModeOff.setToggleGroup(darkModeGroup);
   if(AppConfig.getDarkMode()){
       darkModeOn.setSelected(true);
   }else{
       darkModeOff.setSelected(true);
   }

   autoUpdateTabsOn.setToggleGroup(autoUpdateGroup);
   autoUpdateTabsOff.setToggleGroup(autoUpdateGroup);
   if(AppConfig.getAutoUpdateTabs()){
       autoUpdateTabsOn.setSelected(true);
   }else{
       autoUpdateTabsOff.setSelected(true);
   }

   primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
       public void handle(WindowEvent we) {
           isOpen = false;
       }
   });
}
项目:Squid    文件:TopsoilPlotWetherill.java   
@Override
public Pane initializePlotPane() {
    org.cirdles.squid.gui.topsoil.TopsoilPlotController.topsoilPlot = this;
    Pane topsoilPlotUI = null;
    try {
        topsoilPlotUI = FXMLLoader.load(getClass().getResource("TopsoilPlot.fxml"));
    } catch (IOException iOException) {
    }

    return topsoilPlotUI;
}
项目:dialog-tool    文件:TransitionTabController.java   
protected void addStartTitledPane () {
    TitledPane titledPane = new TitledPane();
    titledPane.setText("Transition before choice (on start)");
    titledPane.setAnimated(true);

    // load fxml
    try {
        FXMLLoader loader = new FXMLLoader(new File(TRANSITION_PANE_FXML).toURI().toURL());

        //set controller
        TransitionPaneController controller = new TransitionPaneController(this.entry, 0);
        this.controllerList.add(controller);
        loader.setController(controller);

        Pane rootPane = loader.load();//FXMLLoader.load(new File(fxmlPath).toURI().toURL());

        //initialize tab controller
        controller.init(stage, null, rootPane);

        titledPane.setContent(rootPane);
        titledPane.setExpanded(true);
    } catch (IOException e) {
        e.printStackTrace();
        System.exit(1);
    }

    accordion.getPanes().add(titledPane);
}
项目:EasyFXML    文件:ExceptionHandler.java   
public static CompletionStage<Stage> displayExceptionPane(
    final String title,
    final String readable,
    final Throwable exception
) {
    final Pane exceptionPane = new ExceptionHandler(exception).asPane(readable);
    final CompletionStage<Stage> exceptionStage = Stages.stageOf(title, exceptionPane);
    return exceptionStage.thenCompose(Stages::scheduleDisplaying);
}
项目:Lyrebird    文件:ControlBarController.java   
private void openTweetWindow() {
    log.info("Opening new tweet stage...");
    final Pane tweetPane = this.easyFxml
            .loadNode(TWEET_VIEW)
            .getOrElseGet(err -> new ExceptionHandler(err).asPane());

    Stages.stageOf("Tweet", tweetPane)
            .thenCompose(Stages::scheduleDisplaying)
            .thenAccept(stage -> this.stageManager.registerSingle(TWEET_VIEW, stage))
            .thenRun(() -> log.info("New tweet stage opened !"));
}
项目:EasyFXML    文件:Stages.java   
public static CompletionStage<Stage> stageOf(final String title, final Pane rootPane) {
    final CompletableFuture<Stage> upcomingStage = new CompletableFuture<>();
    Platform.runLater(() -> {
        final Stage stage = new Stage(StageStyle.DECORATED);
        stage.setTitle(title);
        stage.setScene(new Scene(rootPane));
        upcomingStage.complete(stage);
    });
    return upcomingStage;
}
项目:gomoku    文件:Main.java   
/**
 * Take a pixel-aware screenshot of some pane.
 * @param pane Input pane
 * @param pixelScale Scaling factor applied to snapshot (1 is no scaling)
 * @return WritableImage snapshot, scaled by given amount
 */
public static WritableImage screenshot(Pane pane, double pixelScale) {
    int width = (int) Math.rint(pixelScale * pane.getWidth());
    int height = (int) Math.rint(pixelScale * pane.getHeight());

    WritableImage writableImage = new WritableImage(width, height);
    SnapshotParameters params = new SnapshotParameters();
    params.setTransform(Transform.scale(pixelScale, pixelScale));
    return pane.snapshot(params, writableImage);
}
项目:EasyFXML    文件:BaseEasyFxmlTest.java   
@Test
public void load_with_type_success() {
    final Pane testPane = this.assertSuccessAndGet(
        this.easyFxml.loadNode(TEST_NODES.PANE, Pane.class)
    );

    this.assertAppliedStyle(testPane, ""); //expect inherit parent

    this.assertControllerBoundToTestPane(
        testPane,
        this.controllerManager.getSingle(TEST_NODES.PANE)
    );
}
项目:legendary-guide    文件:GuiUtils.java   
public static Animation fadeOutAndRemove(Duration duration, Pane parentPane, Node... nodes) {
    nodes[0].setCache(true);
    FadeTransition ft = new FadeTransition(duration, nodes[0]);
    ft.setFromValue(nodes[0].getOpacity());
    ft.setToValue(0.0);
    ft.setOnFinished(actionEvent -> parentPane.getChildren().removeAll(nodes));
    ft.play();
    return ft;
}
项目:jrfl    文件:Style.java   
/**
 * Sets the style active
 * If <tt>name</tt> is null, the style will be temporary
 */
public void setActive() {
    Jrfl.ACTIVE_STYLE = this;
    Jrfl.cache.set("selected-style", name);
    Jrfl.cache.store(true);

    Pane pane = ((Pane) JavaFX.getRoot());
    pane.getChildrenUnmodifiable().forEach(n -> n.setStyle(""));
    Nodes.TEXT_VBOX.getChildrenUnmodifiable().forEach(n -> n.setStyle(""));
    pane.setStyle("-fx-background-color: " + configuration.get("background.color"));

    new JrflRectangle(); new JrflLabel(); new JrflTextField();
}
项目:SunburstChart    文件:SunburstChart.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);
        }
    }

    segmentPane = new Pane();

    chartCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    chartCanvas.setMouseTransparent(true);

    chartCtx    = chartCanvas.getGraphicsContext2D();

    pane = new Pane(segmentPane, chartCanvas);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);

    prepareData();
}
项目:Transport-Production-Issue    文件:Controller.java   
private double getMatrixElement(Pane p,int row,int column){
    if(p==null||p.getChildren().get(row)==null)
        return 0.0;
    Node child=p.getChildren().get(row);
    if(!(child instanceof Pane))
        return 0.0;
    Node txt = ((Pane) child).getChildren().get(column);
    if(txt==null || !(txt instanceof TextField))
        return 0.0;
    return Double.parseDouble(((TextField) txt).getText());
}
项目:lttng-scope    文件:UiModelApp.java   
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    /* Top-level */
    Pane contentPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.setStyle(BACKGROUND_STYLE);

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    drawBackground(backgroundLayer, contentPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, contentPane);
}
项目:dynamo    文件:LoadSkin.java   
private void initGraphics() {
    background = new Region();
    background.getStyleClass().setAll("background");

    load = new Region();
    load.getStyleClass().addAll("load-shape");

    name = new Text(getSkinnable().getName());
    name.getStyleClass().setAll("name-text");

    pane = new Pane(background, load, name);

    getChildren().add(pane);
    resize();
}
项目:Gleisbelegung    文件:Plugin_Gleisbelegung.java   
private void openLogWindow(){
    Stage stage = new Stage();

    //Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter werden deine Log-Datei und deine Anregungen anonym hochgeladen.");
    Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter wird deine Log-Datei anonym hochgeladen.");
    l.setStyle("-fx-text-fill: white");
    l.setFont(Font.font(settingsFontSize));
    l.setWrapText(true);
    l.setMaxWidth(450);
    l.setTranslateY(25);
    l.setTranslateX(25);

    /*TextField ta = new TextField();
    ta.setFont(Font.font(settingsFontSize-3));
    ta.setTranslateX(25);
    ta.setTranslateY(125);
    ta.setPrefWidth(450);
    ta.setPrefHeight(100);*/


    Button bno = new Button("Abbrechen");
    bno.setFont(Font.font(settingsFontSize));
    bno.setOnAction(e -> stage.close());
    bno.setTranslateX(250);
    bno.setTranslateY(150);

    Button byes = new Button("Weiter");
    byes.setFont(Font.font(settingsFontSize));
    byes.setTranslateX(150);
    byes.setTranslateY(150);
    byes.setOnAction(e -> {
        byes.setDisable(true);
        bno.setDisable(true);

        Runnable r = () -> {
            sendLogFile(l);
        };
        new Thread(r).start();
    });

    Pane p = new Pane(l, byes, bno);
    p.setStyle("-fx-background-color: #303030");
    p.setMinSize(500,200);
    p.setMaxSize(500, 200);

    Scene s = new Scene(p,500,200);


    stage.setScene(s);
    stage.setTitle("Log-Datei senden?");

    stage.setAlwaysOnTop(true);
    stage.show();
}
项目:CORNETTO    文件:ViewPane.java   
public ViewPane(MyGraphView graphView) {

        // Setup Main Pane
        AnchorPane.setBottomAnchor(this, 0.0);
        AnchorPane.setTopAnchor(this, 0.0);
        AnchorPane.setLeftAnchor(this, 0.0);
        AnchorPane.setRightAnchor(this, 0.0);
        this.setStyle("-fx-background-color : whitesmoke");

        // Create new scene with graphView
        this.myGraphView = graphView;
        bottomPane = new Pane();
        topPane = new Pane();
        topPane.setPickOnBounds(false);

        stackPane = new StackPane(bottomPane, myGraphView, topPane);
        viewScene = new SubScene(stackPane, this.getWidth(), this.getHeight());
        viewScene.widthProperty().bind(this.widthProperty());
        viewScene.heightProperty().bind(this.heightProperty());
        viewScene.setPickOnBounds(false);

        // Add StackPane in SubScene and add content.
        getChildren().addAll(viewScene);

        // Bind LayoutWidth to this here
        myGraphView.animationService.widthProperty.bind(this.widthProperty());
        myGraphView.animationService.heightProperty.bind(this.heightProperty());

        hoverInfo = new SimpleStringProperty("");
        this.groupNodeInitLocation = new HashMap<>();

        // Setup interactions and view elements
        setupTransforms();
        initRectangle();
        addMouseInteractions();
    }
项目:jmonkeybuilder    文件:TerrainEditingComponent.java   
/**
 * Switch editing mode.
 */
private void switchMode(@NotNull final ActionEvent event) {

    final ToggleButton source = (ToggleButton) event.getSource();

    if (!source.isSelected()) {
        source.setSelected(true);
        return;
    }

    getToggleButtons().forEach(source, (button, arg) -> button !=
            arg, (toggleButton, arg) -> toggleButton.setSelected(false));

    final ObjectDictionary<ToggleButton, Pane> buttonToSettings = getButtonToSettings();
    final Pane settings = buttonToSettings.get(source);

    final VBox controlSettings = getControlSettings();
    final ObservableList<javafx.scene.Node> children = controlSettings.getChildren();
    children.clear();

    if (settings != null) {
        children.add(settings);
    }

    final ObjectDictionary<ToggleButton, TerrainToolControl> buttonToControl = getButtonToControl();
    final TerrainToolControl toolControl = buttonToControl.get(source);

    setToolControl(toolControl);

    if (!isShowed()) return;

    EXECUTOR_MANAGER.addJMETask(() -> {
        final Node cursorNode = getCursorNode();
        cursorNode.removeControl(TerrainToolControl.class);
        cursorNode.addControl(toolControl);
    });
}
项目:marathonv5    文件:StreamingMediaPlayer.java   
@Override protected void layoutChildren() {
    if (mediaView != null && getBottom() != null) {
        mediaView.setFitWidth(getWidth());
        mediaView.setFitHeight(getHeight() - getBottom().prefHeight(-1));
    }
    super.layoutChildren();
    if (mediaView != null) {
        mediaView.setTranslateX((((Pane)getCenter()).getWidth() - mediaView.prefWidth(-1)) / 2);
        mediaView.setTranslateY((((Pane)getCenter()).getHeight() - mediaView.prefHeight(-1)) / 2);
    }
}
项目:jrfl    文件:Jrfl.java   
private void initBoxes(Pane root, Scene scene) {
    VBox vBox = Nodes.TEXT_VBOX;
    HBox hBox = Nodes.TEXTBAR_HBOX;
    ScrollPane scrollPane = Nodes.SCROLL_PANE;

    vBox.setTranslateY(10);
    vBox.setTranslateX(10);
    vBox.prefWidthProperty().bind(scene.widthProperty().subtract(10));
    vBox.prefHeightProperty().bind(scene.heightProperty().subtract(20).subtract(preferences.getDouble("textbar-height")));
    vBox.setSpacing((preferences.getDouble("messages-spacing-level") - 1)*10-5);


    hBox.setPrefWidth(scene.getWidth());
    hBox.setPrefHeight(preferences.getDouble("textbar-height"));
    hBox.setTranslateY(scene.getHeight() - hBox.getPrefHeight());
    hBox.setSpacing(20);

    root.widthProperty().addListener(o -> hBox.setPrefWidth(root.getWidth()));
    root.heightProperty().addListener(o -> hBox.setTranslateY(scene.getHeight() - Nodes.TEXTBAR_HBOX.getPrefHeight()));

    scrollPane.setContent(vBox);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setTranslateX(vBox.getTranslateX());
    scrollPane.setTranslateY(vBox.getTranslateY());
    scrollPane.maxWidthProperty().bind(vBox.prefWidthProperty());
    scrollPane.prefWidthProperty().bind(vBox.prefWidthProperty());
    scrollPane.prefHeightProperty().bind(vBox.prefHeightProperty());
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
}
项目:gemoc-studio-modeldebugging    文件:MultidimensionalTimelineRenderer.java   
private HBox createValueTraceLine(Dimension<?> dimension) {
    final HBox hBox = new HBox();
    final String title = traceExtractor.getDimensionLabel(dimension) + "  ";
    final Label titleLabel = new Label(title);
    titleLabel.setFont(valuesFont);
    final Pane pane = setupValuePane(dimension, titleLabel, hBox);
    pane.setFocusTraversable(true);
    return hBox;
}