@Override public void start(Stage primaryStage) throws Exception { JFXHamburger show = new JFXHamburger(); show.setPadding(new Insets(10, 5, 10, 5)); JFXRippler rippler = new JFXRippler(show, RipplerMask.CIRCLE, RipplerPos.BACK); JFXListView<Label> list = new JFXListView<>(); for (int i = 1; i < 5; i++) { list.getItems().add(new Label("Item " + i)); } AnchorPane container = new AnchorPane(); container.getChildren().add(rippler); AnchorPane.setLeftAnchor(rippler, 200.0); AnchorPane.setTopAnchor(rippler, 210.0); StackPane main = new StackPane(); main.getChildren().add(container); JFXPopup popup = new JFXPopup(list); rippler.setOnMouseClicked(e -> popup.show(rippler, PopupVPosition.TOP, PopupHPosition.LEFT)); final Scene scene = new Scene(main, 800, 800); scene.getStylesheets().add(PopupDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); primaryStage.setTitle("JFX Popup Demo"); primaryStage.setScene(scene); primaryStage.setResizable(false); primaryStage.show(); }
leftLine.setVisible(false); container.getChildren().add(rightLine); container.getChildren().add(leftLine); container.getChildren().add(rippler); AnchorPane.setRightAnchor(rippler, labelOffset);
pane.getChildren().add(buttonCollapse); AnchorPane listsPane = new AnchorPane(); listsPane.getChildren().add(list); AnchorPane.setLeftAnchor(list, 20.0); listsPane.getChildren().add(javaList); AnchorPane.setLeftAnchor(javaList, 300.0);
private void updateConstraints() { AnchorPane.clearConstraints(anchorCenteredPane); AnchorPane.setLeftAnchor(anchorCenteredPane, 0.); AnchorPane.setRightAnchor(anchorCenteredPane, 0.); AnchorPane.setTopAnchor(anchorCenteredPane, 0.); if (bottomNode.isVisible()) { AnchorPane.setBottomAnchor(anchorCenteredPane, 72.0); } else { AnchorPane.setBottomAnchor(anchorCenteredPane, 0.0); } }
AnchorPane anchorPane = new AnchorPane(); anchorPane.getChildren().add(buttonPane); anchorPane.getChildren().add(infoPane); AnchorPane.setLeftAnchor(infoPane, 0d); AnchorPane.setTopAnchor(infoPane, 0d); anchorPane.setPadding(new Insets(INSET)); anchorPane.setMinHeight(BUTTON_HEIGHT + 2 * INSET); anchorPane.setPrefHeight(BUTTON_HEIGHT + 2 * INSET); AnchorPane.setRightAnchor(buttonPane, 0d); AnchorPane.setTopAnchor(buttonPane, 0d); buttonPane.toFront(); anchorPane.getStyleClass().add("button_panel"); getChildren().add(anchorPane); getChildren().add(chart); AnchorPane panel = new AnchorPane(); AnchorPane.setTopAnchor(buttonUp, 5.0); AnchorPane.setLeftAnchor(buttonUp, 0.0); AnchorPane.setRightAnchor(buttonUp, 10.0); AnchorPane.setBottomAnchor(buttonDown, 5.0); AnchorPane.setLeftAnchor(buttonDown, 0.0); AnchorPane.setRightAnchor(buttonDown, 10.0); panel.getChildren().add(buttonUp); panel.getChildren().add(buttonDown);
public SimpleForm() { setSpacing(12); titlePane = new AnchorPane(); titlePane.getStyleClass().add("datafx-form-title"); titleLabel = new Label(); titleLabel.getStyleClass().add("datafx-form-title-label"); AnchorPane.setLeftAnchor(titleLabel, 12.0); AnchorPane.setTopAnchor(titleLabel, 6.0); AnchorPane.setBottomAnchor(titleLabel, 6.0); titlePane.getChildren().add(titleLabel); titlePane.setVisible(false); getChildren().add(titlePane); mainPane = new GridPane(); mainPane.setAlignment(Pos.CENTER_RIGHT); mainPane.setHgap(12.0); mainPane.setVgap(6.0); VBox.setMargin(mainPane, new Insets(0, 16, 0, 16)); getChildren().add(mainPane); actionPane = new FlowPane(); actionPane.setAlignment(Pos.CENTER_RIGHT); actionPane.setHgap(6.0); VBox.setMargin(actionPane, new Insets(0, 16, 12, 16)); getChildren().add(actionPane); }
/** * Builds the footer */ private void buildFooter() { String footerImpl = configuration.getPropertyValue(FOOTER_IMPL); if (StringUtils.isEmpty(footerImpl)) { footerImpl = WIZARD_STEP_FOOTER; } stepFooter = (IWizardStepFooter) Services.getBean(footerImpl); stepFooter.buildFrom(controller, configuration); Node bottom = stepFooter.getDisplay(); getChildren().add(bottom); AnchorPane.setBottomAnchor(bottom, 0.); AnchorPane.setLeftAnchor(bottom, 0.); AnchorPane.setRightAnchor(bottom, 0.); }
public void setNoContent() { if (displayHeaderIfEmpty) { setTableView(); // tableLayout.setBottom(noContentPane); } else { getChildren().clear(); getChildren().add(noContentPane); AnchorPane.setTopAnchor(noContentPane, 0.0); AnchorPane.setLeftAnchor(noContentPane, 0.0); AnchorPane.setRightAnchor(noContentPane, 0.0); // buildMaterialButton(); } }
AnchorPane buttonRow = new AnchorPane(); buttonRow.getChildren().addAll(backLbl, nextLbl); buttonRow.getStyleClass().add("buttonRow"); AnchorPane.setLeftAnchor(backLbl, 0.0); AnchorPane.setRightAnchor(nextLbl, control.getPaddingLocal().getRight()); final BorderPane overAllLayout = new BorderPane(); PlaceHolder placeHolder = new PlaceHolder(1, contentHeight.doubleValue()); overAllLayout.setCenter(placeHolder); overAllLayout.setBottom(buttonRow); buttonRow.prefWidthProperty().bind(overAllLayout.widthProperty());
protected void drawLeftImage() { AnchorPane pane = new AnchorPane(); pane.setPrefWidth(187); Stop[] stops = new Stop[] { new Stop(0, Color.web("#3c79b2")), new Stop(1, Color.web("#2d5d8b")) }; RadialGradient gradient = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, stops); Background background = new Background(new BackgroundFill(gradient, null, null)); pane.setBackground(background); Text text = new Text(this.parent.getLeftImageText()); text.setFill(Color.WHITE); text.setFont(Font.font("Maven Pro", 50)); text.setRotate(-90); pane.setPadding(new Insets(-50)); pane.getChildren().add(text); AnchorPane.setBottomAnchor(text, 160.0); AnchorPane.setRightAnchor(text, -40.0); getParent().getRoot().setLeft(pane); }
getChildren().add(JFXDepthManager.createMaterialNode(header, 1)); tabsContainer = new AnchorPane(); tabsContainerHolder = new AnchorPane(); tabsContainerHolder.getChildren().add(tabsContainer); tabsClip = new Rectangle(); tabsContainerHolder.setClip(tabsClip); getChildren().add(0, tabsContainerHolder);
@Override public void start(Stage stage) throws Exception { AnchorPane root = new AnchorPane(); root.getChildren().add(new PairedTextField()); stage.setScene(new Scene(root, 300, 250)); stage.show(); } }
public void setProcessing() { getChildren().clear(); getChildren().add(processingPane); AnchorPane.setLeftAnchor(processingPane, 0.0); AnchorPane.setRightAnchor(processingPane, 0.0); }
/** * {@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); }
protected void initMaterialNodeDrag() { final Delta dragDelta = new Delta(); materialNode.setOnMousePressed(mouseEvent -> { AnchorPane.setTopAnchor(materialNode, null); AnchorPane.setBottomAnchor(materialNode, null); AnchorPane.setRightAnchor(materialNode, null); // record a delta distance for the drag and drop operation. dragDelta.x = materialNode.getLayoutX() - mouseEvent.getSceneX(); dragDelta.y = materialNode.getLayoutY() - mouseEvent.getSceneY(); materialNode.setCursor(Cursor.MOVE); }); materialNode.setOnMouseReleased(mouseEvent -> materialNode.setCursor(Cursor.HAND)); materialNode.setOnMouseDragged(mouseEvent -> { materialNode.setLayoutX(mouseEvent.getSceneX() + dragDelta.x); materialNode.setLayoutY(mouseEvent.getSceneY() + dragDelta.y); }); materialNode.setOnMouseEntered(mouseEvent -> materialNode.setCursor(Cursor.HAND)); }
private void addTabContentHolder(Tab tab) { // create new content place holder TabContentHolder tabContentHolder = new TabContentHolder(tab); tabContentHolder.setClip(new Rectangle()); tabContentHolders.add(tabContentHolder); // always add tab content holder below its header tabsContainer.getChildren().add(0, tabContentHolder); }
/** * Creates a new {@link TextField} object fitted to the given container. * * @param container The container to which the text field is added * @return The created text field */ private TextField createTextField(AnchorPane container) { TextField searchField = new TextField(); searchField.getStyleClass().add("searchBar"); searchField.prefHeightProperty().bind(container.prefHeightProperty()); searchField.prefWidthProperty().bind(container.prefWidthProperty()); AnchorPane.setLeftAnchor(searchField, 0.0); AnchorPane.setRightAnchor(searchField, 0.0); return searchField; }
public void setMaterialNode(Node materialNode) { Platform.runLater(() -> { if (this.materialNode != null) { ((Pane) processedView()).getChildren().remove(this.materialNode); } ((Pane) processedView()).getChildren().add(materialNode); this.materialNode = materialNode; AnchorPane.setTopAnchor(materialNode, 350.); AnchorPane.setRightAnchor(materialNode, 40.); initMaterialNodeDrag(); }); }
/** * @{inheritedDoc} */ @Override public void setDisplaySelectors(Boolean displayGroupSelector) { header.setVisible(displayGroupSelector); header.managedProperty().bind(header.visibleProperty()); if (!displayGroupSelector) { AnchorPane.setTopAnchor(fieldsetTopLayoutCenter, 10.); } } }
private AnchorPane pane = new AnchorPane(); private Label location0 = new Label("Location 0"); private Label location1 = new Label("Location 1");