private boolean isDownloading() { if (RESULT.getHash() != null) { return BTDownloadMediator.instance().isDownloading(RESULT.getHash()); } else { return false; } }
private void labelPartialDownload_mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (searchResult.getSearchResult() instanceof CrawlableSearchResult) { searchResult.download(true); UXStats.instance().log(UXAction.SEARCH_RESULT_DETAIL_VIEW); } } }
private void labelPlay_mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (searchResult.getSearchResult() instanceof StreamableSearchResult && !isStreamableSourceBeingPlayed(searchResult)) { searchResult.play(); updatePlayButton(); } uxLogMediaPreview(); } }
private boolean isSearchResultPlayable() { boolean playable = false; if (searchResult.getSearchResult() instanceof StreamableSearchResult) { playable = ((StreamableSearchResult) searchResult.getSearchResult()).getStreamUrl() != null; if (searchResult.getExtension() != null) { MediaType mediaType = MediaType.getMediaTypeForExtension(searchResult.getExtension()); playable = mediaType != null && (mediaType.equals(MediaType.getAudioMediaType())) || mediaType.equals(MediaType.getVideoMediaType()); } } return playable; }
/** Initializes this line with the specified search result. */ public void initialize(UISearchResult sr) { super.initialize(sr); RESULT = sr; _mediaType = NamedMediaType.getFromExtension(getExtension()); addedOn = sr.getCreationTime() > 0 ? new Date(sr.getCreationTime()) : null; actionsHolder = new SearchResultActionsHolder(sr); name = new SearchResultNameHolder(sr); seeds = RESULT.getSeeds() <= 0 || !(RESULT instanceof TorrentUISearchResult) ? "" : String.valueOf(RESULT.getSeeds()); icon = getIcon(); size = new SizeHolder(getSize()); source = new SourceHolder(RESULT); }
private void uxLogMediaPreview() { MediaType mediaType = MediaType.getMediaTypeForExtension(searchResult.getExtension()); if (mediaType != null) { boolean isVideo = mediaType.equals(MediaType.getVideoMediaType()); UXStats.instance() .log( isVideo ? UXAction.SEARCH_RESULT_VIDEO_PREVIEW : UXAction.SEARCH_RESULT_AUDIO_PREVIEW); } }
private void updateUIData(SearchResultActionsHolder value, JTable table, int row, int column) { actionsHolder = value; searchResult = actionsHolder.getSearchResult(); showSolid = mouseIsOverRow(table, row); updatePlayButton(); labelPlay.setVisible(isSearchResultPlayable()); labelDownload.setIcon(showSolid ? download_solid : download_transparent); labelDownload.setVisible(true); labelPartialDownload.setIcon(showSolid ? details_solid : details_transparent); labelPartialDownload.setVisible( searchResult.getSearchResult() instanceof CrawlableSearchResult); }
public SearchEngine getSearchEngine() { return RESULT.getSearchEngine(); }
public String getHash() { return RESULT.getHash(); }
public int getSeeds() { return RESULT.getSeeds(); }
/** Returns the vendor code of the result. */ String getVendor() { return RESULT.getSource(); }
/** Gets the size of this TableLine. */ public long getSize() { return RESULT.getSize(); }
public String getDisplayName() { return RESULT.getDisplayName(); }
/** * Returns this filename, as passed to the constructor. Limitation: if the original filename was * "a.", the returned value will be "a". */ public String getFilename() { return RESULT.getFilename(); }
/** Returns the extension of this result. */ String getExtension() { return RESULT.getExtension(); }
private void labelDownload_mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { searchResult.download(false); UXStats.instance().log(UXAction.SEARCH_RESULT_ROW_BUTTON_DOWNLOAD); } }