mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge branch 'master' of github.com:sleuthkit/autopsy
This commit is contained in:
commit
08181c6b30
@ -24,48 +24,39 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import org.sleuthkit.autopsy.casemodule.AddImageAction;
|
import javax.swing.SwingUtilities;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IngestDialog shown on Case.CASE_ADD_IMAGE property change
|
* IngestDialog shown on Case.CASE_ADD_IMAGE property change
|
||||||
*/
|
*/
|
||||||
public class IngestDialog extends JDialog implements PropertyChangeListener{
|
public class IngestDialog extends JDialog {
|
||||||
|
|
||||||
private static IngestDialog instance;
|
|
||||||
private static final String TITLE = "Ingest Modules";
|
private static final String TITLE = "Ingest Modules";
|
||||||
private static Dimension DIMENSIONS = new Dimension(300, 300);
|
private static Dimension DIMENSIONS = new Dimension(300, 300);
|
||||||
private Image image;
|
private IngestDialogPanel panel = new IngestDialogPanel();
|
||||||
|
|
||||||
|
private static Logger logger = Logger.getLogger(IngestDialog.class.getName());
|
||||||
|
|
||||||
public IngestDialog(JFrame frame, String title, boolean modal) {
|
public IngestDialog(JFrame frame, String title, boolean modal) {
|
||||||
super(frame, title, modal);
|
super(frame, title, modal);
|
||||||
Case.addPropertyChangeListener(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IngestDialog(){
|
public IngestDialog(){
|
||||||
this(new JFrame(TITLE), TITLE, true);
|
this(new JFrame(TITLE), TITLE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the Ingest dialog
|
|
||||||
* @return the startup window singleton
|
|
||||||
*/
|
|
||||||
public static synchronized IngestDialog getInstance() {
|
|
||||||
if (IngestDialog.instance == null) {
|
|
||||||
JFrame frame = new JFrame(TITLE);
|
|
||||||
IngestDialog.instance = new IngestDialog(frame, TITLE, true);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the Ingest dialog.
|
* Shows the Ingest dialog.
|
||||||
*/
|
*/
|
||||||
public void display() {
|
void display() {
|
||||||
|
|
||||||
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
|
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
|
|
||||||
// set the popUp window / JFrame
|
// set the popUp window / JFrame
|
||||||
@ -76,8 +67,6 @@ public class IngestDialog extends JDialog implements PropertyChangeListener{
|
|||||||
// set the location of the popUp Window on the center of the screen
|
// set the location of the popUp Window on the center of the screen
|
||||||
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
|
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
|
||||||
|
|
||||||
IngestDialogPanel panel = new IngestDialogPanel(image);
|
|
||||||
|
|
||||||
// add the command to close the window to both buttons
|
// add the command to close the window to both buttons
|
||||||
panel.setCloseButtonActionListener(new ActionListener() {
|
panel.setCloseButtonActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -96,24 +85,20 @@ public class IngestDialog extends JDialog implements PropertyChangeListener{
|
|||||||
pack();
|
pack();
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setImage(Image image) {
|
||||||
|
panel.setImage(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the Ingest dialog
|
* Closes the Ingest dialog
|
||||||
*/
|
*/
|
||||||
public void close() {
|
public void close() {
|
||||||
this.dispose();
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
|
||||||
String changed = evt.getPropertyName();
|
|
||||||
Object newValue = evt.getNewValue();
|
|
||||||
|
|
||||||
if(changed.equals(Case.CASE_ADD_IMAGE)){
|
|
||||||
this.image = (Image) newValue;
|
|
||||||
display();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,19 @@ public class IngestDialogPanel extends javax.swing.JPanel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Creates new form IngestDialogPanel */
|
/** Creates new form IngestDialogPanel */
|
||||||
public IngestDialogPanel(Image image) {
|
IngestDialogPanel() {
|
||||||
services = new ArrayList<IngestServiceAbstract>();
|
services = new ArrayList<IngestServiceAbstract>();
|
||||||
serviceStates = new HashMap<String, Boolean>();
|
serviceStates = new HashMap<String, Boolean>();
|
||||||
this.image = image;
|
|
||||||
initComponents();
|
initComponents();
|
||||||
customizeComponents();
|
customizeComponents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setImage(Image image) {
|
||||||
|
this.image = image;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void customizeComponents(){
|
private void customizeComponents(){
|
||||||
this.manager = IngestTopComponent.getDefault().getManager();
|
this.manager = IngestTopComponent.getDefault().getManager();
|
||||||
|
|
||||||
@ -169,6 +174,7 @@ public class IngestDialogPanel extends javax.swing.JPanel {
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
|
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
|
||||||
|
this.manager = IngestTopComponent.getDefault().getManager();
|
||||||
if (manager == null) {
|
if (manager == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -182,11 +188,8 @@ public class IngestDialogPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Image> images = new ArrayList<Image>();
|
if (!services.isEmpty() ) {
|
||||||
images.add(image);
|
manager.execute(servicesToStart, image);
|
||||||
|
|
||||||
if (!services.isEmpty() && !images.isEmpty()) {
|
|
||||||
manager.execute(servicesToStart, images);
|
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_startButtonActionPerformed
|
}//GEN-LAST:event_startButtonActionPerformed
|
||||||
|
|
||||||
|
@ -18,33 +18,26 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.ingest;
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.ComponentAdapter;
|
import java.awt.event.ComponentAdapter;
|
||||||
import java.awt.event.ComponentEvent;
|
import java.awt.event.ComponentEvent;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.BoxLayout;
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.JSlider;
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.TopComponent;
|
import org.openide.windows.TopComponent;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
|
||||||
import org.sleuthkit.datamodel.TskException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Top component explorer for the Ingest module.
|
* Top component explorer for the Ingest module.
|
||||||
@ -57,7 +50,6 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
private Collection<IngestServiceAbstract> services;
|
private Collection<IngestServiceAbstract> services;
|
||||||
private Map<String, Boolean> serviceStates;
|
private Map<String, Boolean> serviceStates;
|
||||||
private IngestMessagePanel messagePanel;
|
private IngestMessagePanel messagePanel;
|
||||||
private IngestDialog iD;
|
|
||||||
private ActionListener serviceSelListener = new ActionListener() {
|
private ActionListener serviceSelListener = new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,7 +62,7 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
private IngestTopComponent() {
|
private IngestTopComponent() {
|
||||||
services = new ArrayList<IngestServiceAbstract>();
|
services = new ArrayList<IngestServiceAbstract>();
|
||||||
serviceStates = new HashMap<String, Boolean>();
|
serviceStates = new HashMap<String, Boolean>();
|
||||||
iD = new IngestDialog();
|
|
||||||
initComponents();
|
initComponents();
|
||||||
customizeComponents();
|
customizeComponents();
|
||||||
setName(NbBundle.getMessage(IngestTopComponent.class, "CTL_IngestTopComponent"));
|
setName(NbBundle.getMessage(IngestTopComponent.class, "CTL_IngestTopComponent"));
|
||||||
@ -151,6 +143,17 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
}
|
}
|
||||||
//clear inbox
|
//clear inbox
|
||||||
messagePanel.clearMessages();
|
messagePanel.clearMessages();
|
||||||
|
} else if (evt.getPropertyName().equals(Case.CASE_ADD_IMAGE)) {
|
||||||
|
final Image image = (Image) evt.getNewValue();
|
||||||
|
final IngestDialog ingestDialog = new IngestDialog();
|
||||||
|
ingestDialog.setImage(image);
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ingestDialog.display();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -158,26 +161,27 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
|
|
||||||
/* Collection<IngestServiceImage> imageServices = IngestManager.enumerateImageServices();
|
/* Collection<IngestServiceImage> imageServices = IngestManager.enumerateImageServices();
|
||||||
for (IngestServiceImage service : imageServices) {
|
for (IngestServiceImage service : imageServices) {
|
||||||
final String serviceName = service.getName();
|
final String serviceName = service.getName();
|
||||||
services.add(service);
|
services.add(service);
|
||||||
JCheckBox checkbox = new JCheckBox(serviceName, true);
|
JCheckBox checkbox = new JCheckBox(serviceName, true);
|
||||||
checkbox.setName(serviceName);
|
checkbox.setName(serviceName);
|
||||||
checkbox.addActionListener(serviceSelListener);
|
checkbox.addActionListener(serviceSelListener);
|
||||||
servicesPanel.add(checkbox);
|
servicesPanel.add(checkbox);
|
||||||
serviceStates.put(serviceName, true);
|
serviceStates.put(serviceName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<IngestServiceFsContent> fsServices = IngestManager.enumerateFsContentServices();
|
Collection<IngestServiceFsContent> fsServices = IngestManager.enumerateFsContentServices();
|
||||||
for (IngestServiceFsContent service : fsServices) {
|
for (IngestServiceFsContent service : fsServices) {
|
||||||
final String serviceName = service.getName();
|
final String serviceName = service.getName();
|
||||||
services.add(service);
|
services.add(service);
|
||||||
JCheckBox checkbox = new JCheckBox(serviceName, true);
|
JCheckBox checkbox = new JCheckBox(serviceName, true);
|
||||||
checkbox.setName(serviceName);
|
checkbox.setName(serviceName);
|
||||||
checkbox.addActionListener(serviceSelListener);
|
checkbox.addActionListener(serviceSelListener);
|
||||||
servicesPanel.add(checkbox);
|
servicesPanel.add(checkbox);
|
||||||
serviceStates.put(serviceName, true);
|
serviceStates.put(serviceName, true);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
@ -294,7 +298,6 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 771, Short.MAX_VALUE)
|
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 771, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JPanel controlPanel;
|
private javax.swing.JPanel controlPanel;
|
||||||
private javax.swing.JLabel ingestProgressLabel;
|
private javax.swing.JLabel ingestProgressLabel;
|
||||||
@ -308,7 +311,9 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
@Override
|
@Override
|
||||||
public void componentOpened() {
|
public void componentOpened() {
|
||||||
logger.log(Level.INFO, "IngestTopComponent opened()");
|
logger.log(Level.INFO, "IngestTopComponent opened()");
|
||||||
manager = new IngestManager(this);
|
if (manager == null) {
|
||||||
|
manager = new IngestManager(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -363,8 +368,8 @@ public final class IngestTopComponent extends TopComponent implements DataExplor
|
|||||||
void updateProgress(int progress) {
|
void updateProgress(int progress) {
|
||||||
this.mainProgressBar.setValue(progress);
|
this.mainProgressBar.setValue(progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
IngestManager getManager(){
|
IngestManager getManager() {
|
||||||
return this.manager;
|
return this.manager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user