List of usage examples for javafx.scene.layout HBox getChildren
@Override
public ObservableList<Node> getChildren()
From source file:de.rkl.tools.tzconv.view.ZoneIdSelectionDialog.java
private Node createZoneIdSelectionBox() { final HBox mainListBox = new HBox(5); partition(newArrayList(ApplicationModel.ZONE_OFFSETS_2_ZONE_IDS.values()), 40).forEach(zoneIds -> { final VBox columnBox = new VBox(5); zoneIds.forEach(zoneId -> {/* ww w . j ava 2s .c o m*/ final CheckBox zoneIdCheckbox = new CheckBox(zoneId.toString()); zoneIdCheckbox.setSelected(applicationModel.selectedZoneIds.contains(zoneId)); zoneIdCheckbox.selectedProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { pendingSelectedZoneIds.add(zoneId); } else { pendingSelectedZoneIds.remove(zoneId); } }); columnBox.getChildren().add(zoneIdCheckbox); zoneIdCheckboxes.add(zoneIdCheckbox); }); mainListBox.getChildren().add(columnBox); }); return mainListBox; }
From source file:FeeBooster.java
private GridPane unsignedTxGrid(Transaction tx) { // Setup Grid GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER);/*www.j ava 2 s.c o m*/ grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); // Instructions Text Text instructions = new Text("Below is the unsiged version of the fee boosted transaction. You can sign " + "this here or copy this transaction and sign it in your wallet"); grid.add(instructions, 0, 0); // Put unsigned transaction in text area byte[] unsignedTxBytes = Transaction.serialize(tx, true); TextArea unsignedTxTxt = new TextArea(Utils.bytesToHex(unsignedTxBytes)); unsignedTxTxt.setWrapText(true); grid.add(unsignedTxTxt, 0, 1); // Radio buttons for sign here or sign elsewhere /*VBox signRadioVbox = new VBox(); ToggleGroup signRadioGroup = new ToggleGroup(); RadioButton signHereRadio = new RadioButton("Sign Here"); signHereRadio.setToggleGroup(signRadioGroup); signRadioVbox.getChildren().add(signHereRadio); RadioButton signWalletRadio = new RadioButton("Sign in my wallet"); signWalletRadio.setToggleGroup(signRadioGroup); signWalletRadio.setSelected(true); signRadioVbox.getChildren().add(signWalletRadio); grid.add(signRadioVbox, 0, 3); */ // Add Next Button Button nextBtn = new Button("Next"); nextBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { //if(signHereRadio.isSelected()) // stage.setScene(new Scene(signTxGrid(tx), 800, 500)); //else if(signWalletRadio.isSelected()) if (sceneCursor == scenes.size() - 1) { Scene scene = new Scene(broadcastTxGrid(tx), 900, 500); scenes.add(scene); sceneCursor++; stage.setScene(scene); } else { sceneCursor++; stage.setScene(scenes.get(sceneCursor)); } } }); HBox btnHbox = new HBox(10); // Back Button Button backBtn = new Button("Back"); backBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { sceneCursor--; stage.setScene(scenes.get(sceneCursor)); } }); btnHbox.getChildren().add(backBtn); btnHbox.getChildren().add(nextBtn); // Cancel Button Button cancelBtn = new Button("Cancel"); cancelBtn.setOnAction(cancelEvent); btnHbox.getChildren().add(cancelBtn); grid.add(btnHbox, 0, 2); return grid; }
From source file:io.bitsquare.gui.components.paymentmethods.SepaForm.java
@Override public void addFormForAddAccount() { gridRowFrom = gridRow + 1;/*from w w w . j av a2s. co m*/ InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second; holderNameInputTextField.setValidator(inputValidator); holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { sepaAccount.setHolderName(newValue); updateFromInputs(); }); ibanInputTextField = addLabelInputTextField(gridPane, ++gridRow, "IBAN:").second; ibanInputTextField.setValidator(ibanValidator); ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { sepaAccount.setIban(newValue); updateFromInputs(); }); bicInputTextField = addLabelInputTextField(gridPane, ++gridRow, "BIC:").second; bicInputTextField.setValidator(bicValidator); bicInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { sepaAccount.setBic(newValue); updateFromInputs(); }); addLabel(gridPane, ++gridRow, "Country of bank:"); HBox hBox = new HBox(); hBox.setSpacing(10); ComboBox<Country> countryComboBox = new ComboBox<>(); currencyComboBox = new ComboBox<>(); currencyTextField = new TextField(""); currencyTextField.setEditable(false); currencyTextField.setMouseTransparent(true); currencyTextField.setFocusTraversable(false); currencyTextField.setMinWidth(300); currencyTextField.setVisible(false); currencyTextField.setManaged(false); currencyComboBox.setVisible(false); currencyComboBox.setManaged(false); hBox.getChildren().addAll(countryComboBox, currencyTextField, currencyComboBox); GridPane.setRowIndex(hBox, gridRow); GridPane.setColumnIndex(hBox, 1); gridPane.getChildren().add(hBox); countryComboBox.setPromptText("Select country of bank"); countryComboBox.setConverter(new StringConverter<Country>() { @Override public String toString(Country country) { return country.name + " (" + country.code + ")"; } @Override public Country fromString(String s) { return null; } }); countryComboBox.setOnAction(e -> { Country selectedItem = countryComboBox.getSelectionModel().getSelectedItem(); sepaAccount.setCountry(selectedItem); TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(selectedItem.code); setupCurrency(selectedItem, currency); updateCountriesSelection(true, euroCountryCheckBoxes); updateCountriesSelection(true, nonEuroCountryCheckBoxes); updateFromInputs(); }); addEuroCountriesGrid(true); addNonEuroCountriesGrid(true); addAllowedPeriod(); addAccountNameTextFieldWithAutoFillCheckBox(); countryComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllSepaCountries())); Country country = CountryUtil.getDefaultCountry(); if (CountryUtil.getAllSepaCountries().contains(country)) { countryComboBox.getSelectionModel().select(country); sepaAccount.setCountry(country); TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(country.code); setupCurrency(country, currency); } updateFromInputs(); }
From source file:webapptest.FXMLDocumentController.java
@FXML //DIsplays the shifts from the server public void refreshShiftsButtonPressed(ActionEvent event) { shiftList.getChildren().clear();/*from w w w . j ava2 s . c o m*/ //get the data of employees from the server List<String> temp = new ArrayList<>(); temp.add("get_shift_specific"); String input = sendData(temp); //parse the data into an object List<Shift> shifts = parseShiftData(input); //display the headings for the employee display HBox heading = new HBox(); Label sID = new Label("Shift ID"); Label sTime = new Label("Shift Time"); Label sEmp = new Label("Shift Employee"); Label sFac = new Label("Shift House"); heading.getChildren().add(sID); heading.getChildren().add(sTime); heading.getChildren().add(sEmp); heading.getChildren().add(sFac); shiftList.getChildren().add(heading); //loop through all available employees and display to screen for (Shift s : shifts) { HBox tempLine = new HBox(); TextField sIDText = new TextField(s.getShiftID()); TextField sTimeText = new TextField(s.getShiftTime()); TextField sEmpText = new TextField(s.getEmpID()); TextField sFacText = new TextField(s.getHouseID()); tempLine.getChildren().add(sIDText); tempLine.getChildren().add(sTimeText); tempLine.getChildren().add(sEmpText); tempLine.getChildren().add(sFacText); shiftList.getChildren().add(tempLine); } }
From source file:com.exalttech.trex.ui.views.PacketTableView.java
/** * Build component UI/*from www. j ava 2s.c om*/ */ private void buildUI(boolean addExportToYamlBtn) { setTopAnchor(this, 0d); setLeftAnchor(this, 0d); setBottomAnchor(this, 0d); setRightAnchor(this, 0d); // build btn bar HBox buttonContainer = new HBox(); buttonContainer.setSpacing(5); addPacketBtn = new StreamTableButton(StreamTableAction.ADD); initializeStreamButtons(addPacketBtn, false); buttonContainer.getChildren().add(addPacketBtn); // add build stream btn buildPacketBtn = new StreamTableButton(StreamTableAction.BUILD); buildPacketBtn.setId("buildStreamBtn"); initializeStreamButtons(buildPacketBtn, false); buttonContainer.getChildren().add(buildPacketBtn); editPacketBtn = new StreamTableButton(StreamTableAction.EDIT); editPacketBtn.setId("editStreanBtn"); initializeStreamButtons(editPacketBtn, true); buttonContainer.getChildren().add(editPacketBtn); deleteButtonBtn = new StreamTableButton(StreamTableAction.DELETE); initializeStreamButtons(deleteButtonBtn, true); buttonContainer.getChildren().add(deleteButtonBtn); importPcapButton = new StreamTableButton(StreamTableAction.IMPORT_PCAP); initializeStreamButtons(importPcapButton, false); buttonContainer.getChildren().add(importPcapButton); exportPcapButton = new StreamTableButton(StreamTableAction.EXPORT_TO_PCAP); initializeStreamButtons(exportPcapButton, true); buttonContainer.getChildren().add(exportPcapButton); if (addExportToYamlBtn) { exportToYaml = new StreamTableButton(StreamTableAction.EXPORT_TO_YAML); initializeStreamButtons(exportToYaml, false); buttonContainer.getChildren().add(exportToYaml); } getChildren().add(buttonContainer); setTopAnchor(buttonContainer, 5d); rightClickMenu = new ContextMenu(); addMenuItem(StreamTableAction.EDIT); addMenuItem(StreamTableAction.DELETE); addMenuItem(StreamTableAction.EXPORT_TO_PCAP); addMenuItem(StreamTableAction.EXPORT_TO_YAML); // add table view streamPacketTableView = new TableView<>(); streamPacketTableView.setId("streamTableView"); streamPacketTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); streamPacketTableView.setFixedCellSize(32); streamPacketTableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); streamPacketTableView.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { handleTableRowClick(event); } }); streamPacketTableView.getSelectionModel().selectedItemProperty() .addListener((ObservableValue<? extends TableProfileStream> observable, TableProfileStream oldValue, TableProfileStream newValue) -> { boolean notSelected = !(newValue != null); exportPcapButton.setDisable(notSelected); editPacketBtn.setDisable(notSelected); deleteButtonBtn.setDisable(notSelected); }); streamPacketTableView.addEventFilter(KeyEvent.KEY_RELEASED, (KeyEvent event) -> { if (copyCombination.match(event)) { selectedProfile = tabledata.getProfiles() .get(streamPacketTableView.getSelectionModel().getSelectedIndex()); } else if (pasteCombination.match(event)) { handleDuplicateStream(); } else if (event.getCode() == KeyCode.DELETE) { handleDeletePacket(); } }); streamPacketTableView.setEditable(true); initializeTableColumn(); // disable table reordering streamPacketTableView.widthProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> source, Number oldWidth, Number newWidth) { TableHeaderRow header = (TableHeaderRow) streamPacketTableView.lookup("TableHeaderRow"); header.reorderingProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { header.setReordering(false); } }); } }); getChildren().add(streamPacketTableView); setTopAnchor(streamPacketTableView, 35d); setBottomAnchor(streamPacketTableView, 5d); setLeftAnchor(streamPacketTableView, 0d); setRightAnchor(streamPacketTableView, 0d); }
From source file:FeeBooster.java
private GridPane rbfGrid(Transaction tx) { // Setup grid GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER);/*from w w w. j a v a2s .c o m*/ grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); int inGridHeight = 0; int outGridHeight = 0; // Add inputs to table Label inputHdrLbl = new Label("Inputs"); grid.add(inputHdrLbl, 0, inGridHeight); inGridHeight++; for (int i = 0; i < tx.getInputs().size(); i++) { // Add input to table TxInput in = tx.getInputs().get(i); Text inputTxt = new Text("Txid: " + in.getTxid() + "\nIndex: " + in.getVout()); grid.add(inputTxt, 0, inGridHeight); inGridHeight++; } // Add outputs to table Label outputHdrLbl = new Label("Outputs"); grid.add(outputHdrLbl, 1, outGridHeight); outGridHeight++; ToggleGroup outputGroup = new ToggleGroup(); for (int i = 0; i < tx.getOutputs().size(); i++) { // Add output to table TxOutput out = tx.getOutputs().get(i); Text outputTxt = new Text("Amount " + out.getValue() + " Satoshis\nAddress: " + out.getAddress()); outputTxt.setUserData(i); grid.add(outputTxt, 1, outGridHeight); // Add radio button to table RadioButton radio = new RadioButton(); radio.setUserData(i); radio.setToggleGroup(outputGroup); radio.setSelected(true); grid.add(radio, 2, outGridHeight); outGridHeight++; } // Set gridheight int gridheight = (inGridHeight < outGridHeight) ? outGridHeight : inGridHeight; gridheight++; // Fee Text fee = new Text("Fee Paid: " + tx.getFee() + " Satoshis"); grid.add(fee, 0, gridheight); // Recommended fee from bitcoinfees.21.co JSONObject apiResult = Utils.getFromAnAPI("http://bitcoinfees.21.co/api/v1/fees/recommended", "GET"); int fastestFee = apiResult.getInt("fastestFee"); long recommendedFee = fastestFee * tx.getSize(); Text recFeeTxt = new Text("Recommended Fee: " + recommendedFee + " Satoshis"); grid.add(recFeeTxt, 1, gridheight); gridheight += 2; // Instructions Text instructions = new Text( "Choose an output to deduct an additional fee from. Then increase the fee below."); grid.add(instructions, 0, gridheight, 3, 1); gridheight++; // Fee spinner Spinner feeSpin = new Spinner((double) tx.getFee(), (double) tx.getTotalAmt(), (double) tx.getFee()); feeSpin.setEditable(true); grid.add(feeSpin, 0, gridheight); feeSpin.valueProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observable, Object oldValue, Object newValue) { double oldVal = (double) oldValue; double newVal = (double) newValue; Double step = newVal - oldVal; tx.setFee(tx.getFee() + step.longValue()); fee.setText("Fee Paid: " + tx.getFee() + " Satoshis"); int output = (int) outputGroup.getSelectedToggle().getUserData(); TxOutput out = tx.getOutputs().get(output); out.decreaseValueBy(step.longValue()); for (int i = 0; i < grid.getChildren().size(); i++) { Node child = grid.getChildren().get(i); if (grid.getRowIndex(child) == output + 1 && grid.getColumnIndex(child) == 1) { ((Text) child) .setText("Amount " + out.getValue() + " Satoshis\nAddress: " + out.getAddress()); } } } }); // Set to recommended fee button Button recFeeBtn = new Button("Set fee to recommended"); grid.add(recFeeBtn, 1, gridheight); gridheight++; recFeeBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { long prevFee = tx.getFee(); long step = recommendedFee - prevFee; feeSpin.increment((int) step); } }); // Next Button Button nextBtn = new Button("Next"); grid.add(nextBtn, 1, gridheight); nextBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (sceneCursor == scenes.size() - 1) { Scene scene = new Scene(unsignedTxGrid(tx), 900, 500); scenes.add(scene); sceneCursor++; stage.setScene(scene); } else { sceneCursor++; stage.setScene(scenes.get(sceneCursor)); } } }); HBox btnHbox = new HBox(10); // Back Button Button backBtn = new Button("Back"); backBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { sceneCursor--; stage.setScene(scenes.get(sceneCursor)); } }); btnHbox.getChildren().add(backBtn); btnHbox.getChildren().add(nextBtn); // Cancel Button Button cancelBtn = new Button("Cancel"); cancelBtn.setOnAction(cancelEvent); btnHbox.getChildren().add(cancelBtn); grid.add(btnHbox, 1, gridheight); return grid; }
From source file:webapptest.FXMLDocumentController.java
@FXML public void groupRefreshButtonPressed(ActionEvent event) { groupList.getChildren().clear();//from w ww. j ava2 s . c o m //get the data of employees from the server List<String> temp = new ArrayList<>(); temp.add("get_group"); String input = sendData(temp); //parse the data into an object List<Group> grps = parseGroupData(input); //display the headings for the group display HBox heading = new HBox(); Label ID = new Label("Database ID"); Label gid = new Label("Group ID"); Label name = new Label("Group Name"); Label manager = new Label("Manager ID"); Label employee = new Label("Employee ID"); heading.getChildren().add(ID); heading.getChildren().add(gid); heading.getChildren().add(name); heading.getChildren().add(manager); heading.getChildren().add(employee); groupList.getChildren().add(heading); for (Group grp : grps) { List<Member> member = grp.getEmps(); for (Member mem : member) { //Loops through the members of the group HBox tempLine = new HBox(); TextField tfid = new TextField(mem.getID()); TextField tfname = new TextField(mem.getName()); TextField tfgroupid = new TextField(mem.getGroupID()); TextField tfmanager = new TextField(mem.getManager()); TextField tfemp = new TextField(mem.getEmps()); tempLine.getChildren().add(tfid); tempLine.getChildren().add(tfname); tempLine.getChildren().add(tfgroupid); tempLine.getChildren().add(tfmanager); tempLine.getChildren().add(tfemp); groupList.getChildren().add(tempLine); } } }
From source file:FeeBooster.java
private GridPane cpfpGrid(Transaction tx) { // Setup Grid GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER);/*www. j a va2 s . c o m*/ grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); int gridheight = 0; // Add outputs to table Label outputHdrLbl = new Label("Outputs"); grid.add(outputHdrLbl, 1, gridheight); gridheight++; ToggleGroup outputGroup = new ToggleGroup(); for (int i = 0; i < tx.getOutputs().size(); i++) { // Add output to table TxOutput out = tx.getOutputs().get(i); Text outputTxt = new Text("Amount " + out.getValue() + " Satoshis\nAddress: " + out.getAddress()); outputTxt.setUserData(i); grid.add(outputTxt, 0, gridheight); // Add radio button to table RadioButton radio = new RadioButton(); radio.setUserData(i); radio.setToggleGroup(outputGroup); radio.setSelected(true); grid.add(radio, 1, gridheight); gridheight++; } // Fee Text fee = new Text("Fee to Pay: " + tx.getFee() + " Satoshis"); grid.add(fee, 0, gridheight); // Recommended fee from bitcoinfees.21.co JSONObject apiResult = Utils.getFromAnAPI("http://bitcoinfees.21.co/api/v1/fees/recommended", "GET"); int fastestFee = apiResult.getInt("fastestFee"); long recommendedFee = fastestFee * tx.getSize() + fastestFee * 300; Text recFeeTxt = new Text("Recommended Fee: " + recommendedFee + " Satoshis"); grid.add(recFeeTxt, 1, gridheight); gridheight += 2; // Instructions Text instructions = new Text("Choose an output to spend from. Set the total transaction fee below."); grid.add(instructions, 0, gridheight, 3, 1); gridheight++; // Fee spinner Spinner feeSpin = new Spinner((double) tx.getFee(), (double) tx.getTotalAmt(), (double) tx.getFee()); feeSpin.setEditable(true); grid.add(feeSpin, 0, gridheight); feeSpin.valueProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observable, Object oldValue, Object newValue) { double oldVal = (double) oldValue; double newVal = (double) newValue; Double step = newVal - oldVal; tx.setFee(tx.getFee() + step.longValue()); fee.setText("Fee to Pay: " + tx.getFee() + " Satoshis"); } }); // Set to recommended fee button Button recFeeBtn = new Button("Set fee to recommended"); grid.add(recFeeBtn, 1, gridheight); gridheight++; recFeeBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { long prevFee = tx.getFee(); long step = recommendedFee - prevFee; feeSpin.increment((int) step); } }); // Output address Label recvAddr = new Label("Address to pay to"); grid.add(recvAddr, 0, gridheight); TextField outAddr = new TextField(); grid.add(outAddr, 1, gridheight); gridheight++; // Next Button Button nextBtn = new Button("Next"); nextBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (sceneCursor == scenes.size() - 1) { // Referenced output int output = (int) outputGroup.getSelectedToggle().getUserData(); TxOutput refout = tx.getOutputs().get(output); // Create output for CPFP transaction TxOutput out = null; long outval = refout.getValue() - ((Double) feeSpin.getValue()).longValue(); if (Utils.validateAddress(outAddr.getText())) { byte[] decodedAddr = Utils.base58Decode(outAddr.getText()); boolean isP2SH = decodedAddr[0] == 0x00; byte[] hash160 = Arrays.copyOfRange(decodedAddr, 1, decodedAddr.length - 4); if (isP2SH) { byte[] script = new byte[hash160.length + 3]; script[0] = (byte) 0xa9; script[1] = (byte) 0x14; System.arraycopy(hash160, 0, script, 2, hash160.length); script[script.length - 1] = (byte) 0x87; out = new TxOutput(outval, script); } else { byte[] script = new byte[hash160.length + 5]; script[0] = (byte) 0x76; script[1] = (byte) 0xa9; script[2] = (byte) 0x14; System.arraycopy(hash160, 0, script, 3, hash160.length); script[script.length - 2] = (byte) 0x88; script[script.length - 1] = (byte) 0xac; out = new TxOutput(outval, script); } } else { Alert alert = new Alert(Alert.AlertType.ERROR, "Invalid Address"); alert.showAndWait(); return; } // Create CPFP Transaction Transaction cpfpTx = new Transaction(); TxInput in = new TxInput(tx.getHash(), output, new byte[] { (0x00) }, 0xffffffff); cpfpTx.addOutput(out); cpfpTx.addInput(in); // Create Scene Scene scene = new Scene(unsignedTxGrid(cpfpTx), 900, 500); scenes.add(scene); sceneCursor++; stage.setScene(scene); } else { sceneCursor++; stage.setScene(scenes.get(sceneCursor)); } } }); HBox btnHbox = new HBox(10); // Back Button Button backBtn = new Button("Back"); backBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { sceneCursor--; stage.setScene(scenes.get(sceneCursor)); } }); btnHbox.getChildren().add(backBtn); btnHbox.getChildren().add(nextBtn); // Cancel Button Button cancelBtn = new Button("Cancel"); cancelBtn.setOnAction(cancelEvent); btnHbox.getChildren().add(cancelBtn); grid.add(btnHbox, 1, gridheight); return grid; }
From source file:Main.java
private TitledPane getEffectTitledPane() { noneEffect.setToggleGroup(effectGroup); noneEffect.setSelected(true);//from w ww . ja va 2 s. co m dropshadowEffect.setToggleGroup(effectGroup); reflectionEffect.setToggleGroup(effectGroup); glowEffect.setToggleGroup(effectGroup); HBox hBox = new HBox(); hBox.setPadding(new Insets(5, 5, 5, 5)); hBox.getChildren().addAll(noneEffect, dropshadowEffect, reflectionEffect, glowEffect); TitledPane effectsPane = new TitledPane("Effect", hBox); return effectsPane; }
From source file:de.pixida.logtest.designer.testrun.TestRunEditor.java
public void createLogFileSourceInputItems(final List<Triple<String, Node, String>> formItems) { final TextField logFilePath = new TextField(); this.logFilePathProperty.bind(logFilePath.textProperty()); HBox.setHgrow(logFilePath, Priority.ALWAYS); final Button selectLogFileButton = SelectFileButton.createButtonWithFileSelection(logFilePath, LogReaderEditor.LOG_FILE_ICON_NAME, "Select log file", null, null); final HBox fileInputConfig = new HBox(logFilePath, selectLogFileButton); final VBox lines = new VBox(); final double spacingOfLines = 5d; lines.setSpacing(spacingOfLines);/*from w w w . j a va2s . c om*/ final HBox inputTypeLine = new HBox(); final double hSpacingOfInputTypeChoices = 30d; inputTypeLine.setSpacing(hSpacingOfInputTypeChoices); final ToggleGroup group = new ToggleGroup(); final RadioButton inputTypeText = new RadioButton("Paste/Enter log"); inputTypeText.setToggleGroup(group); this.loadLogFromEnteredTextProperty.bind(inputTypeText.selectedProperty()); final RadioButton inputTypeFile = new RadioButton("Read log file"); inputTypeFile.setToggleGroup(group); this.loadLogFromFileProperty.bind(inputTypeFile.selectedProperty()); inputTypeFile.setSelected(true); inputTypeLine.getChildren().add(inputTypeText); inputTypeLine.getChildren().add(inputTypeFile); fileInputConfig.visibleProperty().bind(inputTypeFile.selectedProperty()); fileInputConfig.managedProperty().bind(fileInputConfig.visibleProperty()); final TextArea logInputText = new TextArea(); HBox.setHgrow(logInputText, Priority.ALWAYS); final int numLinesForEnteringLogInputManually = 10; logInputText.setPrefRowCount(numLinesForEnteringLogInputManually); logInputText.setStyle("-fx-font-family: monospace"); this.enteredLogTextProperty.bind(logInputText.textProperty()); final HBox enterTextConfig = new HBox(); enterTextConfig.getChildren().add(logInputText); enterTextConfig.visibleProperty().bind(inputTypeText.selectedProperty()); enterTextConfig.managedProperty().bind(enterTextConfig.visibleProperty()); lines.getChildren().addAll(inputTypeLine, fileInputConfig, enterTextConfig); formItems.add(Triple.of("Trace Log", lines, null)); }