19 package org.sleuthkit.autopsy.filequery;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.DefaultListModel;
24 import javax.swing.event.ListSelectionListener;
35 private final DefaultListModel<ImageThumbnailWrapper>
thumbnailListModel =
new DefaultListModel<>();
50 @SuppressWarnings(
"unchecked")
57 setLayout(
new java.awt.BorderLayout());
60 thumbnailList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
62 thumbnailList.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP);
80 void addListSelectionListener(ListSelectionListener listener) {
81 thumbnailList.getSelectionModel().addListSelectionListener(listener);
91 List<AbstractFile> getInstancesForSelected() {
93 if (thumbnailList.getSelectedIndex() == -1) {
94 return new ArrayList<>();
96 return thumbnailListModel.getElementAt(thumbnailList.getSelectedIndex()).getResultFile().getAllInstances();
105 synchronized (
this) {
106 thumbnailListModel.removeAllElements();
117 void addImage(ImageThumbnailWrapper thumbnailWrapper) {
118 synchronized (
this) {
119 thumbnailListModel.addElement(thumbnailWrapper);
static final long serialVersionUID
javax.swing.JScrollPane thumbnailListScrollPane
final DefaultListModel< ImageThumbnailWrapper > thumbnailListModel
javax.swing.JList< ImageThumbnailWrapper > thumbnailList