Merge remote-tracking branch 'upstream/develop' into 1252-FilterPanel-bug-fix

This commit is contained in:
Kelly Kelly 2019-05-24 11:12:51 -04:00
commit 202f593a68
14 changed files with 160 additions and 100 deletions

View File

@ -171,7 +171,8 @@ public class IngestEventsListener {
} }
/** /**
* Configure the listener to flag previously seen devices or not. * Configure the listener to flag devices previously seen in other cases or
* not.
* *
* @param value True to flag seen devices; otherwise false. * @param value True to flag seen devices; otherwise false.
*/ */
@ -363,8 +364,8 @@ public class IngestEventsListener {
dataSource = ((DataSourceAnalysisCompletedEvent) event).getDataSource(); dataSource = ((DataSourceAnalysisCompletedEvent) event).getDataSource();
/* /*
* We only care about Images for the purpose of * We only care about Images for the purpose of updating hash
* updating hash values. * values.
*/ */
if (!(dataSource instanceof Image)) { if (!(dataSource instanceof Image)) {
return; return;
@ -489,9 +490,13 @@ public class IngestEventsListener {
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.IMSI_TYPE_ID || eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.IMSI_TYPE_ID
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.MAC_TYPE_ID)) { || eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.MAC_TYPE_ID)) {
try { try {
Long countPreviousOccurences = dbManager.getCountArtifactInstancesByTypeValue(eamArtifact.getCorrelationType(), eamArtifact.getCorrelationValue()); //only alert to previous instances when they were in another case
if (countPreviousOccurences > 0) { List<CorrelationAttributeInstance> previousOccurences = dbManager.getArtifactInstancesByTypeValue(eamArtifact.getCorrelationType(), eamArtifact.getCorrelationValue());
for (CorrelationAttributeInstance instance : previousOccurences) {
if (!instance.getCorrelationCase().getCaseUUID().equals(eamArtifact.getCorrelationCase().getCaseUUID())) {
postCorrelatedPreviousArtifactToBlackboard(bbArtifact); postCorrelatedPreviousArtifactToBlackboard(bbArtifact);
break;
}
} }
} catch (CorrelationAttributeNormalizationException ex) { } catch (CorrelationAttributeNormalizationException ex) {
LOGGER.log(Level.INFO, String.format("Unable to flag notable item: %s.", eamArtifact.toString()), ex); LOGGER.log(Level.INFO, String.format("Unable to flag notable item: %s.", eamArtifact.toString()), ex);

View File

@ -1,4 +1,4 @@
IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings
IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag previously seen devices IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag devices previously seen in other cases
IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository

View File

@ -12,5 +12,5 @@ CentralRepoIngestModuleFactory.ingestmodule.desc=Saves properties to the central
CentralRepoIngestModuleFactory.ingestmodule.name=Correlation Engine CentralRepoIngestModuleFactory.ingestmodule.name=Correlation Engine
IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings
IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag previously seen devices IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag devices previously seen in other cases
IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository IngestSettingsPanel.createCorrelationPropertiesCheckbox.text=Save items to the Central Repository

View File

@ -70,7 +70,7 @@ final class IngestSettings implements IngestModuleIngestJobSettings {
} }
/** /**
* Are previously seen devices to be flagged? * Are devices previously seen in other cases to be flagged?
* *
* @return True if flagging; otherwise false. * @return True if flagging; otherwise false.
*/ */

View File

@ -72,7 +72,7 @@ final class AccountDeviceInstanceNode extends AbstractNode {
} }
@Override @Override
@NbBundle.Messages(value = {"AccountNode.device=Device", "AccountNode.accountName=Account", "AccountNode.accountType=Type", "AccountNode.messageCount=Msgs"}) @NbBundle.Messages(value = {"AccountNode.device=Device", "AccountNode.accountName=Account", "AccountNode.accountType=Type", "AccountNode.messageCount=Messages"})
protected Sheet createSheet() { protected Sheet createSheet() {
Sheet sheet = super.createSheet(); Sheet sheet = super.createSheet();
Sheet.Set properties = sheet.get(Sheet.PROPERTIES); Sheet.Set properties = sheet.get(Sheet.PROPERTIES);

View File

@ -1,7 +1,7 @@
AccountNode.accountName=Account AccountNode.accountName=Account
AccountNode.accountType=Type AccountNode.accountType=Type
AccountNode.device=Device AccountNode.device=Device
AccountNode.messageCount=Msgs AccountNode.messageCount=Messages
applyText=Apply applyText=Apply
CTL_OpenCVTAction=Communications CTL_OpenCVTAction=Communications
CVTTopComponent.name=\ Communications Visualization CVTTopComponent.name=\ Communications Visualization

View File

@ -3,8 +3,6 @@ SummaryViewer.countsPanel.border.title=Counts
SummaryViewer.emailLabel.text=Emails: SummaryViewer.emailLabel.text=Emails:
SummaryViewer.contactsLabel.text=Contacts: SummaryViewer.contactsLabel.text=Contacts:
SummaryViewer.attachmentsLabel.text=Attachments: SummaryViewer.attachmentsLabel.text=Attachments:
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
OutlineViewPanel.messageLabel.text=<Control Disabled> OutlineViewPanel.messageLabel.text=<Control Disabled>
SummaryViewer.messagesDataLabel.text=messages SummaryViewer.messagesDataLabel.text=messages
SummaryViewer.callLogsDataLabel.text=callLogs SummaryViewer.callLogsDataLabel.text=callLogs
@ -13,3 +11,5 @@ SummaryViewer.emailDataLabel.text=emails
SummaryViewer.attachmentsDataLabel.text=attachments SummaryViewer.attachmentsDataLabel.text=attachments
SummaryViewer.messagesLabel.text=Messages: SummaryViewer.messagesLabel.text=Messages:
SummaryViewer.callLogsLabel.text=Call Logs: SummaryViewer.callLogsLabel.text=Call Logs:
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case

View File

@ -9,6 +9,7 @@ ContactNode_URL=URL
ContactsViewer_columnHeader_Email=Email ContactsViewer_columnHeader_Email=Email
ContactsViewer_columnHeader_Name=Name ContactsViewer_columnHeader_Name=Name
ContactsViewer_columnHeader_Phone=Phone ContactsViewer_columnHeader_Phone=Phone
ContactsViewer_noContacts_message=<No contacts found for selected account>
ContactsViewer_tabTitle=Contacts ContactsViewer_tabTitle=Contacts
MediaViewer_Name=Media MediaViewer_Name=Media
MessageNode_Node_Property_Attms=Attachments MessageNode_Node_Property_Attms=Attachments
@ -22,13 +23,12 @@ MessageViewer_columnHeader_Date=Date
MessageViewer_columnHeader_From=From MessageViewer_columnHeader_From=From
MessageViewer_columnHeader_Subject=Subject MessageViewer_columnHeader_Subject=Subject
MessageViewer_columnHeader_To=To MessageViewer_columnHeader_To=To
MessageViewer_no_messages=<No messages found for selected account>
MessageViewer_tabTitle=Messages MessageViewer_tabTitle=Messages
SummaryViewer.countsPanel.border.title=Counts SummaryViewer.countsPanel.border.title=Counts
SummaryViewer.emailLabel.text=Emails: SummaryViewer.emailLabel.text=Emails:
SummaryViewer.contactsLabel.text=Contacts: SummaryViewer.contactsLabel.text=Contacts:
SummaryViewer.attachmentsLabel.text=Attachments: SummaryViewer.attachmentsLabel.text=Attachments:
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
OutlineViewPanel.messageLabel.text=<Control Disabled> OutlineViewPanel.messageLabel.text=<Control Disabled>
SummaryViewer.messagesDataLabel.text=messages SummaryViewer.messagesDataLabel.text=messages
SummaryViewer.callLogsDataLabel.text=callLogs SummaryViewer.callLogsDataLabel.text=callLogs
@ -37,8 +37,10 @@ SummaryViewer.emailDataLabel.text=emails
SummaryViewer.attachmentsDataLabel.text=attachments SummaryViewer.attachmentsDataLabel.text=attachments
SummaryViewer.messagesLabel.text=Messages: SummaryViewer.messagesLabel.text=Messages:
SummaryViewer.callLogsLabel.text=Call Logs: SummaryViewer.callLogsLabel.text=Call Logs:
SummaryViewer.caseReferencesPanel.border.title=Other Occurrences
SummaryViewer.fileReferencesPanel.border.title=File References in Current Case
SummaryViewer_CaseRefNameColumn_Title=Case Name SummaryViewer_CaseRefNameColumn_Title=Case Name
SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Case References> SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Other Occurrences>
SummaryViewer_Creation_Date_Title=Creation Date SummaryViewer_Creation_Date_Title=Creation Date
SummaryViewer_FileRefNameColumn_Title=Path SummaryViewer_FileRefNameColumn_Title=Path
SummaryViewer_TabTitle=Summary SummaryViewer_TabTitle=Summary

View File

@ -16,27 +16,24 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="outlineView" max="32767" attributes="0"/> <Component id="contactPane" max="32767" attributes="0"/>
<Component id="contactPane" alignment="0" max="32767" attributes="0"/> <Component id="outlineViewPanel" alignment="0" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="outlineView" pref="350" max="32767" attributes="0"/> <Component id="outlineViewPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="contactPane" pref="400" max="32767" attributes="0"/> <Component id="contactPane" pref="332" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Component class="org.openide.explorer.view.OutlineView" name="outlineView">
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.openide.explorer.view.OutlineView()"/>
</AuxValues>
</Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane" name="contactPane"> <Component class="org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane" name="contactPane">
</Component> </Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel" name="outlineViewPanel">
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -23,7 +23,7 @@ import java.awt.KeyboardFocusManager;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities;
import static javax.swing.SwingUtilities.isDescendingFrom; import static javax.swing.SwingUtilities.isDescendingFrom;
import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline; import org.netbeans.swing.outline.Outline;
@ -32,6 +32,8 @@ import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.nodes.AbstractNode; import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children; import org.openide.nodes.Children;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.nodes.NodeAdapter;
import org.openide.nodes.NodeMemberEvent;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
@ -45,9 +47,9 @@ import org.sleuthkit.datamodel.BlackboardAttribute;
* *
*/ */
@ServiceProvider(service = RelationshipsViewer.class) @ServiceProvider(service = RelationshipsViewer.class)
public final class ContactsViewer extends JPanel implements RelationshipsViewer, ExplorerManager.Provider, Lookup.Provider { public final class ContactsViewer extends JPanel implements RelationshipsViewer{
private final ExplorerManager tableEM; // private final ExplorerManager tableEM;
private final Outline outline; private final Outline outline;
private final ModifiableProxyLookup proxyLookup; private final ModifiableProxyLookup proxyLookup;
private final PropertyChangeListener focusPropertyListener; private final PropertyChangeListener focusPropertyListener;
@ -57,14 +59,19 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
"ContactsViewer_tabTitle=Contacts", "ContactsViewer_tabTitle=Contacts",
"ContactsViewer_columnHeader_Name=Name", "ContactsViewer_columnHeader_Name=Name",
"ContactsViewer_columnHeader_Phone=Phone", "ContactsViewer_columnHeader_Phone=Phone",
"ContactsViewer_columnHeader_Email=Email",}) "ContactsViewer_columnHeader_Email=Email",
"ContactsViewer_noContacts_message=<No contacts found for selected account>"
})
/** /**
* Visualization for contact nodes. * Visualization for contact nodes.
*/ */
public ContactsViewer() { public ContactsViewer() {
tableEM = new ExplorerManager(); initComponents();
proxyLookup = new ModifiableProxyLookup(createLookup(tableEM, getActionMap()));
outlineViewPanel.hideOutlineView(Bundle.ContactsViewer_noContacts_message());
proxyLookup = new ModifiableProxyLookup(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
nodeFactory = new ContactsChildNodeFactory(null); nodeFactory = new ContactsChildNodeFactory(null);
// See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed // See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed
@ -81,30 +88,44 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
proxyLookup.setNewLookups(createLookup(contactPane.getExplorerManager(), getActionMap())); proxyLookup.setNewLookups(createLookup(contactPane.getExplorerManager(), getActionMap()));
} else if (isDescendingFrom(newFocusOwner, ContactsViewer.this)) { } else if (isDescendingFrom(newFocusOwner, ContactsViewer.this)) {
//... or if it is within the Results table. //... or if it is within the Results table.
proxyLookup.setNewLookups(createLookup(tableEM, getActionMap())); proxyLookup.setNewLookups(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
} }
} }
}; };
initComponents(); outline = outlineViewPanel.getOutlineView().getOutline();
outlineViewPanel.getOutlineView().setPropertyColumns(
outline = outlineView.getOutline();
outlineView.setPropertyColumns(
"TSK_EMAIL", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getDisplayName(), "TSK_EMAIL", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getDisplayName(),
"TSK_PHONE_NUMBER", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getDisplayName() "TSK_PHONE_NUMBER", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getDisplayName()
); );
outline.setRootVisible(false); outline.setRootVisible(false);
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.ContactsViewer_columnHeader_Name()); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.ContactsViewer_columnHeader_Name());
tableEM.addPropertyChangeListener((PropertyChangeEvent evt) -> { outlineViewPanel.hideOutlineView("<No contacts for selected account>");
outlineViewPanel.getExplorerManager().addPropertyChangeListener((PropertyChangeEvent evt) -> {
if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) { if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
final Node[] nodes = tableEM.getSelectedNodes(); final Node[] nodes = outlineViewPanel.getExplorerManager().getSelectedNodes();
contactPane.setNode(nodes); contactPane.setNode(nodes);
} }
}); });
tableEM.setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), getExplorerManager()), true)); outlineViewPanel.getExplorerManager().setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), outlineViewPanel.getExplorerManager()), true));
// When a new set of nodes are added to the OutlineView the childrenAdded
// seems to be fired before the childrenRemoved.
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter(){
@Override
public void childrenAdded(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
});
} }
@Override @Override
@ -125,11 +146,6 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
nodeFactory.refresh(info); nodeFactory.refresh(info);
} }
@Override
public ExplorerManager getExplorerManager() {
return tableEM;
}
@Override @Override
public Lookup getLookup() { public Lookup getLookup() {
return proxyLookup; return proxyLookup;
@ -140,14 +156,23 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
super.addNotify(); super.addNotify();
//add listener that maintains correct selection in the Global Actions Context //add listener that maintains correct selection in the Global Actions Context
KeyboardFocusManager.getCurrentKeyboardFocusManager() KeyboardFocusManager.getCurrentKeyboardFocusManager()
.addPropertyChangeListener("focusOwner", focusPropertyListener); .addPropertyChangeListener("focusOwner", focusPropertyListener); //NON-NLS
} }
@Override @Override
public void removeNotify() { public void removeNotify() {
super.removeNotify(); super.removeNotify();
KeyboardFocusManager.getCurrentKeyboardFocusManager() KeyboardFocusManager.getCurrentKeyboardFocusManager()
.removePropertyChangeListener("focusOwner", focusPropertyListener); .removePropertyChangeListener("focusOwner", focusPropertyListener); //NON-NLS
}
private void updateOutlineViewPanel() {
int nodeCount = outlineViewPanel.getExplorerManager().getRootContext().getChildren().getNodesCount();
if(nodeCount == 0) {
outlineViewPanel.hideOutlineView(Bundle.ContactsViewer_noContacts_message());
} else {
outlineViewPanel.showOutlineView();
}
} }
/** /**
@ -159,28 +184,28 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer,
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
outlineView = new org.openide.explorer.view.OutlineView();
contactPane = new org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane(); contactPane = new org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane();
outlineViewPanel = new org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(outlineViewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE) .addComponent(outlineViewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)) .addComponent(contactPane, javax.swing.GroupLayout.DEFAULT_SIZE, 332, 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 org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane contactPane; private org.sleuthkit.autopsy.communications.relationships.ContactDetailsPane contactPane;
private org.openide.explorer.view.OutlineView outlineView; private org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel outlineViewPanel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -16,27 +16,27 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="outlineView" alignment="0" max="32767" attributes="0"/> <Component id="contentViewer" max="32767" attributes="0"/>
<Component id="contentViewer" alignment="1" max="32767" attributes="0"/> <Component id="outlineViewPanel" alignment="0" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="outlineView" pref="300" max="32767" attributes="0"/> <Component id="outlineViewPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="contentViewer" pref="500" max="32767" attributes="0"/> <Component id="contentViewer" pref="390" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Component class="org.openide.explorer.view.OutlineView" name="outlineView">
</Component>
<Component class="org.sleuthkit.autopsy.contentviewers.MessageContentViewer" name="contentViewer"> <Component class="org.sleuthkit.autopsy.contentviewers.MessageContentViewer" name="contentViewer">
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MessageDataContent()"/> <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MessageDataContent()"/>
</AuxValues> </AuxValues>
</Component> </Component>
<Component class="org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel" name="outlineViewPanel">
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -23,7 +23,7 @@ import java.awt.KeyboardFocusManager;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities;
import static javax.swing.SwingUtilities.isDescendingFrom; import static javax.swing.SwingUtilities.isDescendingFrom;
import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline; import org.netbeans.swing.outline.Outline;
@ -32,6 +32,8 @@ import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.nodes.AbstractNode; import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children; import org.openide.nodes.Children;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.nodes.NodeAdapter;
import org.openide.nodes.NodeMemberEvent;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
@ -43,9 +45,8 @@ import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
* Visualation for the messages of the currently selected accounts. * Visualation for the messages of the currently selected accounts.
*/ */
@ServiceProvider(service = RelationshipsViewer.class) @ServiceProvider(service = RelationshipsViewer.class)
public final class MessagesViewer extends JPanel implements RelationshipsViewer, ExplorerManager.Provider, Lookup.Provider { public final class MessagesViewer extends JPanel implements RelationshipsViewer {
private final ExplorerManager tableEM;
private final Outline outline; private final Outline outline;
private final ModifiableProxyLookup proxyLookup; private final ModifiableProxyLookup proxyLookup;
private final PropertyChangeListener focusPropertyListener; private final PropertyChangeListener focusPropertyListener;
@ -57,15 +58,19 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
"MessageViewer_columnHeader_To=To", "MessageViewer_columnHeader_To=To",
"MessageViewer_columnHeader_Date=Date", "MessageViewer_columnHeader_Date=Date",
"MessageViewer_columnHeader_Subject=Subject", "MessageViewer_columnHeader_Subject=Subject",
"MessageViewer_columnHeader_Attms=Attachments" "MessageViewer_columnHeader_Attms=Attachments",
"MessageViewer_no_messages=<No messages found for selected account>"
}) })
/** /**
* Visualation for the messages of the currently selected accounts. * Visualation for the messages of the currently selected accounts.
*/ */
public MessagesViewer() { public MessagesViewer() {
tableEM = new ExplorerManager(); initComponents();
proxyLookup = new ModifiableProxyLookup(createLookup(tableEM, getActionMap()));
outlineViewPanel.hideOutlineView(Bundle.MessageViewer_no_messages());
proxyLookup = new ModifiableProxyLookup(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
nodeFactory = new MessagesChildNodeFactory(null); nodeFactory = new MessagesChildNodeFactory(null);
// See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed // See org.sleuthkit.autopsy.timeline.TimeLineTopComponent for a detailed
@ -82,29 +87,26 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
proxyLookup.setNewLookups(createLookup(((MessageDataContent) contentViewer).getExplorerManager(), getActionMap())); proxyLookup.setNewLookups(createLookup(((MessageDataContent) contentViewer).getExplorerManager(), getActionMap()));
} else if (isDescendingFrom(newFocusOwner, MessagesViewer.this)) { } else if (isDescendingFrom(newFocusOwner, MessagesViewer.this)) {
//... or if it is within the Results table. //... or if it is within the Results table.
proxyLookup.setNewLookups(createLookup(tableEM, getActionMap())); proxyLookup.setNewLookups(createLookup(outlineViewPanel.getExplorerManager(), getActionMap()));
} }
} }
}; };
initComponents(); outline = outlineViewPanel.getOutlineView().getOutline();
outlineViewPanel.getOutlineView().setPropertyColumns(
outline = outlineView.getOutline();
outlineView.setPropertyColumns(
"From", Bundle.MessageViewer_columnHeader_From(), "From", Bundle.MessageViewer_columnHeader_From(),
"To", Bundle.MessageViewer_columnHeader_To(), "To", Bundle.MessageViewer_columnHeader_To(),
"Date", Bundle.MessageViewer_columnHeader_Date(), "Date", Bundle.MessageViewer_columnHeader_Date(),
"Subject", Bundle.MessageViewer_columnHeader_Subject(), "Subject", Bundle.MessageViewer_columnHeader_Subject(),
"Attms", Bundle.MessageViewer_columnHeader_Attms(), "Attms", Bundle.MessageViewer_columnHeader_Attms()
"Type", "Type"
); );
outline.setRootVisible(false); outline.setRootVisible(false);
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Type"); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Type");
tableEM.addPropertyChangeListener((PropertyChangeEvent evt) -> { outlineViewPanel.getExplorerManager().addPropertyChangeListener((PropertyChangeEvent evt) -> {
if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) { if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
final Node[] nodes = tableEM.getSelectedNodes(); final Node[] nodes = outlineViewPanel.getExplorerManager().getSelectedNodes();
if (nodes != null && nodes.length == 1) { if (nodes != null && nodes.length == 1) {
contentViewer.setNode(nodes[0]); contentViewer.setNode(nodes[0]);
@ -115,7 +117,27 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
} }
}); });
tableEM.setRootContext(new TableFilterNode(new DataResultFilterNode(new AbstractNode(Children.create(nodeFactory, true)), getExplorerManager()), true)); outlineViewPanel.getExplorerManager().setRootContext(
new TableFilterNode(
new DataResultFilterNode(
new AbstractNode(
Children.create(nodeFactory, true)),
outlineViewPanel.getExplorerManager()),
true));
// When a new set of nodes are added to the OutlineView the childrenAdded
// seems to be fired before the childrenRemoved.
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter() {
@Override
public void childrenAdded(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
updateOutlineViewPanel();
}
});
} }
@Override @Override
@ -133,11 +155,6 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
nodeFactory.refresh(info); nodeFactory.refresh(info);
} }
@Override
public ExplorerManager getExplorerManager() {
return tableEM;
}
@Override @Override
public Lookup getLookup() { public Lookup getLookup() {
return proxyLookup; return proxyLookup;
@ -158,6 +175,15 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
.removePropertyChangeListener("focusOwner", focusPropertyListener); .removePropertyChangeListener("focusOwner", focusPropertyListener);
} }
private void updateOutlineViewPanel() {
int nodeCount = outlineViewPanel.getExplorerManager().getRootContext().getChildren().getNodesCount();
if(nodeCount == 0) {
outlineViewPanel.hideOutlineView(Bundle.MessageViewer_no_messages());
} else {
outlineViewPanel.showOutlineView();
}
}
/** /**
* This method is called from within the constructor to initialize the form. * This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always * WARNING: Do NOT modify this code. The content of this method is always
@ -167,28 +193,28 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer,
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
outlineView = new org.openide.explorer.view.OutlineView();
contentViewer = new MessageDataContent(); contentViewer = new MessageDataContent();
outlineViewPanel = new org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(contentViewer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(outlineViewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) .addComponent(outlineViewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE)) .addComponent(contentViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 390, 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 org.sleuthkit.autopsy.contentviewers.MessageContentViewer contentViewer; private org.sleuthkit.autopsy.contentviewers.MessageContentViewer contentViewer;
private org.openide.explorer.view.OutlineView outlineView; private org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel outlineViewPanel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -19,6 +19,7 @@
package org.sleuthkit.autopsy.communications.relationships; package org.sleuthkit.autopsy.communications.relationships;
import java.awt.CardLayout; import java.awt.CardLayout;
import javax.swing.SwingUtilities;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
import static org.openide.explorer.ExplorerUtils.createLookup; import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.explorer.view.OutlineView; import org.openide.explorer.view.OutlineView;
@ -62,17 +63,21 @@ public class OutlineViewPanel extends javax.swing.JPanel implements ExplorerMana
* @param message String message to show on the panel. * @param message String message to show on the panel.
*/ */
public void hideOutlineView(String message) { public void hideOutlineView(String message) {
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout(); CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "messageCard"); //NON-NLS layout.show(this, "messageCard"); //NON-NLS
messageLabel.setText(message); messageLabel.setText(message);
});
} }
/** /**
* Hides the message panel and shows the OutlineView. * Hides the message panel and shows the OutlineView.
*/ */
public void showOutlineView() { public void showOutlineView() {
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout(); CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "outlineCard"); //NON-NLS layout.show(this, "outlineCard"); //NON-NLS
});
} }
/** /**

View File

@ -45,7 +45,7 @@ public class SummaryViewer extends javax.swing.JPanel implements RelationshipsVi
"SummaryViewer_TabTitle=Summary", "SummaryViewer_TabTitle=Summary",
"SummaryViewer_FileRefNameColumn_Title=Path", "SummaryViewer_FileRefNameColumn_Title=Path",
"SummaryViewer_CaseRefNameColumn_Title=Case Name", "SummaryViewer_CaseRefNameColumn_Title=Case Name",
"SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Case References>", "SummaryViewer_CentralRepository_Message=<Enable Central Resposity to see Other Occurrences>",
"SummaryViewer_Creation_Date_Title=Creation Date" "SummaryViewer_Creation_Date_Title=Creation Date"
}) })