List of usage examples for javafx.scene.image ImageView ImageView
public ImageView(Image image)
From source file:org.sleuthkit.autopsy.imagegallery.gui.MetaDataPane.java
@FXML void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert tableView != null : "fx:id=\"tableView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert valueColumn != null : "fx:id=\"valueColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; TagUtils.registerListener(this); ImageGalleryController.getDefault().getCategoryManager().registerListener(this); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); tableView.setPlaceholder(new Label("Select a file to show its details here.")); attributeColumn.setCellValueFactory((param) -> new SimpleObjectProperty<>(param.getValue().getKey())); attributeColumn.setCellFactory(/* w w w . j a va 2 s .co m*/ (param) -> new TableCell<Pair<DrawableAttribute<?>, ? extends Object>, DrawableAttribute<?>>() { @Override protected void updateItem(DrawableAttribute<?> item, boolean empty) { super.updateItem(item, empty); //To change body of generated methods, choose Tools | Templates. if (item != null) { setText(item.getDisplayName()); setGraphic(new ImageView(item.getIcon())); } else { setGraphic(null); setText(null); } } }); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); valueColumn.setCellValueFactory((p) -> { if (p.getValue().getKey() == DrawableAttribute.TAGS) { return new SimpleStringProperty( ((Collection<TagName>) p.getValue().getValue()).stream().map(TagName::getDisplayName) .filter((String t) -> t.startsWith(Category.CATEGORY_PREFIX) == false) .collect(Collectors.joining(" ; ", "", ""))); } else { return new SimpleStringProperty(StringUtils.join((Iterable<?>) p.getValue().getValue(), " ; ")); } }); valueColumn.setPrefWidth(USE_COMPUTED_SIZE); valueColumn.setCellFactory((p) -> new TableCell<Pair<DrawableAttribute<?>, ? extends Object>, String>() { @Override public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!isEmpty()) { Text text = new Text(item); text.wrappingWidthProperty().bind(getTableColumn().widthProperty()); setGraphic(text); } else { setGraphic(null); } } }); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); //listen for selection change controller.getSelectionModel().lastSelectedProperty().addListener((observable, oldFileID, newFileID) -> { setFile(newFileID); }); // MetaDataPane.this.visibleProperty().bind(controller.getMetaDataCollapsed().not()); // MetaDataPane.this.managedProperty().bind(controller.getMetaDataCollapsed().not()); }
From source file:org.sleuthkit.autopsy.imageanalyzer.gui.MetaDataPane.java
@FXML void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert tableView != null : "fx:id=\"tableView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert valueColumn != null : "fx:id=\"valueColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; TagUtils.registerListener(this); Category.registerListener(this); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); tableView.setPlaceholder(new Label("Select a file to show its details here.")); attributeColumn.setCellValueFactory((param) -> new SimpleObjectProperty<>(param.getValue().getKey())); attributeColumn.setCellFactory(//from w w w . j av a2 s . c om (param) -> new TableCell<Pair<DrawableAttribute<?>, ? extends Object>, DrawableAttribute<?>>() { @Override protected void updateItem(DrawableAttribute<?> item, boolean empty) { super.updateItem(item, empty); //To change body of generated methods, choose Tools | Templates. if (item != null) { setText(item.getDisplayName()); setGraphic(new ImageView(item.getIcon())); } else { setGraphic(null); setText(null); } } }); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); valueColumn.setCellValueFactory((p) -> { if (p.getValue().getKey() == DrawableAttribute.TAGS) { return new SimpleStringProperty( ((Collection<TagName>) p.getValue().getValue()).stream().map(TagName::getDisplayName) .filter((String t) -> t.startsWith(Category.CATEGORY_PREFIX) == false) .collect(Collectors.joining(" ; ", "", ""))); } else { return new SimpleStringProperty(StringUtils.join((Collection<?>) p.getValue().getValue(), " ; ")); } }); valueColumn.setPrefWidth(USE_COMPUTED_SIZE); valueColumn.setCellFactory((p) -> new TableCell<Pair<DrawableAttribute<?>, ? extends Object>, String>() { @Override public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!isEmpty()) { Text text = new Text(item); text.wrappingWidthProperty().bind(getTableColumn().widthProperty()); setGraphic(text); } else { setGraphic(null); } } }); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); //listen for selection change controller.getSelectionModel().lastSelectedProperty().addListener((observable, oldFileID, newFileID) -> { setFile(newFileID); }); // MetaDataPane.this.visibleProperty().bind(controller.getMetaDataCollapsed().not()); // MetaDataPane.this.managedProperty().bind(controller.getMetaDataCollapsed().not()); }
From source file:com.exalttech.trex.ui.controllers.PacketBuilderHomeController.java
/** * Initializes the controller class.//from ww w .j a va 2s .co m * * @param url * @param rb */ @Override public void initialize(URL url, ResourceBundle rb) { trafficProfile = new TrafficProfile(); packetHex = new PacketHex(hexPane); loadPcap.visibleProperty().bind(packetViewerTab.selectedProperty()); nextStreamBtn.setGraphic(new ImageView(new Image("/icons/next_stream.png"))); prevStreamBtn.setGraphic(new ImageView(new Image("/icons/prev_stream.png"))); packetInfo = new PacketInfo(); parser = new PacketParser(); }
From source file:ch.tuason.djbattlescore.lib.components.comps.ResultGridPane.java
/** * adds a certain DjEntity to the ranking grid panel... * /*from w w w . ja va 2 s. com*/ * @param results a Collection of DjEntity... */ public void addCurrentDJRanking(Collection<DjEntity> results) { this.addedRankingComponents.clear(); this.currentDjRanking = results; if (this.currentDjRanking != null && !this.currentDjRanking.isEmpty()) { int iPos = 1; for (DjEntity dj : this.currentDjRanking) { Image djImage = null; if (!StringUtils.isEmpty(dj.getAvatarPicPath32())) { djImage = getImageFromCache(dj); if (djImage == null) { try { djImage = new Image(getClass().getResourceAsStream( DjBattleConstants.IMAGE_RESOURCE_BASE_FOR_DJ_PICS + dj.getAvatarPicPath32())); if (!djImage.isError()) { imageCache.put(dj.getId(), djImage); } } catch (Exception e) { System.out.println("the image for dj '" + dj.getName() + "' could not be loaded for the avatar image... " + e.getMessage()); djImage = null; } } // it might be an absolute path? if (djImage == null) { try { djImage = new Image( DjBattleConstants.ABSOLUTE_IMAGE_FILEPATH_PREFIX + dj.getAvatarPicPath32()); if (!djImage.isError()) { imageCache.put(dj.getId(), djImage); } } catch (Exception e) { System.out.println("the image for dj '" + dj.getName() + "' could not be loaded for the avatar image... " + e.getMessage()); djImage = null; } } if (djImage == null) { djImage = getStandardImage(); } } if (StringUtils.isEmpty(dj.getAvatarPicPath32()) || djImage == null) { djImage = getStandardImage(); } HBox djComponent = new HBox(); djComponent.setPadding(new Insets(5, 0, 0, 20)); Label djLabel = new Label(dj.getDjNameWithSoundStyle(), new ImageView(djImage)); djLabel.setFont(new Font("Arial", 20)); // component.setTextFill(Color.web(DjBattleConstants.COLOR_RESULT_TITLE_TEXT)); djComponent.getChildren().add(djLabel); this.addedRankingComponents.add(djComponent); this.add(djComponent, 0, iPos); iPos++; } } }
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);//from w w w.ja v a 2 s.c o m 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:org.pdfsam.rotate.RotateModule.java
public Node graphic() { return new ImageView("rotate.png"); }
From source file:ca.wumbo.doommanager.client.controller.FileEditorController.java
@FXML private void initialize() { // We only want the user to close the selected tab, not accidentally other tabs. fileTabPane.setTabClosingPolicy(TabClosingPolicy.SELECTED_TAB); // TODO - this should be configurable though as a user option. // We'll remove the text since its not needed (only useful in the SceneBuilder). for (Node node : toolbar.getItems()) { if (node instanceof Button) { Button button = (Button) node; button.setText(""); }/*from www . j av a 2 s. co m*/ } // Set menu item graphics. newMenu.setGraphic(new ImageView(resources.getImage("newfile"))); newWadMenuItem.setGraphic(new ImageView(resources.getImage("wadentry"))); newPK3MenuItem.setGraphic(new ImageView(resources.getImage("pk3entry"))); newDXMLProjectMenuItem.setGraphic(new ImageView(resources.getImage("dxmlprojectentry"))); openFileMenuItem.setGraphic(new ImageView(resources.getImage("folder"))); connectFileMenuItem.setGraphic(new ImageView(resources.getImage("network"))); exitMenuItem.setGraphic(new ImageView(resources.getImage("close"))); // Set button graphics. newWadButton.setGraphic(new ImageView(resources.getImage("newfile"))); openFileButton.setGraphic(new ImageView(resources.getImage("folder"))); connectButton.setGraphic(new ImageView(resources.getImage("network"))); taskManagerButton.setGraphic(new ImageView(resources.getImage("taskmanager"))); }
From source file:org.pdfsam.alternatemix.AlternateMixModule.java
public Node graphic() { return new ImageView("alternate_mix.png"); }
From source file:account.management.controller.inventory.PurchaseReportController.java
@FXML private void onShowReportButtonClick(ActionEvent event) { this.show.setDisable(true); try {/* www . ja va 2 s . com*/ String id = String.valueOf(this.item.getSelectionModel().getSelectedItem().getId()); String start_date = "1980-01-01", end_date = "2050-12-31"; start_date = new SimpleDateFormat("yyyy-MM-dd") .format(new SimpleDateFormat("yyyy-MM-dd").parse(this.start.getValue().toString())); end_date = new SimpleDateFormat("yyyy-MM-dd") .format(new SimpleDateFormat("yyyy-MM-dd").parse(this.end.getValue().toString())); HttpResponse<JsonNode> res = Unirest.get(MetaData.baseUrl + "report/ledger/purchase") .queryString("id", id).queryString("start", start_date).queryString("end", end_date).asJson(); JSONArray array = res.getBody().getArray(); System.out.println(array); Vector v = new Vector(); HashMap params = new HashMap(); params.put("date", "From " + new SimpleDateFormat("dd-MM-yyyy") .format(new SimpleDateFormat("yyyy-MM-dd").parse(start_date)) + " To " + new SimpleDateFormat("dd-MM-yyyy") .format(new SimpleDateFormat("yyyy-MM-dd").parse(end_date))); params.put("item_name", "Purchase report of " + this.item.getSelectionModel().getSelectedItem().getName()); for (int i = 0; i < array.length(); i++) { JSONObject obj = array.getJSONObject(i); String date = obj.getString("date"); String quantity = obj.get("quantity").toString(); String rate = obj.get("rate").toString(); v.add(new SellPurchaseLedger(date, quantity, rate)); } Report report = new Report(); report.getReport("src\\report\\SellPurchaseLedger.jrxml", new JRBeanCollectionDataSource(v), params, "Purchase Report"); this.show.setDisable(false); } catch (Exception e) { System.out.println("Exception in show report button click"); Alert alert = new Alert(Alert.AlertType.ERROR); alert.setHeaderText(null); alert.setContentText("Sorry!! there is an error. Please try again."); alert.setGraphic(new ImageView(new Image("resources/error.jpg"))); alert.showAndWait(); } }
From source file:account.management.controller.inventory.SellReportController.java
@FXML private void onShowReportButtonClick(ActionEvent event) { this.show.setDisable(true); try {//from w w w . ja va 2 s .com String id = String.valueOf(this.item.getSelectionModel().getSelectedItem().getId()); String start_date = "1980-01-01", end_date = "2050-12-31"; start_date = new SimpleDateFormat("yyyy-MM-dd") .format(new SimpleDateFormat("yyyy-MM-dd").parse(this.start.getValue().toString())); end_date = new SimpleDateFormat("yyyy-MM-dd") .format(new SimpleDateFormat("yyyy-MM-dd").parse(this.end.getValue().toString())); HttpResponse<JsonNode> res = Unirest.get(MetaData.baseUrl + "report/ledger/sell").queryString("id", id) .queryString("start", start_date).queryString("end", end_date).asJson(); JSONArray array = res.getBody().getArray(); System.out.println(array); Vector v = new Vector(); HashMap params = new HashMap(); params.put("date", "From " + new SimpleDateFormat("dd-MM-yyyy") .format(new SimpleDateFormat("yyyy-MM-dd").parse(start_date)) + " To " + new SimpleDateFormat("dd-MM-yyyy") .format(new SimpleDateFormat("yyyy-MM-dd").parse(end_date))); params.put("item_name", "Purchase report of " + this.item.getSelectionModel().getSelectedItem().getName()); for (int i = 0; i < array.length(); i++) { JSONObject obj = array.getJSONObject(i); String date = obj.getString("date"); String quantity = obj.get("quantity").toString(); String rate = obj.get("rate").toString(); v.add(new SellPurchaseLedger(date, quantity, rate)); } Report report = new Report(); report.getReport("src\\report\\SellPurchaseLedger.jrxml", new JRBeanCollectionDataSource(v), params, "Sell Report"); report.getReport("src\\report\\DepositVoucher.jrxml", new JRBeanCollectionDataSource(v), params, "Deposit Voucher"); this.show.setDisable(false); } catch (Exception e) { System.out.println("Exception in show report button click"); Alert alert = new Alert(Alert.AlertType.ERROR); alert.setHeaderText(null); alert.setContentText("Sorry!! there is an error. Please try again."); alert.setGraphic(new ImageView(new Image("resources/error.jpg"))); alert.showAndWait(); } }