public void show() { textArea = new JFXTextArea(bodyText); JFXDialogLayout content = new JFXDialogLayout(); content.setHeading(new Text(headingText)); content.setBody(textArea); 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(); }
public EnumerationNodeView(EnumerationNode node) { super(node); //setChangeListeners(); container = new StackPane(); rectangle = new Rectangle(); vbox = new VBox(); container.getChildren().addAll(rectangle, vbox); initVBox(); createRectangles(); changeHeight(node.getHeight()); changeWidth(node.getWidth()); initLooks(); this.getChildren().add(container); this.setTranslateX(node.getTranslateX()); this.setTranslateY(node.getTranslateY()); createHandles(); }
@Override public void start(Stage stage) { GridPane gridPane = new GridPane(); gridPane.setPadding(new Insets(10)); gridPane.setHgap(10); gridPane.setVgap(10); gridPane.add(lineChart, 0, 0); gridPane.add(areaChart, 1, 0); gridPane.add(smoothLineChart, 0, 1); gridPane.add(smoothAreaChart, 1, 1); gridPane.add(scatterChart, 0, 2); gridPane.add(donutChart, 1, 2); Scene scene = new Scene(new StackPane(gridPane)); stage.setTitle("Charts"); stage.setScene(scene); stage.show(); timer.start(); modificationThread.start(); }
@Override public void init() throws Exception { root = new StackPane(); background = new StackPane(); background.setId("Window"); background.setCache(true); ImageView carImageView = new ImageView(new Image( DataAppPreloader.class.getResourceAsStream("images/car.png"))); raceTrack = new RaceTrack(); root.getChildren().addAll(background, raceTrack, carImageView); Platform.runLater(new Runnable() { @Override public void run() { preloaderScene = new Scene(root,1250,750); preloaderScene.getStylesheets().add( DataAppPreloader.class.getResource("preloader.css").toExternalForm()); } }); }
public static void displayLetter(Pane parent, LetterInterface letter, boolean draggable) { Text tileText = new Text(LetterToStringTransformer.transform(letter)); tileText.getStyleClass().add("tile-letter"); Text tileValue = new Text(String.valueOf(letter.getValue())); tileValue.getStyleClass().add("tile-value"); tileValue.setTranslateX(8); tileValue.setTranslateY(10); StackPane tile = new StackPane(tileText, tileValue); tile.getStyleClass().add("tile"); if (draggable) { DraggableLetterManager.makeLetterDraggable(tile, letter); } parent.getChildren().add(tile); }
GoogleEntryGMapsFXView(GoogleEntry entry) { this.entry = entry; this.entry.locationProperty().addListener(obs -> updateLocation()); this.mapView.addMapInializedListener(this); this.mapView.getStyleClass().add("map"); this.mapView.setMouseTransparent(true); this.mapViewWrapper.getChildren().add(mapView); this.mapViewWrapper.setVisible(false); this.mapViewWrapper.managedProperty().bind(this.mapView.visibleProperty()); this.mapViewWrapper.setPrefSize(300, 300); StackPane stackPane = new StackPane(); stackPane.getStyleClass().add("map-view-wrapper"); stackPane.getChildren().add(mapViewWrapper); getChildren().add(stackPane); }
@Override @FXThread protected void createContent(@NotNull final StackPane root) { appStateList = new AppStateList(this::selectAppStateFromList, this); propertyEditorAppStateContainer = new VBox(); filterList = new FilterList(this::selectFilterFromList, this); propertyEditorFiltersContainer = new VBox(); layerNodeTree = new LayerNodeTree(this::selectNodeFromLayersTree, this); propertyEditorLayersContainer = new VBox(); super.createContent(root); FXUtils.addClassTo(layerNodeTree.getTreeView(), CSSClasses.TRANSPARENT_TREE_VIEW); }
public static Node createIconContent() { StackPane sp = new StackPane(); HBox hbox = new HBox(3); hbox.setAlignment(Pos.CENTER); Rectangle rectangle = new Rectangle(70, 25, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); hbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4")); Rectangle r2 = new Rectangle(14, 14, Color.web("#349b00")); Rectangle r3 = new Rectangle(18, 14, Color.web("#349b00")); hbox.getChildren().addAll(r1, r2, r3); sp.getChildren().addAll(rectangle, hbox); return new Group(sp); }
private void createUi() { getStyleClass().add(TITLE_BAR_STYLE_CLASS); setAlignment(Pos.CENTER_RIGHT); setMaxWidth(Double.MAX_VALUE); Region selectedBar = new Region(); selectedBar.getStyleClass().add(HIGHLIGHT_STYLE_CLASS); selectedBar.setMinWidth(Region.USE_PREF_SIZE); selectedBar.setMaxHeight(Region.USE_PREF_SIZE); selectedBar.setMaxWidth(Double.MAX_VALUE); StackPane.setAlignment(selectedBar, Pos.BOTTOM_CENTER); StackPane labelPane = new StackPane(label, selectedBar); labelPane.setMaxHeight(Double.MAX_VALUE); labelPane.setMaxWidth(Region.USE_PREF_SIZE); Region filler = new Region(); HBox.setHgrow(filler, Priority.ALWAYS); rightLabel.getStyleClass().setAll(RIGHT_LABEL_STYLE_CLASS); new FadeInAnimator().apply(expanded, selectedBar); new FadeInAnimator().apply(expanded, rightLabel); getChildren().addAll(labelPane, filler, rightLabel); }
/** * Shows this dialog. * * @param owner the owner. */ @FXThread public void show(@NotNull final Window owner) { final Scene scene = owner.getScene(); if (scene instanceof EditorFXScene) { final EditorFXScene editorFXScene = (EditorFXScene) scene; final StackPane container = editorFXScene.getContainer(); container.setFocusTraversable(false); } focusOwner = scene.getFocusOwner(); dialog.initOwner(owner); dialog.show(); dialog.requestFocus(); GAnalytics.sendPageView(getDialogId(), null, "/dialog/" + getDialogId()); GAnalytics.sendEvent(GAEvent.Category.DIALOG, GAEvent.Action.DIALOG_OPENED, getDialogId()); final JFXApplication application = JFXApplication.getInstance(); application.addWindow(dialog); Platform.runLater(dialog::sizeToScene); }
public static Node createIconContent() { StackPane sp = new StackPane(); FlowPane fp = new FlowPane(); fp.setAlignment(Pos.CENTER); Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); fp.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle[] littleRecs = new Rectangle[4]; Rectangle[] bigRecs = new Rectangle[4]; for (int i = 0; i < 4; i++) { littleRecs[i] = new Rectangle(14, 14, Color.web("#1c89f4")); bigRecs[i] = new Rectangle(16, 12, Color.web("#349b00")); fp.getChildren().addAll(littleRecs[i], bigRecs[i]); FlowPane.setMargin(littleRecs[i], new Insets(2, 2, 2, 2)); } sp.getChildren().addAll(rectangle, fp); return new Group(sp); }
public static Node createIconContent() { StackPane sp = new StackPane(); AnchorPane anchorPane = new AnchorPane(); Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); anchorPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4")); Rectangle r2 = new Rectangle(45, 10, Color.web("#349b00")); Rectangle r3 = new Rectangle(35, 14, Color.web("#349b00")); anchorPane.getChildren().addAll(r1, r2, r3); AnchorPane.setTopAnchor(r1, Double.valueOf(1)); AnchorPane.setLeftAnchor(r1, Double.valueOf(1)); AnchorPane.setTopAnchor(r2, Double.valueOf(20)); AnchorPane.setLeftAnchor(r2, Double.valueOf(1)); AnchorPane.setBottomAnchor(r3, Double.valueOf(1)); AnchorPane.setRightAnchor(r3, Double.valueOf(5)); sp.getChildren().addAll(rectangle, anchorPane); return new Group(sp); }
private void addState(State<?,?> state, HBox line, Color color, int stateIndex, String stateDescription) { final Rectangle rectangle = new Rectangle(WIDTH, WIDTH, color); rectangle.setArcHeight(WIDTH); rectangle.setArcWidth(WIDTH); rectangle.setUserData(state); Label text = new Label(computeStateLabel(stateIndex)); text.setTextOverrun(OverrunStyle.ELLIPSIS); text.setAlignment(Pos.CENTER); text.setMouseTransparent(true); text.setTextFill(Color.WHITE); text.setFont(STATE_FONT); text.setMaxWidth(WIDTH); final Tooltip tooltip = new Tooltip(stateDescription); Tooltip.install(rectangle, tooltip); StackPane layout = new StackPane(); StackPane.setMargin(rectangle, MARGIN_INSETS); layout.getChildren().addAll(rectangle, text); line.getChildren().add(layout); }
@Override @FXThread protected void createContent(@NotNull final StackPane root) { createEditorAreaPane(); mainSplitContainer = new EditorToolSplitPane(JFX_APPLICATION.getScene(), root); editorToolComponent = new ScrollableEditorToolComponent(mainSplitContainer, 1); editorToolComponent.prefHeightProperty().bind(root.heightProperty()); createToolComponents(editorToolComponent, root); editorToolComponent.addChangeListener((observable, oldValue, newValue) -> processChangeTool(oldValue, newValue)); editorToolComponent.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) -> { final S editorState = getEditorState(); if (editorState != null) editorState.setOpenedTool(newValue.intValue()); }); mainSplitContainer.initFor(editorToolComponent, getEditorAreaPane()); FXUtils.addToPane(mainSplitContainer, root); FXUtils.addClassTo(mainSplitContainer, CSSClasses.FILE_EDITOR_MAIN_SPLIT_PANE); }
private void initGraphics() { // prefill matrix with dotOffColor for (int y = 0 ; y < rows ; y++) { for (int x = 0 ; x < cols ; x++) { matrix[x][y] = dotOffColor; } } 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(preferredWidth, preferredHeight); } } canvas = new Canvas(preferredWidth, preferredHeight); ctx = canvas.getGraphicsContext2D(); pane = new StackPane(canvas); getChildren().setAll(pane); }
private JMEFilePreviewManager() { this.imageView = new ImageView(); this.testBox = new Geometry("Box", new Box(2, 2, 2)); this.modelNode = new Node("Model Node"); final ExecutorManager executorManager = ExecutorManager.getInstance(); executorManager.addFXTask(() -> { final JFXApplication application = JFXApplication.getInstance(); final EditorFXScene scene = application.getScene(); final StackPane container = scene.getHideLayer(); FXUtils.addToPane(imageView, container); TangentGenerator.useMikktspaceGenerator(testBox); final JMEThreadExecutor executor = JMEThreadExecutor.getInstance(); executor.addToExecute(this::prepareScene); }); }
@Override public void start(Stage stage) throws Exception { dialogHeader = new DialogHeader(); dialogHeader.setTitle("Dialog Title"); dialogHeader.setHint("Some dialog hint here"); BorderPane root = new BorderPane(); root.setTop(dialogHeader); StackPane center = new StackPane(new Text("dialog content")); center.setPrefHeight(500); root.setCenter(center); Scene scene = new Scene(root, 500, 600); stage.setScene(scene); stage.show(); }
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(); }
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World!"); Button btn = new Button(); btn.setText("Say 'Hello World'"); btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println("Hello World!"); } }); StackPane root = new StackPane(); root.getChildren().add(btn); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); }
@Override public void start(Stage primaryStage) { DrawBuilder drawBuilder = new DrawBuilder(); drawBuilder.setColorPicker(new RainbowColorPicker()); Canvas canvas = drawBuilder.createCanvas(canvasDimension); StackPane root = new StackPane(); root.getChildren().add(canvas); Scene scene = new Scene(root, canvasDimension.getWidth(), canvasDimension.getHeight()); primaryStage.setTitle(this.getClass().getSimpleName()); primaryStage.setScene(scene); primaryStage.setOnCloseRequest((WindowEvent we) -> System.exit(0)); primaryStage.show(); }
private void initUi() { root.getStylesheets().add(getClass().getResource(STYLESHEET).toExternalForm()); root.getStyleClass().add(STYLE_CLASS); playButton.setGraphic(Svg.PLAY.node()); pauseButton.setGraphic(Svg.PAUSE.node()); stopButton.setGraphic(Svg.STOP.node()); HBox labelBox = new HBox(currentTimeLabel, finalTimeLabel); labelBox.setMaxWidth(Region.USE_PREF_SIZE); labelBox.setAlignment(Pos.CENTER_LEFT); StackPane.setAlignment(labelBox, Pos.CENTER_RIGHT); currentTimeLabel.getStyleClass().add(CURRENT_TIME_LABEL_STYLE_CLASS); HBox buttonBox = new HBox(playButton, pauseButton, stopButton); buttonBox.getStyleClass().add(BUTTON_BOX_STYLE_CLASS); buttonBox.setMaxWidth(Region.USE_PREF_SIZE); root.getChildren().addAll(buttonBox, labelBox); }
public void replace(StackPane main_center,Fragment fragment){ fragment.isAdded = true; fragment.onCreate(fragment.getArguments()); Parent node = fragment.onCreateView(fragment.getArguments()); fragment.setView(node); main_center.getChildren().clear(); main_center.getChildren().add(node); }
private void toFragment(StackPane main_center,Fragment to) { if(lastFragment == to) return; if(!to.isAdded()){ transaction.hide(lastFragment).add(main_center,to); }else{ transaction.hide(lastFragment).show(to); } lastFragment = to; }
private void initLooks(){ rectangle.setStrokeWidth(STROKE_WIDTH); rectangle.setFill(Color.LIGHTSKYBLUE); rectangle.setStroke(Color.BLACK); StackPane.setAlignment(title, Pos.CENTER); VBox.setMargin(values, new Insets(5,0,0,5)); }
public CircularDirectionIndicator(String name, double radius){ this.name = name; this.radius = radius; root = new VBox(); StackPane graphicalData = new StackPane(); graphicalData.setMaxSize(radius * 2, radius * 2); lineBox = new Canvas(); outerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius); outerCircle.setFill(Color.TRANSPARENT); outerCircle.setStroke(Color.BLACK); /*innerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius * 0.5); innerCircle.setFill(Color.TRANSPARENT); innerCircle.setStroke(Color.BLACK);*/ lineBox.setWidth(radius * 2); lineBox.setHeight(radius * 2); graphicalData.getChildren().addAll(outerCircle, lineBox); valLbl = new Label(name+": 0.0"); valLbl.setMinWidth(radius * 2); valLbl.setTextAlignment(TextAlignment.CENTER); HBox labalBox = new HBox(); labalBox.getChildren().add(valLbl); labalBox.setAlignment(Pos.CENTER); root.setAlignment(Pos.CENTER); root.setSpacing(2.0); root.getChildren().addAll(labalBox, graphicalData); setValue(0); }
@Override public void start(Stage stage) { StackPane pane = new StackPane(graph); pane.setPadding(new Insets(10)); pane.setBackground(new Background(new BackgroundFill(Color.rgb(40, 40, 40), CornerRadii.EMPTY, Insets.EMPTY))); Scene scene = new Scene(pane); stage.setTitle("Radial Chart"); stage.setScene(scene); stage.show(); timer.start(); }
@Override public void start(Stage primaryStage) throws Exception { CalendarView calendarView = new CalendarView(); Calendar katja = new Calendar("Katja"); Calendar dirk = new Calendar("Dirk"); Calendar philip = new Calendar("Philip"); Calendar jule = new Calendar("Jule"); Calendar armin = new Calendar("Armin"); Calendar birthdays = new Calendar("Birthdays"); Calendar holidays = new Calendar("Holidays"); katja.setShortName("K"); dirk.setShortName("D"); philip.setShortName("P"); jule.setShortName("J"); armin.setShortName("A"); birthdays.setShortName("B"); holidays.setShortName("H"); katja.setStyle(Style.STYLE1); dirk.setStyle(Style.STYLE2); philip.setStyle(Style.STYLE3); jule.setStyle(Style.STYLE4); armin.setStyle(Style.STYLE5); birthdays.setStyle(Style.STYLE6); holidays.setStyle(Style.STYLE7); CalendarSource familyCalendarSource = new CalendarSource("Family"); familyCalendarSource.getCalendars().addAll(birthdays, holidays, katja, dirk, philip, jule, armin); calendarView.getCalendarSources().setAll(familyCalendarSource); calendarView.setRequestedTime(LocalTime.now()); StackPane stackPane = new StackPane(); stackPane.getChildren().addAll(calendarView); // introPane); Thread updateTimeThread = new Thread("Calendar: Update Time Thread") { @Override public void run() { while (true) { Platform.runLater(() -> { calendarView.setToday(LocalDate.now()); calendarView.setTime(LocalTime.now()); }); try { // update every 10 seconds sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } } } }; updateTimeThread.setPriority(Thread.MIN_PRIORITY); updateTimeThread.setDaemon(true); updateTimeThread.start(); Scene scene = new Scene(stackPane); primaryStage.setTitle("Calendar"); primaryStage.setScene(scene); primaryStage.setWidth(1300); primaryStage.setHeight(1000); primaryStage.centerOnScreen(); primaryStage.show(); }
@Override public void start(Stage stage) { StackPane pane = new StackPane(yChart); //StackPane pane = new StackPane(xyChart); pane.setPadding(new Insets(10)); Scene scene = new Scene(new StackPane(pane)); stage.setTitle("Charts"); stage.setScene(scene); stage.show(); timer.start(); }
@Override @FXThread protected void initialize(@NotNull final ImageView node, @NotNull final StackPane pane) { super.initialize(node, pane); node.fitHeightProperty().bind(pane.heightProperty().subtract(2)); node.fitWidthProperty().bind(pane.widthProperty().subtract(2)); }
public TextValidatorSample() { String validatorCss = TextValidatorSample.class.getResource("Validators.css").toExternalForm(); TextField dateField = new TextField(); dateField.setPromptText("Enter a Large Number"); dateField.setMaxHeight(TextField.USE_PREF_SIZE); TextInputValidatorPane<TextField> pane = new TextInputValidatorPane<TextField>(); pane.setContent(dateField); pane.setValidator(new Validator<TextField>() { public ValidationResult validate(TextField control) { try { String text = control.getText(); if (text == null || text.trim().equals("")) return null; double d = Double.parseDouble(text); if (d < 1000) { return new ValidationResult("Should be > 1000", ValidationResult.Type.WARNING); } return null; // succeeded } catch (Exception e) { // failed return new ValidationResult("Bad number", ValidationResult.Type.ERROR); } } }); StackPane rootSP = new StackPane(); rootSP.setPadding(new Insets(12)); rootSP.getChildren().add(pane); pane.getStylesheets().add(validatorCss); getChildren().add(rootSP); }
private static void build(@NotNull final EditorFXScene scene, @NotNull final StackPane container, @NotNull final Stage stage) { final ImageView canvas = scene.getCanvas(); final EditorMenuBarComponent barComponent = new EditorMenuBarComponent(); final EditorAreaComponent editorAreaComponent = new EditorAreaComponent(); new EventRedirector(editorAreaComponent, canvas, stage); final GlobalLeftToolSplitPane leftSplitContainer = new GlobalLeftToolSplitPane(scene); leftSplitContainer.prefHeightProperty().bind(container.heightProperty()); final GlobalBottomToolSplitPane bottomSplitContainer = new GlobalBottomToolSplitPane(scene); final GlobalLeftToolComponent globalLeftToolComponent = new GlobalLeftToolComponent(leftSplitContainer); globalLeftToolComponent.addComponent(new AssetComponent(), Messages.EDITOR_TOOL_ASSET); final GlobalBottomToolComponent globalBottomToolComponent = new GlobalBottomToolComponent(bottomSplitContainer); globalBottomToolComponent.addComponent(LogView.getInstance(), Messages.LOG_VIEW_TITLE); leftSplitContainer.initFor(globalLeftToolComponent, bottomSplitContainer); bottomSplitContainer.initFor(globalBottomToolComponent, editorAreaComponent); // to fix with layout bottom panel bottomSplitContainer.heightProperty() .addListener((observable, oldValue, newValue) -> runLater(editorAreaComponent::requestLayout)); FXUtils.addToPane(new VBox(barComponent, leftSplitContainer), container); FXUtils.bindFixedWidth(leftSplitContainer, container.widthProperty()); FXUtils.bindFixedWidth(barComponent, container.widthProperty()); FXUtils.addClassTo(leftSplitContainer, bottomSplitContainer, CSSClasses.MAIN_SPLIT_PANEL); UIUtils.overrideTooltipBehavior(1000, 5000, 100); }
public static Node createIconContent() { StackPane sp = new StackPane(); Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); sp.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle biggerRec = new Rectangle(55, 55, Color.web("#1c89f4")); Rectangle smallerRec = new Rectangle(35, 35, Color.web("#349b00")); sp.getChildren().addAll(rectangle, biggerRec, smallerRec); return new Group(sp); }
@Override public void start(Stage stage) { StackPane pane = new StackPane(pixelMatrix); pane.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); pane.setPadding(new Insets(10)); Scene scene = new Scene(pane); stage.setTitle("MatrixPlot"); stage.setScene(scene); stage.show(); timer.start(); }
protected Node wrap(Node node) { StackPane stackPane = new StackPane(); stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;"); stackPane.getChildren().add(node); HBox box = new HBox(); box.setAlignment(Pos.CENTER); box.setFillHeight(false); box.getChildren().add(stackPane); return box; }
@Override public Point2D _getMidpoint() { StackPane tabRegion = getTabRegion(); Bounds boundsInParent = tabRegion.getBoundsInParent(); double x = boundsInParent.getWidth() / 2; double y = boundsInParent.getHeight() / 2; return tabRegion.localToParent(x, y); }
private StackPane buildBoxRequisitos(RequisitoEntity requisito) { VBox vbox = new VBox(7); vbox.setAlignment(Pos.CENTER); vbox.getChildren().add(new Text(requisito.toString())); StackPane caixa = new StackPane(vbox); return caixa; }
@Override public void start(Stage stage) throws Exception { StackPane sp = new StackPane(); sp.getChildren().add(createDemoNode()); Scene scene = new Scene(sp, 768, 512); stage.setScene(scene); stage.setTitle("Orson Charts: XYZLineChart3DFXDemo1.java"); stage.show(); }
public StackPaneSample() { StackPane stackPane = new StackPane(); Rectangle rectangle = new Rectangle(280, 70, Color.BISQUE); rectangle.setStroke(Color.BLACK); ImageView imageView = new ImageView(ICON_48); Label label = new Label("Your name could be here.", imageView); label.setContentDisplay(ContentDisplay.RIGHT); stackPane.getChildren().addAll(rectangle, label); getChildren().add(stackPane); }
@Override public void start(Stage stage) throws Exception { StackPane sp = new StackPane(); sp.getChildren().add(createDemoNode()); Scene scene = new Scene(sp, 768, 512); stage.setScene(scene); stage.setTitle("Orson Charts: SurfaceRendererFXDemo2.java"); stage.show(); }