19 package org.sleuthkit.autopsy.discovery.ui;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.DefaultListModel;
24 import javax.swing.event.ListSelectionListener;
31 final class VideoThumbnailViewer
extends javax.swing.JPanel {
33 private static final long serialVersionUID = 1L;
34 private final DefaultListModel<VideoThumbnailsWrapper> thumbnailListModel =
new DefaultListModel<>();
39 VideoThumbnailViewer() {
48 void addListSelectionListener(ListSelectionListener listener) {
49 thumbnailList.getSelectionModel().addListSelectionListener(listener);
59 List<AbstractFile> getInstancesForSelected() {
61 if (thumbnailList.getSelectedIndex() == -1) {
62 return new ArrayList<>();
64 return thumbnailListModel.getElementAt(thumbnailList.getSelectedIndex()).getResultFile().getAllInstances();
74 thumbnailListModel.removeAllElements();
75 thumbnailListScrollPane.getVerticalScrollBar().setValue(0);
85 void addVideo(VideoThumbnailsWrapper thumbnailWrapper) {
87 thumbnailListModel.addElement(thumbnailWrapper);
96 @SuppressWarnings(
"unchecked")
98 private
void initComponents() {
100 thumbnailListScrollPane =
new javax.swing.JScrollPane();
101 thumbnailList =
new javax.swing.JList<>();
103 setLayout(
new java.awt.BorderLayout());
105 thumbnailList.setModel(thumbnailListModel);
106 thumbnailList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
108 thumbnailListScrollPane.setViewportView(thumbnailList);
110 add(thumbnailListScrollPane, java.awt.BorderLayout.CENTER);
116 private javax.swing.JScrollPane thumbnailListScrollPane;