use of javafx.scene.layout.AnchorPane in project NumberMagic by MaslEberl.
the class main_screen method showPersonOverview.
/**
* Shows the person overview inside the root layout.
*/
public void showPersonOverview() {
try {
// Load person overview.
FXMLLoader loader = new FXMLLoader();
loader.setLocation(main_screen.class.getResource("haupt_scene.fxml"));
AnchorPane personOverview = (AnchorPane) loader.load();
// Set person overview into the center of root layout.
rootLayout.setCenter(personOverview);
} catch (IOException e) {
e.printStackTrace();
}
}
use of javafx.scene.layout.AnchorPane in project Media-Library by The-Rain-Goddess.
the class ApplicationWindow method start.
@Override
public void start(Stage rootStage) throws Exception {
AnchorPane componentWindow = new AnchorPane();
VBox componentLayout = new VBox();
BorderPane tableDisplay = new BorderPane();
search = new TextField();
// set main window size
componentWindow.setMinHeight(WINDOW_MIN_HEIGHT);
componentWindow.setMinWidth(WINDOW_MIN_WIDTH);
// align dataTable
tableDisplay.setRight(setupMediaDataTable());
tableDisplay.setLeft(setupMediaFileBrowser());
tableDisplay.setTop(setupMediaPlayer());
;
VBox.setMargin(tableDisplay, new Insets(10, 10, 10, 10));
componentLayout.getChildren().addAll(setupMenuBar(), tableDisplay);
// add componentLayout to Window
componentWindow.getChildren().addAll(componentLayout);
// Create the scene and add the parent container to it
Scene scene = new Scene(componentWindow, WINDOW_MIN_WIDTH, WINDOW_MIN_HEIGHT);
// Add the Scene to the Stage
rootStage.setScene(scene);
rootStage.getIcons().add(new Image(this.getClass().getResourceAsStream("media_library.png")));
rootStage.show();
}
use of javafx.scene.layout.AnchorPane in project POL-POM-5 by PhoenicisOrg.
the class SearchBoxSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
AnchorPane container = new AnchorPane();
container.getStyleClass().add("searchBox");
this.searchField = createTextField(container);
this.clearButton = createClearButton();
container.getChildren().addAll(searchField, clearButton);
getChildren().addAll(container);
}
use of javafx.scene.layout.AnchorPane in project TestFX by TestFX.
the class BoundsLocatorImplTest method setupStages.
private void setupStages() {
primaryWindow = new Stage();
CountDownLatch setSceneLatch = new CountDownLatch(1);
InvalidationListener invalidationListener = observable -> setSceneLatch.countDown();
primaryWindow.sceneProperty().addListener(observable -> {
setSceneLatch.countDown();
primaryWindow.sceneProperty().removeListener(invalidationListener);
});
nodeInsideOfScene = new Rectangle(INSIDE_SCENE_X, INSIDE_SCENE_Y, INSIDE_SCENE_WIDTH, INSIDE_SCENE_HEIGHT);
nodePartiallyOutsideOfScene = new Rectangle(partialOutsideSceneX, partialOutsideSceneY, PARTIAL_OUTSIDE_SCENE_WIDTH, PARTIAL_OUTSIDE_SCENE_HEIGHT);
nodeOutsideOfScene = new Rectangle(sceneWidth + 300, sceneHeight + 300, 100, 100);
AnchorPane nodeContainer = new AnchorPane(nodeInsideOfScene, nodePartiallyOutsideOfScene, nodeOutsideOfScene);
primaryScene = new Scene(nodeContainer, sceneWidth, sceneHeight);
// totally outside the bounds, no longer partially.
if (System.getProperty("os.name").toLowerCase(Locale.US).startsWith("win") && System.getProperty("testfx.robot", "awt").toLowerCase(Locale.US).equals("awt") && (JavaVersionAdapter.getScreenScaleX() != 1d || JavaVersionAdapter.getScreenScaleY() != 1d)) {
primaryScene.widthProperty().addListener((observable, oldVal, newVal) -> {
waitForNewSize = true;
partialOutsideSceneX = partialOutsideSceneX - (oldVal.doubleValue() - newVal.doubleValue());
nodeContainer.getChildren().remove(nodePartiallyOutsideOfScene);
nodePartiallyOutsideOfScene = new Rectangle(partialOutsideSceneX, nodePartiallyOutsideOfScene.getBoundsInLocal().getMinY(), PARTIAL_OUTSIDE_SCENE_WIDTH, nodePartiallyOutsideOfScene.getBoundsInLocal().getHeight());
nodeContainer.getChildren().add(1, nodePartiallyOutsideOfScene);
sceneWidth = newVal.doubleValue();
});
primaryScene.heightProperty().addListener((observable, oldVal, newVal) -> {
waitForNewSize = true;
partialOutsideSceneY = partialOutsideSceneY - (oldVal.doubleValue() - newVal.doubleValue());
nodeContainer.getChildren().remove(nodePartiallyOutsideOfScene);
nodePartiallyOutsideOfScene = new Rectangle(nodePartiallyOutsideOfScene.getBoundsInLocal().getMinX(), partialOutsideSceneY, nodePartiallyOutsideOfScene.getBoundsInLocal().getWidth(), PARTIAL_OUTSIDE_SCENE_HEIGHT);
nodeContainer.getChildren().add(1, nodePartiallyOutsideOfScene);
sceneHeight = newVal.doubleValue();
});
}
primaryWindow.setX(WINDOW_TRANSLATE_X);
primaryWindow.setY(WINDOW_TRANSLATE_X);
primaryWindow.setScene(primaryScene);
try {
if (!setSceneLatch.await(10, TimeUnit.SECONDS)) {
fail("Timeout while waiting for scene to be set on stage.");
}
} catch (Exception ex) {
fail("Unexpected exception: " + ex);
}
primaryWindow.show();
}
Aggregations