public ActionTextPane() { actionText = new Label("Test"); graphic = new ImageView(new Image("assets/icons/editor_action_info_icon.png")); actionText.setGraphic(graphic); actionText.setTextFill(Utils.getDefaultTextColor()); actionText.setAlignment(Pos.CENTER); actionText.setPadding(new Insets(0, 0, 0, 5)); getChildren().add(actionText); setAlignment(Pos.CENTER); ft = new FadeTransition(Duration.millis(500), graphic); ft.setFromValue(1.0); ft.setToValue(0.0); ft.setAutoReverse(true); ft.setCycleCount(4); }
public Parent constructContainer () { this.getWindow().setTitle(Globals.appTitle+"Hilfe"+Globals.appVersion); this.getWindow().setResizable(false); impressumBtn.setOnAction(e -> getFXController().showView("impressumview")); quizletBtn.setOnAction(e -> getFXController().showView("quizletview")); anleitungBtn.setOnAction(e -> getFXController().showView("manualview")); indexBtn.setOnAction(e -> getFXController().showView("troubleshootview")); logBtn.setOnAction(e -> getFXController().showView("logview")); tempVBox.setId("helpbox"); tempVBox.setPadding(new Insets(10)); tempVBox.setSpacing(5); tempVBox.setAlignment(Pos.CENTER); tempVBox.getChildren().addAll(impressumBtn, quizletBtn, anleitungBtn, indexBtn, logBtn, closeBtn); VBox.setMargin(impressumBtn, new Insets(50,0,0,0)); return tempVBox; }
/** * 将自己的对话添加到对话列表中 * @param content */ public void addYourMessges(String content){ Platform.runLater(() ->{ //寻找用户的头像名 Image image = new Image("images/" + userPic); ImageView profileImage = new ImageView(image); profileImage.setFitHeight(32); profileImage.setFitWidth(32); BubbledTextFlow yourBubbled = new BubbledTextFlow(EmojiDisplayer.createEmojiAndTextNode(content)); yourBubbled.setBackground(new Background(new BackgroundFill(Color.LIGHTGREEN, null, null))); HBox x = new HBox(); x.setMaxWidth(chatPaneListView.getWidth() - 20); x.setAlignment(Pos.TOP_RIGHT); yourBubbled.setBubbleSpec(BubbleSpec.FACE_RIGHT_CENTER); x.getChildren().addAll(yourBubbled, profileImage); chatPaneListView.getItems().add(x); }); }
public static Node createIconContent() { StackPane sp = new StackPane(); VBox vbox = new VBox(3); vbox.setAlignment(Pos.CENTER); vbox.setPadding(new Insets(5, 5, 5, 5)); Rectangle rectangle = new Rectangle(32, 62, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); vbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle r1 = new Rectangle(18, 14, Color.web("#1c89f4")); Rectangle r2 = new Rectangle(18, 14, Color.web("#349b00")); Rectangle r3 = new Rectangle(18, 20, Color.web("#349b00")); vbox.getChildren().addAll(r1, r2, r3); sp.getChildren().addAll(rectangle, vbox); return new Group(sp); }
private void initProgressBarUI() { Label runLabel = new Label("Runs: "); runLabel.setMinWidth(Region.USE_PREF_SIZE); nRuns = new Text((int) progress + "/" + maxTestCount); Label errorLabel = new Label("Errors: "); errorLabel.setMinWidth(Region.USE_PREF_SIZE); errorLabel.setGraphic(FXUIUtils.getIcon("error")); errorLabel.setPadding(new Insets(0, 0, 0, 80)); errorText = new Text(errors + ""); Label failureLabel = new Label("Failures: "); failureLabel.setMinWidth(Region.USE_PREF_SIZE); failureLabel.setGraphic(FXUIUtils.getIcon("failure")); failureLabel.setPadding(new Insets(0, 0, 0, 80)); failureText = new Text(failures + ""); progressBarString.setAlignment(Pos.CENTER); progressBarString.setPadding(new Insets(5, 0, 5, 0)); progressBarString.getChildren().addAll(runLabel, nRuns, errorLabel, errorText, failureLabel, failureText); }
@Override public Parent constructContainer () { headLbl = new Label("Umbenennen"); headLbl.setId("bold"); AppButton backBtn = new AppButton("_Zur�ck"); backBtn.setOnAction(e -> getFXController().showView("doorview")); BorderPane headLayout = new BorderPane(headLbl); headLayout.setPadding(new Insets(0, 0, 25, 0)); renameLayout.setPadding(new Insets(10)); renameLayout.setAlignment(Pos.TOP_CENTER); scroller.setMaxWidth(600); scroller.setFitToWidth(true); scroller.setPadding(new Insets(25)); MainLayout maLay = new MainLayout(scroller, headLayout, new ControlLayout(backBtn)); getFXController().getModel("stack").registerView(this); return maLay; }
public static Node createIconContent() { StackPane sp = new StackPane(); TilePane iconTilePane = new TilePane(); iconTilePane.setAlignment(Pos.CENTER); Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY); rectangle.setStroke(Color.BLACK); iconTilePane.setPrefSize(rectangle.getWidth(), rectangle.getHeight()); Rectangle[] rec = new Rectangle[9]; for (int i = 0; i < rec.length; i++) { rec[i] = new Rectangle(14, 14, Color.web("#349b00")); TilePane.setMargin(rec[i], new Insets(2, 2, 2, 2)); } iconTilePane.getChildren().addAll(rec); sp.getChildren().addAll(rectangle, iconTilePane); return new Group(sp); }
@Override protected void initView () { double spacing = getParser().parseDouble(getMyNumbers().getString("HBoxSpacing")); HBox header = getMyUIFactory().makeHBox(spacing, Pos.CENTER, myRemove.draw(), getSubTitleDisplay()); HBox angles = getMyUIFactory().makeHBox(spacing, Pos.CENTER, myDecrease.draw(), myIncrease.draw(), myFire.draw()); HBox fireParams = getMyUIFactory().makeHBox(spacing, Pos.CENTER, myMissileSelectionView.draw(), myAngle.draw(), myAngleStep.draw()); HBox rangeParams = getMyUIFactory().makeHBox(spacing, Pos.CENTER, myWaitTime.draw(), myIsRanged.draw(), myRangeValue.draw()); myPane = getMyUIFactory().makeVBox(spacing, Pos.CENTER, header, angles, fireParams, rangeParams); getMyUIFactory().addStyling(myPane, "Firer"); }
private static HBox setupSignUpAndSubmitButtons() { HBox signUpAndSubmitButtons = new HBox(10); submitButton.setOnAction(e -> { Home.display(); window.close(); }); signUpButton.setOnAction(e -> { Home.display(); window.close(); }); signUpAndSubmitButtons.getChildren().addAll(submitButton, signUpButton); signUpAndSubmitButtons.setAlignment(Pos.CENTER); return signUpAndSubmitButtons; }
private StackPane buildBoxHorarios(List<Horario> horarios) { VBox vbox = new VBox(7); vbox.setAlignment(Pos.CENTER); Rectangle rect = new Rectangle(150, 100); rect.setStroke(Color.BLACK); rect.setStrokeWidth(2); rect.setFill(Color.TRANSPARENT); for (Horario horario : horarios) { vbox.getChildren().add(new Text(horario.getEstampa())); } StackPane caixa = new StackPane(rect, vbox); return caixa; }
/** * Create gamma correction control. */ @FXThread private void createGammaCorrectionControl(@NotNull final VBox root) { final HBox container = new HBox(); container.setAlignment(Pos.CENTER_LEFT); final Label gammaCorrectionLabel = new Label(Messages.SETTINGS_DIALOG_GAMMA_CORRECTION + ":"); gammaCorrectionCheckBox = new CheckBox(); gammaCorrectionCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> validate()); FXUtils.addToPane(gammaCorrectionLabel, container); FXUtils.addToPane(gammaCorrectionCheckBox, container); FXUtils.addToPane(container, root); FXUtils.addClassTo(gammaCorrectionLabel, CSSClasses.SETTINGS_DIALOG_LABEL); FXUtils.addClassTo(gammaCorrectionCheckBox, CSSClasses.SETTINGS_DIALOG_FIELD); }
/** * Creates the Horizontal box container that will contains the NodeBox * icon. * @return Horizontal box container. */ public HBox createContainer(){ this.container = new HBox(); this.container.setAlignment(Pos.CENTER); this.container.setMinSize(getMinWidth(),getMinHeight()); this.getActionIcon().setSmooth(true); this.actionBtn = new Button(); this.actionBtn.setGraphic(getActionIcon()); this.actionBtn.setMinSize(getActionIcon().getFitWidth(), getActionIcon().getFitHeight()); this.actionBtn.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,null,null))); this.container.getChildren().add(actionBtn); return container; }
@Override public void start(Stage stage) { VBox vbox = new VBox(); Scene scene = new Scene(vbox); stage.setTitle("Hyperlink Sample"); stage.setWidth(570); stage.setHeight(550); selectedImage.setLayoutX(100); selectedImage.setLayoutY(10); final WebView browser = new WebView(); final WebEngine webEngine = browser.getEngine(); for (int i = 0; i < captions.length; i++) { final Hyperlink hpl = hpls[i] = new Hyperlink(captions[i]); final Image image = images[i] = new Image(getClass().getResourceAsStream(imageFiles[i])); hpl.setGraphic(new ImageView (image)); hpl.setFont(Font.font("Arial", 14)); final String url = urls[i]; hpl.setOnAction((ActionEvent e) -> { webEngine.load(url); }); } HBox hbox = new HBox(); hbox.setAlignment(Pos.BASELINE_CENTER); hbox.getChildren().addAll(hpls); vbox.getChildren().addAll(hbox, browser); VBox.setVgrow(browser, Priority.ALWAYS); stage.setScene(scene); stage.show(); }
/** * Create the anisotropy control */ @FXThread private void createAnisotropyControl(@NotNull final VBox root) { final HBox container = new HBox(); container.setAlignment(Pos.CENTER_LEFT); final Label label = new Label(Messages.SETTINGS_DIALOG_ANISOTROPY + ":"); anisotropyComboBox = new ComboBox<>(); anisotropyComboBox.prefWidthProperty().bind(root.widthProperty()); anisotropyComboBox.getSelectionModel() .selectedItemProperty() .addListener((observable, oldValue, newValue) -> validate()); FXUtils.addToPane(label, container); FXUtils.addToPane(anisotropyComboBox, container); FXUtils.addToPane(container, root); FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL); FXUtils.addClassTo(anisotropyComboBox, CSSClasses.SETTINGS_DIALOG_FIELD); final ObservableList<Integer> items = anisotropyComboBox.getItems(); items.addAll(ANISOTROPYCS); }
private void displayAuxObjects() { // Format btnTitleScreen btnTitleScreen.setPrefSize(WIDTH / 4, HEIGHT / 10); btnTitleScreen.setAlignment(Pos.CENTER); // Format txtSelectClass txtSelectClass.setFill(Color.rgb(234, 234, 234)); txtSelectClass.setFont(Font.font("Verdana", FontWeight.BOLD, 50)); // Modify vbTopObjects vbTopObjects = new VBox(WIDTH / 100); vbTopObjects.getChildren().addAll(btnTitleScreen, txtSelectClass); vbTopObjects.setAlignment(Pos.CENTER); this.setTop(vbTopObjects); }
public CheckBoxControl(String name) { super(name, FlashboardSendableType.CHECKBOX); checkBox = new CheckBox(name); checkBox.selectedProperty().addListener((obs, o, n)->{ if(localChange) return; synchronized (valueMutex) { lChanged = true; value = n.booleanValue(); send[0] = (byte) (value? 1: 0); } }); root = new VBox(); root.setAlignment(Pos.CENTER); root.getChildren().add(checkBox); }
public void displayAlert(String title, String message) { Stage window = new Stage(); window.setResizable(false); window.setMinWidth(200); window.initModality(Modality.APPLICATION_MODAL); window.setTitle(title); Label label = new Label(); label.setText(message); Button closeButton = new Button("Ok"); closeButton.setOnAction(e -> window.close()); VBox layout = new VBox(10); layout.setPadding(new Insets(20)); layout.getChildren().addAll(label, closeButton); layout.setAlignment(Pos.CENTER); Scene scene = new Scene(layout); window.setScene(scene); window.showAndWait(); }
/** * Create stop render control. */ @FXThread private void createStopRenderControl(@NotNull final VBox root) { final HBox container = new HBox(); container.setAlignment(Pos.CENTER_LEFT); final Label label = new Label(Messages.SETTINGS_DIALOG_STOP_RENDER_ON_LOST_FOCUS + ":"); stopRenderOnLostFocusCheckBox = new CheckBox(); stopRenderOnLostFocusCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> validate()); FXUtils.addToPane(label, container); FXUtils.addToPane(stopRenderOnLostFocusCheckBox, container); FXUtils.addToPane(container, root); FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL); FXUtils.addClassTo(stopRenderOnLostFocusCheckBox, CSSClasses.SETTINGS_DIALOG_FIELD); }
private void initUi() { root.setMinSize(0, 0); root.setPrefSize(1, 1); // Decouple from children. root.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); root.getStyleClass().add(STYLE_CLASS); root.getStylesheets().add(getClass().getResource(STYLESHEET).toExternalForm()); root.setAlignment(Pos.TOP_LEFT); root.getChildren().addAll(panningComponent.getRoot(), addButton); panningComponent.getChildren().addAll(sceneContent, resizerComponent.getRoot(), selectionBox.getRoot()); StackPane.setMargin(addButton, new Insets(15)); addButton.setGraphic(Svg.PLUS_FAT.node()); addButton.setFocusTraversable(false); FocusHelper.requestFocusOnPress(panningComponent.getRoot()); }
public DateCellSkin(final DateCell control) { this.dateCell = control; button = new Button(); button.textProperty().bind(control.textProperty()); button.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); button.setAlignment(Pos.CENTER); button.setMinWidth(30); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { control.getCalendarView().setSelectedDate(control.getItem()); } }); button.tooltipProperty().bind(control.tooltipProperty()); getChildren().add(button); }
public void initialize() { packList = new VBox(); packList.setMinWidth(400); packList.setPrefWidth(400); packList.setMaxWidth(400); packList.setAlignment(Pos.CENTER); searchPopOver = new PopOver(packList); searchPopOver.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER); searchPopOver.setAutoHide(false); txtSearch.textProperty().addListener((observable, oldValue, newValue) -> search()); txtSearch.focusedProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { search(); } else { searchPopOver.hide(); } }); }
/** * Create the open GL control */ @FXThread private void createOpenGLControl(@NotNull final VBox root) { final HBox container = new HBox(); container.setAlignment(Pos.CENTER_LEFT); final Label label = new Label(Messages.SETTINGS_DIALOG_OPEN_GL_LABEL + ":"); openGLVersionComboBox = new ComboBox<>(); openGLVersionComboBox.prefWidthProperty().bind(root.widthProperty()); openGLVersionComboBox.getSelectionModel() .selectedItemProperty() .addListener((observable, oldValue, newValue) -> validate()); FXUtils.addToPane(label, container); FXUtils.addToPane(openGLVersionComboBox, container); FXUtils.addToPane(container, root); FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL); FXUtils.addClassTo(openGLVersionComboBox, CSSClasses.SETTINGS_DIALOG_FIELD); final ObservableList<OpenGLVersion> items = openGLVersionComboBox.getItems(); items.addAll(GL_VERSIONS); }
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); }
@Override public Parent constructContainer() { bp.setId("loginviewbg"); list = new ListView<String>(); items = FXCollections.observableArrayList("Philippe Kr�ttli","Irina Deck","Javier Martinez Alvarez","Frithjof Hoppe"); list.setItems(items); AllFields = new VBox(50); AllFields.setAlignment(Pos.CENTER); AllFields.setMaxWidth(300); AllFields.setPadding(new Insets(20)); GroupName = new HBox(50); Option = new HBox(50); name = new Label("Name:"); groupname = new Label("{Gruppenname}"); btnAdd = new AppButton("Hinzuf�gen"); btnRemove = new AppButton("Entfernen"); back = new BackButton(getFXController(),"Zur�ck"); GroupName.getChildren().addAll(name,groupname); Option.getChildren().addAll(back,btnAdd,btnRemove); AllFields.getChildren().addAll(GroupName,Option,list); bp.setCenter(AllFields); back.setOnAction(e -> getFXController().showView("groupview")); btnAdd.setOnAction(e -> getFXController().showView("userlistview")); btnRemove.setOnAction(e -> { Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Mitglied l�schen"); alert.setHeaderText("Sie sind gerade dabei ein Mitglied aus der Gruppe zu entfernen."); alert.setContentText("Sind Sie sich sicher, dass sie das tun wollen?"); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK){ // ... user chose OK } else { Alert noDeletion = new Alert(AlertType.INFORMATION); noDeletion.setTitle("L�schvorgang abgebrochen"); noDeletion.setHeaderText("Mitglied nicht gel�scht"); noDeletion.setContentText("Der L�schvorgang wurde abgebrochen."); noDeletion.showAndWait(); alert.close(); }}); return bp; }
/** * For subclasses to alter the HBox not the node * * @param profile * @return */ protected HBox getHBox (E profile) { HBox container = new HBox(myParser.parseDouble(myNumbers.getString("HBoxStandardSize"))); container.setAlignment(Pos.CENTER_LEFT); container.getChildren().add(createImageProfile(profile.getProfile(), PIC_SIZE)); container.getChildren().add(createTextProfile(profile.getProfile())); return container; }
public WizardStep(final String stepName) { this.setStepName(stepName); this.setData(Maps.newHashMap()); this.toValidate = Lists.newArrayList(); this.setHgap(10); this.setVgap(10); this.setPadding(new Insets(20, 24, 24, 24)); this.setAlignment(Pos.CENTER); }
@Override protected void initView () { double spacing = getParser().parseDouble(getMyNumbers().getString("HBoxSpacing")); myContainer = getMyUIFactory().makeHBox(spacing, Pos.CENTER, myEvents.draw(), myRemove.draw()); }
@SuppressWarnings("unchecked") private void configureBox(HBox root) { StackPane container = new StackPane(); //container.setPrefHeight(700); container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight()); container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;"); table= new TableView<AttClass>(); Label lview= new Label(); lview.setText("View Records"); lview.setId("lview"); bottomPane= new VBox(); tclock= new Text(); tclock.setId("lview"); //tclock.setFont(Font.font("Calibri", 20)); final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { tclock.setText(DateFormat.getDateTimeInstance().format(new Date())); } })); timeline.setCycleCount(Animation.INDEFINITE); timeline.play(); bottomPane.getChildren().addAll(tclock,lview); bottomPane.setAlignment(Pos.CENTER); //table pane namecol= new TableColumn<>("First Name"); namecol.setMinWidth(170); namecol.setCellValueFactory(new PropertyValueFactory<>("name")); admcol= new TableColumn<>("Identication No."); admcol.setMinWidth(180); admcol.setCellValueFactory(new PropertyValueFactory<>("adm")); typecol= new TableColumn<>("Type"); typecol.setMinWidth(130); typecol.setCellValueFactory(new PropertyValueFactory<>("type")); timecol= new TableColumn<>("Signin"); timecol.setMinWidth(140); timecol.setCellValueFactory(new PropertyValueFactory<>("timein")); datecol= new TableColumn<>("Date"); datecol.setMinWidth(180); datecol.setCellValueFactory(new PropertyValueFactory<>("date")); table.getColumns().addAll(namecol, admcol, typecol, timecol, datecol); table.setItems(getAtt()); att= getAtt(); table.setItems(FXCollections.observableArrayList(att)); table.setMinHeight(500); btnrefresh = new Button("Refresh"); btnrefresh.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { table.setItems(getAtt()); } }); laytable= new VBox(10); laytable.getChildren().addAll(table, btnrefresh); laytable.setAlignment(Pos.TOP_LEFT); container.getChildren().addAll(bottomPane,laytable); setAnimation(); sc.setContent(container); root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)"); root.getChildren().addAll(getActionPane(),sc); //service.start(); }
@Override public Parent constructContainer () { backBtn.setOnAction(e -> { setData(getMyModel().getString(null)); getWindow().getScene().widthProperty().removeListener(event -> { elements.setMinWidth(getWindow().getScene().getWidth() - 80); }); getFXController().showLastView(); }); elements.setPadding(new Insets(30)); elements.setAlignment(Pos.TOP_CENTER); VerticalScroller scroLay = new VerticalScroller(elements, 1); headLabel.setId("bold"); /* backBtn.setOnAction(e -> { setData(); }); */ BorderPane headLayout = new BorderPane(headLabel); headLayout.setPadding(new Insets(0, 0, 25, 0)); MainLayout maLay = new MainLayout(scroLay, headLayout, new ControlLayout(backBtn)); return maLay; }
@Override public void initialize(URL location, ResourceBundle resources) { button.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> { Notifications notify = Notifications.create().title("Downloading") .text("Download Started") .hideAfter(javafx.util.Duration.seconds(5)) .position(Pos.BOTTOM_RIGHT); notify.darkStyle(); notify.show(); }); }
@Override public Parent constructContainer() { bp.setId("loginviewbg"); bottom = new HBox(50); bottom.setAlignment(Pos.CENTER); bottom.setMaxWidth(300); bottom.setPadding(new Insets(20,50,150,280)); AllFields = new VBox(50); AllFields.setAlignment(Pos.CENTER); AllFields.setMaxWidth(300); AllFields.setPadding(new Insets(100,20,20,20)); btnOwnDMO = new AppButton("Eigenes DMO"); btnForeignDMO = new AppButton("Fremdes DMO"); back = new BackButton(getFXController(), "Zur�ck"); home = new HomeButton(getFXController()); AllFields.getChildren().addAll(btnOwnDMO, btnForeignDMO, back, home); bottom.getChildren().addAll(back, home); bp.setCenter(AllFields); bp.setBottom(bottom); btnOwnDMO.setOnAction(e -> getFXController().showView("savedownloaddoorowndmoview")); btnForeignDMO.setOnAction(e -> getFXController().showView("savedownloadstackforeigndmoview")); back.setOnAction(e -> getFXController().showView("serverdoorview")); return bp; }
@Override public Parent constructContainer () { headLbl = new Label(""); headLbl.setId("bold"); AppButton backBtn = new AppButton("_Zur�ck"); backBtn.setOnAction(e -> getFXController().showView("stack")); //Info Button AppButton infobtn = new AppButton("Hilfe"); infobtn.setOnAction(e -> getFXController().showView("bbcodeinfo")); BorderPane headLayout = new BorderPane(headLbl); headLayout.setPadding(new Insets(0, 0, 25, 0)); editLayout.setPadding(new Insets(10)); editLayout.setAlignment(Pos.TOP_CENTER); scroller.setMaxWidth(600); scroller.setFitToWidth(true); scroller.setPadding(new Insets(25)); MainLayout maLay = new MainLayout(scroller, headLayout, new ControlLayout(backBtn, infobtn)); getFXController().getModel("cards").registerView(this); return maLay; }
@Override protected void initView () { myContainer = new GridPane(); myPaneContent = myUIFactory.makeVBox(10, Pos.CENTER, 520, 300, (Node[]) null); myPane = myUIFactory.makeScrollPane(myPaneContent, 525, 310); // TODO: magic number myUIFactory.addStyling(myPane, cssScrollClass); myContainer.add(buttonHolder, 0, 0); myContainer.add(myPane, 0, 1); }
@Override public void start(Stage primaryStage) throws Exception { //设置布局 GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); //增加一个现实密码的Label Label label = new Label(StringResource.PASSWORD_MESSAGE); label.setFont(new Font(19)); grid.add(label, 0, 1); TextField textField = new TextField(Password.genRandomNum(8)); textField.setFont(new Font(19)); grid.add(textField,1,1); //增加一个刷新按钮 Button button = new Button(); button.setText(StringResource.BTN_PASSWORD_REFRESH); button.setOnAction(ActionEvent ->{ String newPassword = Password.genRandomNum(8); System.out.println(StringResource.PASSWORD_MESSAGE + newPassword); textField.setText(newPassword); } ); grid.add(button, 2, 1); Scene scene = new Scene(grid, 535, 60); primaryStage.setScene(scene); primaryStage.setTitle(TITLE); primaryStage.show(); }
private GridPane initGridPane() { GridPane gridPane = new GridPane(); // TextField faddress = new TextField(); faddress.setPromptText("Enter server adders"); faddress.setOnAction(s -> client.makeConnection(faddress.getText())); //text field init TextField textField = new TextField(); textField.setPromptText("Enter command"); textField.setOnAction(s -> { process(textField.getText()); textField.setText(""); }); //btn Button button = new Button("Connect"); button.setOnAction(s -> client.makeConnection(faddress.getText())); gridPane.add(button, 0, 0); gridPane.add(faddress, 1, 0, 1, 1); gridPane.add(clientConsole.view, 0, 1, 2, 1); gridPane.add(textField, 0, 2, 2, 1); gridPane.setAlignment(Pos.CENTER); //grid settings gridPane.setHgap(10); gridPane.setVgap(10); return gridPane; }
private FlowPane getUserButtonsPane() { FlowPane userButtonsPane = new FlowPane(); userButtonsPane.getChildren().add(signInButton); userButtonsPane.getChildren().add(registerButton); userButtonsPane.setAlignment(Pos.CENTER); userButtonsPane.setHgap(10); userButtonsPane.setPadding(new Insets(25, 25, 25, 25)); return userButtonsPane; }
private VBox getActionPane(){ progress= new Text("Office\nEntry Progress"); progress.setTextAlignment(TextAlignment.CENTER); progress.setFont(Font.font("Times New Roman", 35)); lname= new Label("-Your Name here-"); Image iconf= new Image(Office_Entry.class.getResourceAsStream("/pic/finger.png")); ImageView ivconf= new ImageView(iconf); lpic= new Label(); lpic.setGraphic(ivconf); Image img1= new Image(PersonalReports.class.getResourceAsStream("/pic/cross.png")); ImageView imagvw= new ImageView(img1); imagvw.setFitHeight(70); imagvw.setFitWidth(70); lnotexist= new Label("",imagvw); lnotexist.setText("\n\n\n\n\nN/A"); lnotexist.setFont(Font.font("Cooper Black", 15)); lnotexist.setVisible(false); txtfinger= new TextField(); txtfinger.setEditable(false); txtfinger.setMaxWidth(160); txtfinger.setStyle("-fx-background-radius:10; -fx-background-color:#9CD777;"); txtsearch= new TextField(); initFilter(); Button btnView= new Button("View Records"); Button btnCloseView= new Button("Hide Records"); Button btnadd= new Button("save"); btnadd.setOnAction(e -> { setAddAttendance(); }); btnView.setOnAction(e -> { timelineDown.play(); }); btnCloseView.setOnAction(e -> { timelineUp.play(); }); VBox laywrong= new VBox(); laywrong.getChildren().addAll(lnotexist); laywrong.setPadding(new Insets(0,0,0,0)); laywrong.setAlignment(Pos.CENTER); HBox laytest= new HBox(5); laytest.getChildren().addAll(txtfinger /* btnadd*/); laytest.setAlignment(Pos.CENTER); VBox laybtnsearch= new VBox(); laybtnsearch.getChildren().addAll(txtsearch); laybtnsearch.setAlignment(Pos.CENTER); laybtnsearch.setPadding(new Insets(20,0,0,0)); HBox laybtn= new HBox(5); laybtn.getChildren().addAll(btnView, btnCloseView); laybtn.setAlignment(Pos.CENTER); VBox lay1= new VBox(10); lay1.getChildren().addAll(progress, lpic, lname, laytest); lay1.setAlignment(Pos.CENTER); VBox layside= new VBox(25); layside.getChildren().addAll(lay1, laybtn, laybtnsearch, laywrong); layside.setAlignment(Pos.TOP_CENTER); layside.setMinWidth(230); layside.setPadding(new Insets(20,0,10,0)); return layside; }
public HyperlinkSample() { super(400,100); ImageView iv = new ImageView(ICON_48); VBox vbox = new VBox(); vbox.setSpacing(5); vbox.setAlignment(Pos.CENTER_LEFT); Hyperlink h1 = new Hyperlink("Hyperlink"); Hyperlink h2 = new Hyperlink("Hyperlink with Image"); h2.setGraphic(iv); vbox.getChildren().add(h1); vbox.getChildren().add(h2); getChildren().add(vbox); }
private HBox createLastBuildInfoBox( final TileViewModel build ) { final HBox lastBuildInfoPart = new HBox( ); lastBuildInfoPart.setAlignment( Pos.CENTER ); final ImageView lastBuildIcon = new ImageView( UIUtils.createImage( "icons/lastBuild.png" ) ); lastBuildIcon.setPreserveRatio( true ); lastBuildIcon.setFitWidth( 32 ); final Label lastBuildDate = new Label( ); lastBuildDate.setMinWidth( 110 ); lastBuildDate.setTextAlignment( CENTER ); lastBuildDate.setAlignment( Pos.CENTER ); lastBuildDate.setFont( UIUtils.font( 32, FontWeight.BOLD ) ); lastBuildDate.setTextFill( Color.WHITE ); lastBuildDate.setWrapText( true ); lastBuildDate.setLineSpacing( 2 ); // TODO: Seems do not work lastBuildDate.setEffect( UIUtils.shadowEffect( ) ); lastBuildDate.textProperty( ).bind( createStringBinding( ( ) -> { final LocalDateTime localDateTime = build.lastFinishedDateProperty( ).get( ); if ( localDateTime == null ) return "00/00\n00:00"; return localDateTime.format( DateTimeFormatter.ofPattern( "dd/MM\nHH:mm" ) ); }, build.lastFinishedDateProperty( ) ) ); lastBuildInfoPart.getChildren( ).addAll( lastBuildIcon, lastBuildDate ); return lastBuildInfoPart; }
public ControlLayout (Node... nodes) { setAlignment(Pos.CENTER); setPadding(padding); setSpacing(20); getChildren().addAll(nodes); }