@Override public void setSelected(boolean selected, E selectedImage) { if (this.isSelected() != selected) { setTag(TagW.SeriesSelected, selected); Thumbnail thumb = (Thumbnail) getTagValue(TagW.Thumbnail); if (thumb != null) { thumb.repaint(); } } }
public void dispose() { // Close image reader and image stream, but it should be already closed mediaIO.close(); mediaIO.getFileCache().dispose(); }
@Override public void setFocused(boolean focused) { if (this.isFocused() != focused) { setTag(TagW.SeriesFocused, focused); Thumbnail thumb = (Thumbnail) getTagValue(TagW.Thumbnail); if (thumb != null) { thumb.repaint(); } } }
public synchronized void setThumbnailSize(int thumbnailSize) { boolean update = this.thumbnailSize != thumbnailSize; if (update) { Object media = series.getMedia(mediaPosition, null, null); this.thumbnailSize = thumbnailSize; removeImageFromCache(); buildThumbnail((MediaElement) media, series.getTagValue(TagW.ExplorerModel) != null, null); } }
@Override public void setOpen(boolean open) { if (this.isOpen() != open) { setTag(TagW.SeriesOpen, open); Thumbnail thumb = (Thumbnail) getTagValue(TagW.Thumbnail); if (thumb != null) { thumb.repaint(); } if (!open) { resetSortedMediasMap(); } } }
private void requestFocus(Series<?> series) { if (series != null) { Thumbnail thumb = (Thumbnail) series.getTagValue(TagW.Thumbnail); if (thumb != null) { if (!thumb.hasFocus() && thumb.isRequestFocusEnabled()) { thumb.requestFocus(); } } } }
public void readValue(Object data, Tagable tagable) { tagable.setTagNoNull(this, getValue(data)); }
@Override public boolean isOpen() { Boolean open = (Boolean) getTagValue(TagW.SeriesOpen); return open == null ? false : open; }
/** * Returns the full size, original image. Returns null if the image is not loaded. * * @return */ public PlanarImage getImage(OpManager manager) { return getImage(manager, true); }
public static Object getTagValue(TagW tag, TagReadable... tagable) { for (TagReadable t : tagable) { if (t != null) { Object val = t.getTagValue(tag); if (val != null) { return val; } } } return null; }
/** * This file can be the result of a processing like downloading, tiling or uncompressing. * * @return the final file that has been load by the reader. */ public File getFile() { return mediaIO.getFileCache().getFinalFile(); }
protected boolean isLoadingSeriesCanceled() { SeriesImporter loader = series.getSeriesLoader(); return loader == null || loader.isStopped(); }
public long getLastModified() { return mediaIO.getFileCache().getLastModified(); }
public long getLength() { return mediaIO.getFileCache().getLength(); }
private ImageElement getSingleImage() { if (image == null) { image = new ImageElement(this, 0); } return image; }
/** * Loads the original image. Must load and return the original image. * * @throws Exception * * @throws IOException */ protected PlanarImage loadImage() throws Exception { return mediaIO.getImageFragment(this); }
@Override public PlanarImage call() throws Exception { return loadImage(); } }
private MediaElement getSingleImage() { if (mediaElement == null) { mediaElement = new MediaElement(this, null); } return mediaElement; }