mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-18 02:27:42 +00:00
allow Device Account Type (and filter) in Visualization panel
This commit is contained in:
parent
db89695d5d
commit
70997fa7da
@ -24,6 +24,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.openide.nodes.ChildFactory;
|
import org.openide.nodes.ChildFactory;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
|
import org.sleuthkit.datamodel.Account;
|
||||||
import org.sleuthkit.datamodel.AccountDeviceInstance;
|
import org.sleuthkit.datamodel.AccountDeviceInstance;
|
||||||
import org.sleuthkit.datamodel.CommunicationsFilter;
|
import org.sleuthkit.datamodel.CommunicationsFilter;
|
||||||
import org.sleuthkit.datamodel.CommunicationsManager;
|
import org.sleuthkit.datamodel.CommunicationsManager;
|
||||||
@ -53,9 +54,12 @@ final class AccountDeviceInstanceNodeFactory extends ChildFactory<AccountDeviceI
|
|||||||
final List<AccountDeviceInstance> accountDeviceInstancesWithRelationships =
|
final List<AccountDeviceInstance> accountDeviceInstancesWithRelationships =
|
||||||
commsManager.getAccountDeviceInstancesWithRelationships(commsFilter);
|
commsManager.getAccountDeviceInstancesWithRelationships(commsFilter);
|
||||||
for (AccountDeviceInstance accountDeviceInstance : accountDeviceInstancesWithRelationships) {
|
for (AccountDeviceInstance accountDeviceInstance : accountDeviceInstancesWithRelationships) {
|
||||||
|
//Filter out device accounts, in the table.
|
||||||
|
if (Account.Type.DEVICE.equals(accountDeviceInstance.getAccount().getAccountType()) ==false) {
|
||||||
long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter);
|
long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter);
|
||||||
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount));
|
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (TskCoreException tskCoreException) {
|
} catch (TskCoreException tskCoreException) {
|
||||||
logger.log(Level.SEVERE, "Error getting filtered account device instances", tskCoreException);
|
logger.log(Level.SEVERE, "Error getting filtered account device instances", tskCoreException);
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ public final class CVTTopComponent extends TopComponent {
|
|||||||
browseVisualizeTabPane.addChangeListener(changeEvent -> {
|
browseVisualizeTabPane.addChangeListener(changeEvent -> {
|
||||||
Lookup.Provider selectedComponent = (Lookup.Provider) browseVisualizeTabPane.getSelectedComponent();
|
Lookup.Provider selectedComponent = (Lookup.Provider) browseVisualizeTabPane.getSelectedComponent();
|
||||||
proxyLookup.changeLookups(selectedComponent.getLookup());
|
proxyLookup.changeLookups(selectedComponent.getLookup());
|
||||||
|
filtersPane.setDeviceAccountTypeEnabled(browseVisualizeTabPane.getSelectedIndex() != 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ final public class FiltersPanel extends JPanel {
|
|||||||
* results)
|
* results)
|
||||||
*/
|
*/
|
||||||
private final ItemListener validationListener;
|
private final ItemListener validationListener;
|
||||||
|
private boolean deviceAccountTypeEnabled = false;
|
||||||
|
|
||||||
@NbBundle.Messages({"refreshText=Refresh Results",
|
@NbBundle.Messages({"refreshText=Refresh Results",
|
||||||
"applyText=Apply"})
|
"applyText=Apply"})
|
||||||
@ -196,8 +197,8 @@ final public class FiltersPanel extends JPanel {
|
|||||||
Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> {
|
Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> {
|
||||||
if (type.equals(Account.Type.CREDIT_CARD)) {
|
if (type.equals(Account.Type.CREDIT_CARD)) {
|
||||||
//don't show a check box for credit cards
|
//don't show a check box for credit cards
|
||||||
} else if (type.equals(Account.Type.DEVICE)) {
|
// } else if (type.equals(Account.Type.DEVICE)) {
|
||||||
//don't show a check box fro device
|
// //don't show a check box fro device
|
||||||
} else {
|
} else {
|
||||||
accountTypeMap.computeIfAbsent(type, t -> {
|
accountTypeMap.computeIfAbsent(type, t -> {
|
||||||
final JCheckBox jCheckBox = new JCheckBox(
|
final JCheckBox jCheckBox = new JCheckBox(
|
||||||
@ -209,6 +210,9 @@ final public class FiltersPanel extends JPanel {
|
|||||||
);
|
);
|
||||||
jCheckBox.addItemListener(validationListener);
|
jCheckBox.addItemListener(validationListener);
|
||||||
accountTypePane.add(jCheckBox);
|
accountTypePane.add(jCheckBox);
|
||||||
|
if (t.equals(Account.Type.DEVICE)) {
|
||||||
|
jCheckBox.setEnabled(deviceAccountTypeEnabled);
|
||||||
|
}
|
||||||
return jCheckBox;
|
return jCheckBox;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -618,4 +622,11 @@ final public class FiltersPanel extends JPanel {
|
|||||||
private final javax.swing.JButton unCheckAllDevicesButton = new javax.swing.JButton();
|
private final javax.swing.JButton unCheckAllDevicesButton = new javax.swing.JButton();
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
void setDeviceAccountTypeEnabled(boolean enableDeviceAccountType) {
|
||||||
|
deviceAccountTypeEnabled = enableDeviceAccountType;
|
||||||
|
JCheckBox deviceCheckbox = accountTypeMap.get(Account.Type.DEVICE);
|
||||||
|
if (deviceCheckbox != null) {
|
||||||
|
deviceCheckbox.setEnabled(deviceAccountTypeEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user