public void setProductEntryList(final ProductEntry[] productEntryList) { this.productEntryList = productEntryList; final List<Quicklook> thumbnails = new ArrayList<>(productEntryList.length); for (ProductEntry productEntry : productEntryList) { if (productEntry.getQuickLook() != null) { thumbnails.add(productEntry.getQuickLook()); } } update(thumbnails.toArray(new Thumbnail[thumbnails.size()])); } }
public ProductEntry[] getSelectedProductEntries() { final List<ProductEntry> list = new ArrayList<>(); for (ThumbnailDrawing item : getSelection()) { Quicklook ql = (Quicklook) item.getThumbnail(); for (ProductEntry entry : productEntryList) { if (entry.getQuickLook().equals(ql)) { list.add(entry); } } } return list.toArray(new ProductEntry[list.size()]); }
public int compare(final Object o1, final Object o2) { if (o1 == o2) { return 0; } if (o1 == null) { return -1; } else if (o2 == null) { return 1; } final Quicklook image1 = ((ProductEntry) o1).getQuickLook(); final Quicklook image2 = ((ProductEntry) o2).getQuickLook(); if (image1 == null) { return -1; } else if (image2 == null) { return 1; } if (!image1.hasImage()) { return -1; } else if (!image2.hasImage()) { return 1; } return 0; } }
public File[] getSelectedFiles() { final List<File> list = new ArrayList<>(); for (ThumbnailDrawing item : getSelection()) { Quicklook ql = (Quicklook) item.getThumbnail(); for (ProductEntry entry : productEntryList) { if (entry.getQuickLook().equals(ql) && entry.getFile() != null) { list.add(entry.getFile()); } } } return list.toArray(new File[list.size()]); }
private static BufferedImage getImage(final ProductEntry productEntry) { if (productEntry.quickLookExists()) { final Quicklook quicklook = productEntry.getQuickLook(); if (!quicklook.hasProduct() && !quicklook.hasCachedImage() && quicklook.getProductFile() != null) { try { quicklook.setProduct(ProductIO.readProduct(quicklook.getProductFile())); } catch (IOException e) { SystemUtils.LOG.warning("Quicklook unable to load product " + quicklook.getProductFile()); } } return quicklook.getImage(ProgressMonitor.NULL); } return null; }