List of usage examples for javafx.scene.control Label Label
public Label(String text)
From source file:dsfixgui.view.DSFHudPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);/*from ww w. j a v a 2 s .c o m*/ spacerColumn.setPercentWidth(3.0); primaryColumn = new ColumnConstraints(); primaryColumn.setFillWidth(true); primaryColumn.setPercentWidth(95.0); primaryPane = new GridPane(); primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn); primaryVBox = new VBox(); primaryVBox.getStyleClass().add("spacing_15"); primaryPane.add(primaryVBox, 1, 0); titleLabel = new Label(HUD.toUpperCase() + " " + SETTINGS.toUpperCase()); titleLabel.getStyleClass().add("settings_title"); titleBar = new HBox(); titleBar.setAlignment(Pos.CENTER); titleBar.getChildren().add(titleLabel); restoreDefaultsBar = new HBox(); restoreDefaultsBar.setAlignment(Pos.CENTER); restoreDefaultsBar.setSpacing(5.0); applySettingsButton = new Button(APPLY_SETTINGS); restoreDefaultsButton = new Button(RESTORE_DEFAULTS); applySettingsButton.getStyleClass().add("translate_y_4"); restoreDefaultsButton.getStyleClass().add("translate_y_4"); restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton); spacerHBox = new HBox(); spacerHBox.setMinHeight(10.0); bottomSpacerHBox = new HBox(); bottomSpacerHBox.setMinHeight(10.0); /////////////////////SETTINGS PANES///////////////////// // // //Toggle HUD Modifications hudModsPane = new FlowPane(); hudModsPane.getStyleClass().add("settings_pane"); hudModsLabel = new Label(HUD_MODS_LABEL + " "); hudModsLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudModsLabel.setTooltip(new Tooltip(HUD_MODS_TT)); hudModsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableHudMod.get() == 0) { hudModsPicker.setValue(hudModsPicker.getItems().get(0)); } else { hudModsPicker.setValue(hudModsPicker.getItems().get(1)); } hudModsPane.getChildren().addAll(hudModsLabel, hudModsPicker); // //Minimal HUD minimalHUDPane = new FlowPane(); minimalHUDPane.getStyleClass().add("settings_pane"); minimalHUDLabel = new Label(MINIMAL_HUD_LABEL + " "); minimalHUDLabel.getStyleClass().addAll("bold_text", "font_12_pt"); minimalHUDLabel.setTooltip(new Tooltip(MIN_HUD_TT)); minimalHUDPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableMinimalHud.get() == 0) { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(0)); } else { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(1)); } minimalHUDPane.getChildren().addAll(minimalHUDLabel, minimalHUDPicker); // //HUD Scale hudScalePane = new FlowPane(); hudScalePane.getStyleClass().add("settings_pane"); hudScaleLabel = new Label(HUD_SCALE_LABEL + " "); hudScaleLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudScaleLabel.setTooltip(new Tooltip(HUD_SCALE_TT)); hudScaleField = new TextField(config.hudScaleFactor.toString()); hudScaleField.getStyleClass().add("settings_med_text_field"); hudScalePane.getChildren().addAll(hudScaleLabel, hudScaleField); // //HUD Opacities Parent Label hudOpacitiesPane = new FlowPane(); hudOpacitiesPane.getStyleClass().add("settings_pane"); hudOpacitiesLabel = new Label(HUD_OPACITIES_LABEL + " "); hudOpacitiesLabel.getStyleClass().addAll("bold_text", "font_14_pt"); hudOpacitiesLabel.setTooltip(new Tooltip(HUD_OPS_TT)); hudOpacitiesPane.getChildren().addAll(hudOpacitiesLabel); // //Top Left HUD Opacity topLeftHUDOpPane = new FlowPane(); topLeftHUDOpPane.getStyleClass().add("settings_pane"); topLeftHUDOpLabel = new Label(TOP_LEFT_HUD_OP_LABEL + " "); topLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); topLeftHUDOpLabel.setTooltip(new Tooltip(TOP_LEFT_HUD_TT)); topLeftHUDOpField = new TextField( config.hudTopLeftOpacity.toString().substring(0, config.hudTopLeftOpacity.length() - 1)); topLeftHUDOpField.getStyleClass().add("settings_med_text_field"); topLeftHUDOpPane.getChildren().addAll(topLeftHUDOpLabel, topLeftHUDOpField); // //Bottom Left HUD Opacity bottomLeftHUDOpPane = new FlowPane(); bottomLeftHUDOpPane.getStyleClass().add("settings_pane"); bottomLeftHUDOpLabel = new Label(BOTTOM_LEFT_HUD_OP_LABEL + " "); bottomLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomLeftHUDOpLabel.setTooltip(new Tooltip(BOTTOM_LEFT_HUD_TT)); bottomLeftHUDOpField = new TextField( config.hudBottomLeftOpacity.toString().substring(0, config.hudBottomLeftOpacity.length() - 1)); bottomLeftHUDOpField.getStyleClass().add("settings_med_text_field"); bottomLeftHUDOpPane.getChildren().addAll(bottomLeftHUDOpLabel, bottomLeftHUDOpField); // //Bottom Riht HUD Opacity bottomRightHUDOpPane = new FlowPane(); bottomRightHUDOpPane.getStyleClass().add("settings_pane"); bottomRightHUDOpLabel = new Label(BOTTOM_RIGHT_HUD_OP_LABEL + " "); bottomRightHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomRightHUDOpLabel.setTooltip(new Tooltip(BOTTOM_RIGHT_HUD_TT)); bottomRightHUDOpField = new TextField( config.hudBottomRightOpacity.toString().substring(0, config.hudBottomRightOpacity.length() - 1)); bottomRightHUDOpField.getStyleClass().add("settings_med_text_field"); bottomRightHUDOpPane.getChildren().addAll(bottomRightHUDOpLabel, bottomRightHUDOpField); if (config.enableHudMod.get() == 0) { minimalHUDPicker.setDisable(true); hudScaleField.setDisable(true); topLeftHUDOpField.setDisable(true); bottomLeftHUDOpField.setDisable(true); bottomRightHUDOpField.setDisable(true); } primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, hudModsPane, minimalHUDPane, hudScalePane, hudOpacitiesPane, topLeftHUDOpPane, bottomLeftHUDOpPane, bottomRightHUDOpPane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:com.exalttech.trex.ui.controllers.PacketViewerController.java
/** * Convert to hex/*from w ww .jav a 2 s . c o m*/ * * @param rawData * @throws DecoderException * @throws UnsupportedEncodingException */ private void convertToHex(byte[] rawData) throws DecoderException, UnsupportedEncodingException { int splitLine = 16; int counter = 0; StringBuilder myString = new StringBuilder(""); int index = 0; hexContainer.getChildren().clear(); StringBuilder hexData = new StringBuilder(""); StringBuilder indexBuffer = new StringBuilder(""); StringBuilder rowHex = new StringBuilder(""); StringBuilder convertedHexBuffer = new StringBuilder(""); int spacing = 0; for (byte b : rawData) { String formatedByte = String.format("%02X", b); myString.append(formatedByte); rowHex.append(formatedByte).append(" "); spacing++; if (spacing == 4) { spacing = 0; rowHex.append(" "); } counter++; if (counter % splitLine == 0) { indexBuffer.append(String.format("%04X", index)).append(':').append('\n'); hexData.append(rowHex.toString()).append('\n'); convertedHexBuffer.append(convertHexToString(myString.toString())).append('\n'); myString.setLength(0); rowHex.setLength(0); index = index + 16; } } if (!Util.isNullOrEmpty(myString.toString())) { indexBuffer.append(String.format("%04X", index)).append(':').append('\n'); hexData.append(rowHex.toString()).append('\n'); convertedHexBuffer.append(convertHexToString(myString.toString())).append('\n'); } hexContainer.add(new Label(indexBuffer.toString()), 0, 0); hexContainer.add(new Label(hexData.toString()), 1, 0); hexContainer.add(new Label(convertedHexBuffer.toString()), 2, 0); rowHex.setLength(0); myString.setLength(0); hexData.setLength(0); }
From source file:com.helegris.szorengeteg.ui.forms.TopicFormView.java
/** * Sets content and desired behavior for the table view. Beside card list * and comparators, it sets the width so that the "description" column can * take as much space as possible./*from ww w .j a va2s. com*/ */ private void setTable() { RowForCard.refreshAllTopics(topicLoader.loadAll()); tableView.setPlaceholder(new Label(Messages.msg("form.no_words"))); tableView.setItems(sortedRows); sortedRows.comparatorProperty().bind(tableView.comparatorProperty()); colWord.setComparator(new TextFieldComparator()); colDescription.setComparator(new TextFieldComparator()); Platform.runLater(() -> { double sum = tableView.getColumns().stream().mapToDouble(TableColumn::getWidth).sum(); sum -= colDescription.getWidth(); double fullWidth = tableView.getWidth(); if (fullWidth == 0) { fullWidth = this.getScene().getWidth(); } colDescription.setPrefWidth(fullWidth - sum - 30); }); }
From source file:se.trixon.mapollage.ui.config.FoldersTab.java
private void createUI() { VBox leftBox = new VBox(); VBox rightBox = new VBox(); setContent(leftBox);/*from www . j a v a 2 s .co m*/ //Left Pane Label rootNameLabel = new Label(mBundle.getString("FoldersTab.rootNameLabel")); Label rootDescLabel = new Label(mBundle.getString("FoldersTab.rootDescriptionLabel")); Label regexLabel = new Label(Dict.DEFAULT_VALUE.toString()); leftBox.getChildren().addAll(rootNameLabel, mRootNameTextField, rootDescLabel, mRootDescTextArea, rightBox); VBox.setVgrow(mRootDescTextArea, Priority.ALWAYS); //Right Pane mFolderByDirectoryRadioButton.setToggleGroup(mToggleGroup); mFolderByDateRadioButton.setToggleGroup(mToggleGroup); mFolderByRegexRadioButton.setToggleGroup(mToggleGroup); mFolderByNoneRadioButton.setToggleGroup(mToggleGroup); mDatePatternComboBox.setMaxWidth(Double.MAX_VALUE); mDatePatternComboBox.setEditable(true); mDatePatternComboBox .setItems(FXCollections.observableList(Arrays.asList(mBundle.getString("dateFormats").split(";")))); Label label = new Label(mBundle.getString("FoldersTab.folderByLabel")); rightBox.getChildren().addAll(label, mFolderByDirectoryRadioButton, mFolderByDateRadioButton, mDatePatternComboBox, mFolderByRegexRadioButton, mRegexTextField, regexLabel, mRegexDefaultTextField, mFolderByNoneRadioButton); addTopPadding(rootDescLabel, mFolderByDirectoryRadioButton, mFolderByDateRadioButton, mFolderByRegexRadioButton, regexLabel, mFolderByNoneRadioButton, rightBox); Insets leftInsets = new Insets(0, 0, 0, 24); VBox.setMargin(mDatePatternComboBox, leftInsets); VBox.setMargin(mRegexTextField, leftInsets); VBox.setMargin(mRegexDefaultTextField, leftInsets); VBox.setMargin(regexLabel, leftInsets); mDatePatternComboBox.disableProperty().bind(mFolderByDateRadioButton.selectedProperty().not()); mRegexTextField.disableProperty().bind(mFolderByRegexRadioButton.selectedProperty().not()); mRegexDefaultTextField.disableProperty().bind(mFolderByRegexRadioButton.selectedProperty().not()); // EventHandler eventHandler = (EventHandler) (Event event) -> { //// sValidationSupport.initInitialDecoration(); // sValidationSupport.getValidationDecorator().removeDecorations(mDatePatternComboBox); // // sValidationSupport.redecorate(); // System.out.println(event); // }; // // mFolderByDateRadioButton.setOnAction(eventHandler); // mFolderByDirectoryRadioButton.setOnAction(eventHandler); // mFolderByNoneRadioButton.setOnAction(eventHandler); // mFolderByRegexRadioButton.setOnAction(eventHandler); }
From source file:org.mskcc.shenkers.control.track.bam.BamView1.java
@Override public Task<Pane> getContent(BamContext context) { return context.spanProperty().getValue().map(i -> { if (false) { SamReader reader = context.readerProperty().getValue(); int[] coverage = coverage(reader, i.getChr(), i.getStart(), i.getEnd()); String chr = i.getChr(); int start = i.getStart(); int end = i.getEnd(); PaneTask task = new PaneTask(context, chr, start, end); // LineHistogramView lhv = new LineHistogramView(); // lhv.setMin(0); // OptionalInt max = IntStream.of(coverage).max(); // max.ifPresent(m -> lhv.setMax(m)); // double[] data = ArrayUtils.toPrimitive(IntStream.of(coverage).mapToDouble(j -> j + 0.).boxed().collect(Collectors.toList()).toArray(new Double[0])); // lhv.setData(data); // logger.info("coverage {}", IntStream.of(coverage).mapToDouble(j -> j + 0.).boxed().collect(Collectors.toList()).toString()); }/*from www . ja v a 2 s. c o m*/ SamReader reader = context.readerProperty().getValue(); String chr = i.getChr(); int start = i.getStart(); int end = i.getEnd(); Task<Pane> task = new PaneTask(context, chr, start, end); // LineHistogramView lhv = new LineHistogramView(); // SamReader reader = context.readerProperty().getValue(); // // Pane content = get(reader, i.getChr(), i.getStart(), i.getEnd()); // Task<Pane> task = new BAMCoverageTask(lhv, reader, i.getChr(), i.getStart(), i.getEnd()); // start a background thread to load the track // logger.info("canceling"); // bcs.cancel(); // logger.info("reseting"); // bcs.reset(); // // logger.info("reading context"); // SamReader reader = context.readerProperty().getValue(); // logger.info("setting region"); // bcs.setRegion(reader, i.getChr(), i.getStart(), i.getEnd()); // // logger.info("starting service"); // bcs.start(); logger.info("returning task"); return task; }).orElse(new Task<Pane>() { @Override protected Pane call() throws Exception { return new BorderPane(new Label("bamview1: span not set")); } } // new BorderPane(new Label("bamview1: span not set")) // new Pane() ); }
From source file:se.trixon.filebydate.ui.ProfilePanel.java
private void createUI() { //setGridLinesVisible(true); Label nameLabel = new Label(Dict.NAME.toString()); Label descLabel = new Label(Dict.DESCRIPTION.toString()); Label filePatternLabel = new Label(Dict.FILE_PATTERN.toString()); Label dateSourceLabel = new Label(Dict.DATE_SOURCE.toString()); mDatePatternLabel = new Label(Dict.DATE_PATTERN.toString()); Label operationLabel = new Label(Dict.OPERATION.toString()); Label caseBaseLabel = new Label(Dict.BASENAME.toString()); Label caseExtLabel = new Label(Dict.EXTENSION.toString()); mLinksCheckBox = new CheckBox(Dict.FOLLOW_LINKS.toString()); mRecursiveCheckBox = new CheckBox(Dict.RECURSIVE.toString()); mReplaceCheckBox = new CheckBox(Dict.REPLACE.toString()); mCaseBaseComboBox = new ComboBox<>(); mDatePatternComboBox = new ComboBox<>(); mDateSourceComboBox = new ComboBox<>(); mFilePatternComboBox = new ComboBox<>(); mOperationComboBox = new ComboBox<>(); mCaseExtComboBox = new ComboBox<>(); mNameTextField = new TextField(); mDescTextField = new TextField(); mSourceChooserPane = new FileChooserPane(Dict.OPEN.toString(), Dict.SOURCE.toString(), ObjectMode.DIRECTORY, SelectionMode.SINGLE);// w ww. j ava 2 s. c om mDestChooserPane = new FileChooserPane(Dict.OPEN.toString(), Dict.DESTINATION.toString(), ObjectMode.DIRECTORY, SelectionMode.SINGLE); mFilePatternComboBox.setEditable(true); mDatePatternComboBox.setEditable(true); //mDatePatternLabel.setPrefWidth(300); int col = 0; int row = 0; add(nameLabel, col, row, REMAINING, 1); add(mNameTextField, col, ++row, REMAINING, 1); add(descLabel, col, ++row, REMAINING, 1); add(mDescTextField, col, ++row, REMAINING, 1); add(mSourceChooserPane, col, ++row, REMAINING, 1); add(mDestChooserPane, col, ++row, REMAINING, 1); GridPane patternPane = new GridPane(); patternPane.addRow(0, filePatternLabel, dateSourceLabel, mDatePatternLabel); patternPane.addRow(1, mFilePatternComboBox, mDateSourceComboBox, mDatePatternComboBox); patternPane.setHgap(8); addRow(++row, patternPane); GridPane.setHgrow(mFilePatternComboBox, Priority.ALWAYS); GridPane.setHgrow(mDateSourceComboBox, Priority.ALWAYS); GridPane.setHgrow(mDatePatternComboBox, Priority.ALWAYS); GridPane.setFillWidth(mFilePatternComboBox, true); GridPane.setFillWidth(mDateSourceComboBox, true); GridPane.setFillWidth(mDatePatternComboBox, true); double width = 100.0 / 3.0; ColumnConstraints col1 = new ColumnConstraints(); col1.setPercentWidth(width); ColumnConstraints col2 = new ColumnConstraints(); col2.setPercentWidth(width); ColumnConstraints col3 = new ColumnConstraints(); col3.setPercentWidth(width); patternPane.getColumnConstraints().addAll(col1, col2, col3); mFilePatternComboBox.setMaxWidth(Double.MAX_VALUE); mDateSourceComboBox.setMaxWidth(Double.MAX_VALUE); mDatePatternComboBox.setMaxWidth(Double.MAX_VALUE); GridPane subPane = new GridPane(); //subPane.setGridLinesVisible(true); subPane.addRow(0, operationLabel, new Label(), new Label(), new Label(), caseBaseLabel, caseExtLabel); subPane.addRow(1, mOperationComboBox, mLinksCheckBox, mRecursiveCheckBox, mReplaceCheckBox, mCaseBaseComboBox, mCaseExtComboBox); subPane.setHgap(8); add(subPane, col, ++row, REMAINING, 1); final Insets rowInsets = new Insets(0, 0, 8, 0); GridPane.setMargin(mNameTextField, rowInsets); GridPane.setMargin(mDescTextField, rowInsets); GridPane.setMargin(mSourceChooserPane, rowInsets); GridPane.setMargin(mDestChooserPane, rowInsets); GridPane.setMargin(patternPane, rowInsets); mFilePatternComboBox.setItems(FXCollections.observableArrayList("*", "{*.jpg,*.JPG}", "{*.mp4,*.MP4}")); mDatePatternComboBox.setItems(FXCollections.observableArrayList("yyyy/MM/yyyy-MM-dd", "yyyy/MM/yyyy-MM-dd/HH", "yyyy/MM/dd", "yyyy/ww", "yyyy/ww/u")); mCaseBaseComboBox.setItems(FXCollections.observableArrayList(Arrays.asList(NameCase.values()))); mCaseExtComboBox.setItems(FXCollections.observableArrayList(Arrays.asList(NameCase.values()))); mDateSourceComboBox.setItems(FXCollections.observableArrayList(Arrays.asList(DateSource.values()))); mOperationComboBox.setItems(FXCollections.observableArrayList(Arrays.asList(Command.COPY, Command.MOVE))); }
From source file:net.thirdy.blackmarket.controls.Dialogs.java
public static void showAbout() { Alert alert = new Alert(AlertType.INFORMATION); alert.setGraphic(new Region()); alert.setTitle("Blackmarket " + BlackmarketApplication.VERSION); alert.setContentText(""); alert.setHeaderText(""); TextArea textArea = new TextArea("Copyright 2015 Vicente de Rivera III" + "\r\n" + "\r\n http://thirdy.github.io/blackmarket" + "\r\n" + "\r\n This program is free software; you can redistribute it and/or" + "\r\n modify it under the terms of the GNU General Public License" + "\r\n as published by the Free Software Foundation; either version 2" + "\r\n of the License, or (at your option) any later version." + "\r\n" + "\r\n This program is distributed in the hope that it will be useful," + "\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of" + "\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" + "\r\n GNU General Public License for more details." + "\r\n" + "\r\n You should have received a copy of the GNU General Public License" + "\r\n along with this program; if not, write to the Free Software" + "\r\n Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." + "\r\n"); textArea.setEditable(false);/* w ww. j ava2s. com*/ textArea.setWrapText(true); Hyperlink website = new Hyperlink("Visit Blackmarket Homepage"); website.setOnAction(e -> { try { SwingUtil.openUrlViaBrowser("http://thirdy.github.io/blackmarket/"); } catch (BlackmarketException ex) { logger.error(ex.getMessage(), ex); } }); Hyperlink exwebsite = new Hyperlink("Visit Exile Tools Homepage"); exwebsite.setOnAction(e -> { try { SwingUtil.openUrlViaBrowser("http://exiletools.com/"); } catch (BlackmarketException ex) { logger.error(ex.getMessage(), ex); } }); VBox content = new VBox(new ImageView(new Image("/images/blackmarket-logo.png")), new Label( "Blackmarket is fan-made software for Path of Exile but is not affiliated with Grinding Gear Games in any way."), new Label("A few tips:"), new Label("CTRL + Space - hot key to slide the search control pane"), new Label("CTRL + Enter - hot key to run the search"), new Label("Advance mode grants you power overwhelming of Elastic Search"), new Label("For more information and updates,"), website, new Label("Blackmarket uses Exile Tools Shop Indexer Elastic Search API:"), exwebsite, new Label("Comics by /u/gallio"), new Label("Blackmarket is 100% Free and Open Source Software under GPLv2:"), textArea); content.setSpacing(8); alert.getDialogPane().setContent(content); alert.showAndWait(); }
From source file:pah9qdmoviereviews.MovieReviewsFXMLController.java
public void ready(Stage stage, Scene scene) { this.stage = stage; this.scene = scene; movieReviewManager = new NYTMoviewReviewManager(); movieReviewManager.addPropertyChangeSupport(((evt) -> { switch (evt.getPropertyName()) { case "Exception": Platform.runLater(() -> displayExceptionAlert((Exception) evt.getNewValue())); break; case "Add Movie Review": Platform.runLater(() -> { movieReviews.add((NYTMovieReview) evt.getNewValue()); this.foundText.setText(("Found " + movieReviews.size() + " results for " + searchString + ".")); });//from w w w. j a v a 2 s. c om break; case "Clear Movie Reviews": Platform.runLater(() -> movieReviews.clear()); break; case "Completed": if (movieReviews.isEmpty()) this.foundText.setText("No reviews found for " + searchString); break; default: Platform.runLater( () -> displayExceptionAlert(new Exception("Invalid Property Change Support Property"))); break; } })); movieReviews = FXCollections.observableArrayList(); listView.setItems(movieReviews); listView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<NYTMovieReview>() { @Override public void changed(ObservableValue<? extends NYTMovieReview> observable, NYTMovieReview oldValue, NYTMovieReview newValue) { detailsBox.getChildren().clear(); movieImage.setImage(null); if (newValue != null) { DateFormat dateFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH); String pictureLink = newValue.getPictureLink(); if (pictureLink != null && !pictureLink.isEmpty()) { reviewBox.getChildren().remove(0); reviewBox.getChildren().add(0, movieImage); movieImage.setImage(new Image(pictureLink)); } else { reviewBox.getChildren().remove(0); reviewBox.getChildren().add(0, missingImageText); movieImage.setImage(null); } ArrayList<Label> labelArray = new ArrayList<>(); if (!newValue.getDisplayTitle().isEmpty()) { Label titleLabel = new Label(newValue.getDisplayTitle()); titleLabel.fontProperty().set(Font.font(20)); labelArray.add(titleLabel); } if (!newValue.getSummary().isEmpty()) { labelArray.add(new Label("Summary: " + newValue.getSummary())); } if (!newValue.getMpaaRating().isEmpty()) { labelArray.add(new Label("MPAA Rating: " + newValue.getMpaaRating())); } if (newValue.getPublicationDate() != null) { labelArray.add( new Label("Publication Date: " + dateFormat.format(newValue.getPublicationDate()))); } if (newValue.getOpeningDate() != null) { labelArray.add(new Label("Opening Date: " + dateFormat.format(newValue.getOpeningDate()))); } labelArray.forEach((label) -> { label.wrapTextProperty().set(true); }); detailsBox.getChildren().addAll(labelArray); Button openButton = new Button("Open Review"); openButton.setOnAction((event) -> { try { Desktop.getDesktop().browse(new URI(newValue.getArticleLink())); } catch (Exception ex) { displayExceptionAlert(ex); } }); detailsBox.getChildren().add(openButton); } } }); HBox.setMargin(missingImageText, new Insets(15, 15, 15, 15)); searchTextField.setOnKeyPressed((event) -> { if (event.getCode() == KeyCode.ENTER) { loadReviews(searchTextField.getText()); } }); // searchTextField.textProperty().addListener((observable, oldValue, newValue) -> { // if(newValue != null && !newValue.isEmpty()) // loadReviews(newValue); // }); }
From source file:io.bitsquare.gui.main.funds.withdrawal.WithdrawalView.java
@Override public void initialize() { tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); tableView.setPlaceholder(new Label("No funds are available for withdrawal")); tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); setAddressColumnCellFactory();/* www. j a v a2 s . com*/ setBalanceColumnCellFactory(); setSelectColumnCellFactory(); addressColumn.setComparator((o1, o2) -> o1.getAddressString().compareTo(o2.getAddressString())); balanceColumn.setComparator((o1, o2) -> o1.getBalance().compareTo(o2.getBalance())); balanceColumn.setSortType(TableColumn.SortType.DESCENDING); tableView.getSortOrder().add(balanceColumn); balanceListener = new BalanceListener() { @Override public void onBalanceChanged(Coin balance, Transaction tx) { updateList(); } }; amountListener = (observable, oldValue, newValue) -> { if (amountTextField.focusedProperty().get()) { try { senderAmountAsCoinProperty.set(formatter.parseToCoin(amountTextField.getText())); } catch (Throwable t) { log.error("Error at amountTextField input. " + t.toString()); } } }; amountFocusListener = (observable, oldValue, newValue) -> { if (oldValue && !newValue) { if (senderAmountAsCoinProperty.get().isPositive()) amountTextField.setText(formatter.formatCoin(senderAmountAsCoinProperty.get())); else amountTextField.setText(""); } }; }
From source file:eu.ggnet.dwoss.receipt.shipment.ShipmentUpdateStage.java
private void init(Shipment s) { okButton.setOnAction((ActionEvent event) -> { shipment = getShipment();/*from w ww . j a v a 2s .com*/ if (isValid()) close(); }); cancelButton.setOnAction((ActionEvent event) -> { close(); }); idField = new TextField(Long.toString(s.getId())); idField.setDisable(true); shipIdField = new TextField(s.getShipmentId()); Callback<ListView<TradeName>, ListCell<TradeName>> cb = new Callback<ListView<TradeName>, ListCell<TradeName>>() { @Override public ListCell<TradeName> call(ListView<TradeName> param) { return new ListCell<TradeName>() { @Override protected void updateItem(TradeName item, boolean empty) { super.updateItem(item, empty); if (item == null || empty) setText("Hersteller whlen..."); else setText(item.getName()); } }; } }; Set<TradeName> contractors = Client.lookup(MandatorSupporter.class).loadContractors().all(); ownerBox = new ComboBox<>(FXCollections.observableArrayList(contractors)); ownerBox.setMaxWidth(MAX_VALUE); ownerBox.setCellFactory(cb); ownerBox.getSelectionModel().selectedItemProperty().addListener( (ObservableValue<? extends TradeName> observable, TradeName oldValue, TradeName newValue) -> { if (newValue == null) return; shipment.setContractor(newValue); manufacturerBox.getSelectionModel().select(newValue.getManufacturer()); }); ObservableList<TradeName> manufacturers = FXCollections.observableArrayList(TradeName.getManufacturers()); manufacturerBox = new ComboBox<>(manufacturers); manufacturerBox.setMaxWidth(MAX_VALUE); manufacturerBox.setCellFactory(cb); SingleSelectionModel<TradeName> sm = ownerBox.getSelectionModel(); if (s.getContractor() == null) sm.selectFirst(); else sm.select(s.getContractor()); if (shipment.getDefaultManufacturer() != null) manufacturerBox.getSelectionModel().select(shipment.getDefaultManufacturer()); statusBox = new ComboBox<>(FXCollections.observableArrayList(Shipment.Status.values())); statusBox.setMaxWidth(MAX_VALUE); statusBox.getSelectionModel().select(s.getStatus() == null ? OPENED : s.getStatus()); GridPane grid = new GridPane(); grid.addRow(1, new Label("ID:"), idField); grid.addRow(2, new Label("Shipment ID:"), shipIdField); grid.addRow(3, new Label("Besitzer:"), ownerBox); grid.addRow(4, new Label("Hersteller:"), manufacturerBox); grid.addRow(5, new Label("Status"), statusBox); grid.setMaxWidth(MAX_VALUE); grid.vgapProperty().set(2.); grid.getColumnConstraints().add(0, new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.SOMETIMES, HPos.LEFT, false)); grid.getColumnConstraints().add(1, new ColumnConstraints(100, 150, Double.MAX_VALUE, Priority.ALWAYS, HPos.LEFT, true)); HBox hButtonBox = new HBox(okButton, cancelButton); hButtonBox.alignmentProperty().set(Pos.TOP_RIGHT); errorLabel.setWrapText(true); BorderPane rootPane = new BorderPane(grid, errorLabel, null, hButtonBox, null); this.setTitle(s.getId() > 0 ? "Shipment bearbeiten" : "Shipment anlegen"); this.setScene(new Scene(rootPane)); this.setResizable(false); }