From 291c33dc63c88207ef5739f76695acd1e4b49c36 Mon Sep 17 00:00:00 2001 From: millmanorama Date: Mon, 26 Feb 2018 18:12:26 +0100 Subject: [PATCH] fix accout type icons in the DirectoryTree --- .../AccountDeviceInstanceNode.java | 2 +- .../communications/CommunicationsGraph.java | 8 +- .../autopsy/communications/FiltersPanel.form | 2 +- .../autopsy/communications/FiltersPanel.java | 5 +- .../autopsy/communications/Utils.java | 33 +----- .../autopsy/communications/images/calllog.png | Bin 691 -> 0 bytes .../communications/images/credit-card.png | Bin 536 -> 0 bytes .../autopsy/communications/images/image.png | Bin 1286 -> 0 bytes .../communications/images/web-file.png | Bin 928 -> 0 bytes .../autopsy/datamodel/accounts/Accounts.java | 112 +++++++++++------- .../{communications => }/images/WhatsApp.png | Bin .../{communications => }/images/email.png | Bin .../{communications => }/images/facebook.png | Bin .../{communications => }/images/instagram.png | Bin .../{communications => }/images/messaging.png | Bin .../{communications => }/images/phone.png | Bin .../{communications => }/images/twitter.png | Bin 17 files changed, 83 insertions(+), 79 deletions(-) delete mode 100644 Core/src/org/sleuthkit/autopsy/communications/images/calllog.png delete mode 100644 Core/src/org/sleuthkit/autopsy/communications/images/credit-card.png delete mode 100644 Core/src/org/sleuthkit/autopsy/communications/images/image.png delete mode 100644 Core/src/org/sleuthkit/autopsy/communications/images/web-file.png rename Core/src/org/sleuthkit/autopsy/{communications => }/images/WhatsApp.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/email.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/facebook.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/instagram.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/messaging.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/phone.png (100%) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/twitter.png (100%) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNode.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNode.java index eec27f30e5..40cb15d27d 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNode.java @@ -52,7 +52,7 @@ final class AccountDeviceInstanceNode extends AbstractNode { this.account = accountDeviceInstanceKey.getAccountDeviceInstance().getAccount(); setName(account.getTypeSpecificID()); setDisplayName(getName()); - setIconBaseWithExtension("org/sleuthkit/autopsy/communications/images/" + Utils.getIconFileName(account.getAccountType())); + setIconBaseWithExtension(Utils.getIconFilePath(account.getAccountType())); } AccountDeviceInstance getAccountDeviceInstance() { diff --git a/Core/src/org/sleuthkit/autopsy/communications/CommunicationsGraph.java b/Core/src/org/sleuthkit/autopsy/communications/CommunicationsGraph.java index 81ec5d7838..27bcded4e2 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/CommunicationsGraph.java +++ b/Core/src/org/sleuthkit/autopsy/communications/CommunicationsGraph.java @@ -168,8 +168,7 @@ final class CommunicationsGraph extends mxGraph { scopes.put("accountName", adiKey.getAccountDeviceInstance().getAccount().getTypeSpecificID()); scopes.put("size", Math.round(Math.log(adiKey.getMessageCount()) + 5)); - scopes.put("iconFileName", CommunicationsGraph.class.getResource("/org/sleuthkit/autopsy/communications/images/" - + Utils.getIconFileName(adiKey.getAccountDeviceInstance().getAccount().getAccountType()))); + scopes.put("iconFileName", CommunicationsGraph.class.getResource( Utils.getIconFilePath(adiKey.getAccountDeviceInstance().getAccount().getAccountType()))); scopes.put("pinned", pinnedAccountModel.isAccountPinned(adiKey)); scopes.put("MARKER_PIN_URL", MARKER_PIN_URL); scopes.put("locked", lockedVertexModel.isVertexLocked((mxCell) cell)); @@ -194,8 +193,7 @@ final class CommunicationsGraph extends mxGraph { scopes.put("accountName", adiKey.getAccountDeviceInstance().getAccount().getTypeSpecificID()); scopes.put("size", 12);// Math.round(Math.log(adiKey.getMessageCount()) + 5)); - scopes.put("iconFileName", CommunicationsGraph.class.getResource("/org/sleuthkit/autopsy/communications/images/" - + Utils.getIconFileName(adiKey.getAccountDeviceInstance().getAccount().getAccountType()))); + scopes.put("iconFileName", CommunicationsGraph.class.getResource( Utils.getIconFilePath(adiKey.getAccountDeviceInstance().getAccount().getAccountType()))); scopes.put("pinned", pinnedAccountModel.isAccountPinned(adiKey)); scopes.put("MARKER_PIN_URL", MARKER_PIN_URL); scopes.put("locked", lockedVertexModel.isVertexLocked((mxCell) cell)); @@ -310,7 +308,7 @@ final class CommunicationsGraph extends mxGraph { Set accountIDs = relatedAccounts.keySet(); - Map relationshipCounts = commsManager.getRelationshipCounts(accountIDs, currentFilter); + Map relationshipCounts = commsManager.getRelationshipCountsBetween(accountIDs, currentFilter); int total = relationshipCounts.size(); int k = 0; diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form index 25153de997..eca450180a 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form @@ -244,7 +244,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 36f9ac4410..1832e305f2 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -201,8 +201,7 @@ final public class FiltersPanel extends JPanel { accountTypeMap.computeIfAbsent(type, t -> { final JCheckBox jCheckBox = new JCheckBox( "
" + type.getDisplayName() + "
", true ); @@ -327,7 +326,7 @@ final public class FiltersPanel extends JPanel { } }); - devicesLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/communications/images/image.png"))); // NOI18N + devicesLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/image.png"))); // NOI18N devicesLabel.setText(org.openide.util.NbBundle.getMessage(FiltersPanel.class, "FiltersPanel.devicesLabel.text")); // NOI18N checkAllDevicesButton.setText(org.openide.util.NbBundle.getMessage(FiltersPanel.class, "FiltersPanel.checkAllDevicesButton.text")); // NOI18N diff --git a/Core/src/org/sleuthkit/autopsy/communications/Utils.java b/Core/src/org/sleuthkit/autopsy/communications/Utils.java index 91ee1e9fdf..b155e3b4b4 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/Utils.java +++ b/Core/src/org/sleuthkit/autopsy/communications/Utils.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.communications; import java.time.ZoneId; import java.time.ZoneOffset; import org.sleuthkit.autopsy.core.UserPreferences; +import org.sleuthkit.autopsy.datamodel.accounts.Accounts; import org.sleuthkit.datamodel.Account; /** @@ -37,36 +38,12 @@ class Utils { } /** - * The file name of the icon for the given Account Type. Will not include - * the path but will include the extension. + * Get the path of the icon for the given Account Type. * - * @return The file name of the icon for the given Account Type. + * @return The path of the icon for the given Account Type. */ - static final String getIconFileName(Account.Type type) { - if (type.equals(Account.Type.CREDIT_CARD)) { - return "credit-card.png"; - } else if (type.equals(Account.Type.DEVICE)) { - return "image.png"; - } else if (type.equals(Account.Type.EMAIL)) { - return "email.png"; - } else if (type.equals(Account.Type.FACEBOOK)) { - return "facebook.png"; - } else if (type.equals(Account.Type.INSTAGRAM)) { - return "instagram.png"; - } else if (type.equals(Account.Type.MESSAGING_APP)) { - return "messaging.png"; - } else if (type.equals(Account.Type.PHONE)) { - return "phone.png"; - } else if (type.equals(Account.Type.TWITTER)) { - return "twitter.png"; - } else if (type.equals(Account.Type.WEBSITE)) { - return "web-file.png"; - } else if (type.equals(Account.Type.WHATSAPP)) { - return "WhatsApp.png"; - } else { - //there could be a default icon instead... - throw new IllegalArgumentException("Unknown Account.Type: " + type.getTypeName()); - } + static final String getIconFilePath(Account.Type type) { + return Accounts.getIconFilePath(type); } } diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/calllog.png b/Core/src/org/sleuthkit/autopsy/communications/images/calllog.png deleted file mode 100644 index 83eb9c448d592e1cc125710cd5d02e9520543457..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 691 zcmV;k0!;mhP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0!T?jK~y+TjgoCh zQ&AYl|9880cXtjqbbg5Z;Dkjb=7)k&R75l=C>PWh2lh6~K#EcdBFLZyWe~LwjrvrO z4#om2h_a|82}*QEnvNu#m=5!8tG(QLx7)dQw{5*F{BiF&-2XYx|D5|g4183s#&04;6A1%ExNOnSH)hvdz_xZXL8`KW-)$Lq2; z*u3@#qKPn4LJV`!2{?D$1E;6qKGX-db5Rb8#d$Jj(DmvI+BzcW9r`Zoxhgcd%b?S7 zs5EXs>;8xGVj-cgbJ%@u7z+svHm#=MyJVI1TosykcHvuO3L{h9NW@9a{$M#eatwSriSzes74>%x+l*+on=v>VRuqEt3x%AyT`M+RgXrqmt|)ng z)Vvr7`jxLN|Lnw5x6BB~$5CmppmpyvtT36;`_YTLua82*s9~*Y!ogkb^4_AYeA;8d zOni)7QGUQ_RM2ZHK&x5A_&Mxbe-k#Vv$%moyVs6^$wx5gbf8GOD2jqw#gJnuqi zli~jxNc04}@H};ZP5QYc-1MhL{N;xsM|AwM7lLDIN%<;ozE6b6F}n?P(y_qDgX zli8CH$OIL3;f1-Kxw$uQ=Ix#!BHU$3+;J(jd$G;?)-A9C)*dK!HrHP~SfSF@B=;lv zp#s5`B|;_GWaayJ0h*XE5Jf zrE$K1RnWy`=2>ljGB05=$E`b*r9~|wP(EZ4i+s+j?FE}P^YaElauATeJQ7ELERgn< zBAv(nsNOCC-AmwU!!khQaggG7B5^oq;t7M7->)G$ImEM%8(UU27CcUEuZC4#;&X6tS|-jrNc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh**NZ(?$0 z9!LbN!`Ii!Gq1QLF)umQ)5TT^Xog;9W{Q=oo0FxHp|iP}o1>|rp{t>Vo2#X(rHh-R zqqBjFi;)vduSMv>2~2MaLazl*y`aR9TL84#CABECEH%ZgC_h&L>}jh^+-@<& zX&zK>3U0TU;nb@Sbc{YIYLTKECIn1BASOKF0y*%cpPC0u??u3b9iF@#n8O$=JY5_^ zDsCnH`TyUZS+!we7Tb&&GYptl<~y8mYq4uIPCr+}Vi+-j<>`^5syCjUo!uXvUR9-a zc(S^`N`ns%^A%RsR*7kPv3(0q-Z;T>?%9I}Oo5jiYJ~4Hh&nntvc<~U@-Wx^{l%L8 zxuCdNgHuBODl3x{kA3~WmLKkMY)2=!^UrU{^wZOu!=~}+!-qq;xA#`_cQJNxc?mFE ze2_T6TOxOYAyw3sEz&ZxZFl**W>tq80fvt^ZycPc(v`$u!WAlKTXllrkb9pTlXp>Z z){gdBN^78)|e))gy@^*jXeL_Wb?1WeKw+2l5{r9i+;lsJNCI0QJ zJ^eu}zopr08J6R{Qv*} diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/web-file.png b/Core/src/org/sleuthkit/autopsy/communications/images/web-file.png deleted file mode 100644 index ac5957ad62d73408cd754a27453b4ce601a2b042..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 928 zcmV;R17G}!P)Mh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00QhuL_t(I%dL}LXj^3*hoASH_nc#sG-;dWqm6CW(4s83b+X9Bt0|~3 z6mOI%-9=?M5O0K`ptn*G#rs`|6-PnD>5WW=H?uIcvzCo^E3WHYKeL=HA5C(SbCR6b z3)#f&*5~^FdoKR`eu4)${@&~<;4NLs{R%AQ`wgX7&~)wW+|1M$58jLW!S}zMGrL#P4P+<|J^kR=q!LjUR<=1mzj7BLp1miL0MTgZr{|x^iYGDyl!|!#OL6OV`f;PXlOge)!c#$#{SGXl@)s^XbSCXaYk@OhXc|B#CG* zL-81~z96~mqojuij=b@~*=YbR90{B}oE@c7E^@~W5Fg%$Qs65I} diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index b3e8a9a1b1..203ca38a70 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,7 +54,6 @@ import org.openide.nodes.Node; import org.openide.nodes.NodeNotFoundException; import org.openide.nodes.NodeOp; import org.openide.nodes.Sheet; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.openide.util.lookup.Lookups; @@ -73,7 +72,6 @@ import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.ModuleDataEvent; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Account; -import org.sleuthkit.datamodel.AccountFileInstance; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; import org.sleuthkit.datamodel.BlackboardAttribute; @@ -89,6 +87,7 @@ import org.sleuthkit.datamodel.TskData.DbType; final public class Accounts implements AutopsyVisitableItem { private static final Logger LOGGER = Logger.getLogger(Accounts.class.getName()); + private static final String iconBasePath = "/org/sleuthkit/autopsy/images/"; //NON-NLS @NbBundle.Messages("AccountsRootNode.name=Accounts") final public static String NAME = Bundle.AccountsRootNode_name(); @@ -126,7 +125,7 @@ final public class Accounts implements AutopsyVisitableItem { * results from db queries. * * @return A clause that will or will not filter out rejected artifacts - * based on the state of showRejected. + * based on the state of showRejected. */ private String getRejectedArtifactFilterClause() { return showRejected ? " " : " AND blackboard_artifacts.review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID() + " "; //NON-NLS @@ -137,7 +136,7 @@ final public class Accounts implements AutopsyVisitableItem { * or off. * * @return An Action that will toggle whether rejected artifacts are shown - * in the tree rooted by this Accounts instance. + * in the tree rooted by this Accounts instance. */ public Action newToggleShowRejectedAction() { return new ToggleShowRejected(); @@ -225,8 +224,8 @@ final public class Accounts implements AutopsyVisitableItem { private class AccountTypeFactory extends ObservingChildren { /* - * The pcl is in this class because it has the easiest mechanisms to - * add and remove itself during its life cycles. + * The pcl is in this class because it has the easiest mechanisms to add + * and remove itself during its life cycles. */ private final PropertyChangeListener pcl = new PropertyChangeListener() { @Override @@ -310,23 +309,21 @@ final public class Accounts implements AutopsyVisitableItem { } @Override - protected Node[] createNodesForKey(String key) { + protected Node[] createNodesForKey(String acountTypeName) { - String accountType = key; - if (accountType.equals(Account.Type.CREDIT_CARD.getTypeName())) { + if (Account.Type.CREDIT_CARD.getTypeName().equals(acountTypeName)) { return new Node[]{new CreditCardNumberAccountTypeNode()}; } else { - String accountTypeDisplayname; + try { - accountTypeDisplayname = skCase.getCommunicationsManager().getAccountType(accountType).getDisplayName(); + Account.Type accountType = skCase.getCommunicationsManager().getAccountType(acountTypeName); + return new Node[]{new DefaultAccountTypeNode(accountType)}; } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Error getting display name for account type. ", ex); - accountTypeDisplayname = accountType; } - return new Node[]{new DefaultAccountTypeNode(key, accountTypeDisplayname)}; + return new Node[]{}; } - } @Override @@ -350,10 +347,10 @@ final public class Accounts implements AutopsyVisitableItem { final private class DefaultAccountFactory extends ObservingChildren { - private final String accountTypeName; + private final Account.Type accountType; - private DefaultAccountFactory(String accountTypeName) { - this.accountTypeName = accountTypeName; + private DefaultAccountFactory(Account.Type accountType) { + this.accountType = accountType; } private final PropertyChangeListener pcl = new PropertyChangeListener() { @@ -424,13 +421,13 @@ final public class Accounts implements AutopsyVisitableItem { @Override protected boolean createKeys(List list) { - String query - = "SELECT blackboard_artifacts.artifact_id " //NON-NLS + String query = + "SELECT blackboard_artifacts.artifact_id " //NON-NLS + " FROM blackboard_artifacts " //NON-NLS + " JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id " //NON-NLS + " WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID() //NON-NLS + " AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID() //NON-NLS - + " AND blackboard_attributes.value_text = '" + accountTypeName + "'" //NON-NLS + + " AND blackboard_attributes.value_text = '" + accountType.getTypeName() + "'" //NON-NLS + getRejectedArtifactFilterClause(); //NON-NLS try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query); ResultSet rs = results.getResultSet();) { @@ -473,10 +470,10 @@ final public class Accounts implements AutopsyVisitableItem { */ final public class DefaultAccountTypeNode extends DisplayableItemNode { - private DefaultAccountTypeNode(String accountTypeName, String accountTypeDisplayName) { - super(Children.create(new DefaultAccountFactory(accountTypeName), true), Lookups.singleton(accountTypeDisplayName)); - setName(accountTypeDisplayName); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/credit-cards.png"); //NON-NLS + private DefaultAccountTypeNode(Account.Type accountType) { + super(Children.create(new DefaultAccountFactory(accountType), true), Lookups.singleton(accountType)); + setName(accountType.getDisplayName()); + this.setIconBaseWithExtension(getIconFilePath(accountType)); //NON-NLS } @Override @@ -1161,13 +1158,13 @@ final public class Accounts implements AutopsyVisitableItem { * take the result of a group_concat SQLite operation and split it into a * set of X using the mapper to to convert from string to X * - * @param the type of elements to return + * @param the type of elements to return * @param groupConcat a string containing the group_concat result ( a comma - * separated list) - * @param mapper a function from String to X + * separated list) + * @param mapper a function from String to X * * @return a Set of X, each element mapped from one element of the original - * comma delimited string + * comma delimited string */ static List unGroupConcat(String groupConcat, Function mapper) { return StringUtils.isBlank(groupConcat) ? Collections.emptyList() @@ -1187,8 +1184,8 @@ final public class Accounts implements AutopsyVisitableItem { /** * Constructor * - * @param key The FileWithCCN that backs this node. - * @param content The Content object the key represents. + * @param key The FileWithCCN that backs this node. + * @param content The Content object the key represents. * @param lookupContents The contents of this Node's lookup. It should * contain the content object and the account artifacts. */ @@ -1465,11 +1462,11 @@ final public class Accounts implements AutopsyVisitableItem { } return sheet; } - + private void updateSheet() { this.setSheet(createSheet()); } - + } /** @@ -1601,7 +1598,7 @@ final public class Accounts implements AutopsyVisitableItem { super(artifact, "org/sleuthkit/autopsy/images/credit-card.png"); //NON-NLS this.artifact = artifact; setName("" + this.artifact.getArtifactID()); - + reviewStatusBus.register(this); } @@ -1628,13 +1625,13 @@ final public class Accounts implements AutopsyVisitableItem { Bundle.Accounts_FileWithCCNNode_statusProperty_displayName(), Bundle.Accounts_FileWithCCNNode_noDescription(), artifact.getReviewStatus().getDisplayName())); - + return sheet; } - + @Subscribe void handleReviewStatusChange(ReviewStatusChangeEvent event) { - + // Update the node if event includes this artifact event.artifacts.stream().filter((art) -> (art.getArtifactID() == this.artifact.getArtifactID())).map((_item) -> { return _item; @@ -1642,11 +1639,11 @@ final public class Accounts implements AutopsyVisitableItem { updateSheet(); }); } - + private void updateSheet() { this.setSheet(createSheet()); } - + } private final class ToggleShowRejected extends AbstractAction { @@ -1755,14 +1752,47 @@ final public class Accounts implements AutopsyVisitableItem { } } - private class ReviewStatusChangeEvent { + static private class ReviewStatusChangeEvent { Collection artifacts; BlackboardArtifact.ReviewStatus newReviewStatus; - public ReviewStatusChangeEvent(Collection artifacts, BlackboardArtifact.ReviewStatus newReviewStatus) { + ReviewStatusChangeEvent(Collection artifacts, BlackboardArtifact.ReviewStatus newReviewStatus) { this.artifacts = artifacts; this.newReviewStatus = newReviewStatus; } } + + /** + * Get the path of the icon for the given Account Type. + * + * @return The path of the icon for the given Account Type. + */ + public static String getIconFilePath(Account.Type type) { + + if (type.equals(Account.Type.CREDIT_CARD)) { + return iconBasePath + "credit-card.png"; + } else if (type.equals(Account.Type.DEVICE)) { + return iconBasePath + "image.png"; + } else if (type.equals(Account.Type.EMAIL)) { + return iconBasePath + "email.png"; + } else if (type.equals(Account.Type.FACEBOOK)) { + return iconBasePath + "facebook.png"; + } else if (type.equals(Account.Type.INSTAGRAM)) { + return iconBasePath + "instagram.png"; + } else if (type.equals(Account.Type.MESSAGING_APP)) { + return iconBasePath + "messaging.png"; + } else if (type.equals(Account.Type.PHONE)) { + return iconBasePath + "phone.png"; + } else if (type.equals(Account.Type.TWITTER)) { + return iconBasePath + "twitter.png"; + } else if (type.equals(Account.Type.WEBSITE)) { + return iconBasePath + "web-file.png"; + } else if (type.equals(Account.Type.WHATSAPP)) { + return iconBasePath + "WhatsApp.png"; + } else { + //there could be a default icon instead... + throw new IllegalArgumentException("Unknown Account.Type: " + type.getTypeName()); + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/WhatsApp.png b/Core/src/org/sleuthkit/autopsy/images/WhatsApp.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/WhatsApp.png rename to Core/src/org/sleuthkit/autopsy/images/WhatsApp.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/email.png b/Core/src/org/sleuthkit/autopsy/images/email.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/email.png rename to Core/src/org/sleuthkit/autopsy/images/email.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/facebook.png b/Core/src/org/sleuthkit/autopsy/images/facebook.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/facebook.png rename to Core/src/org/sleuthkit/autopsy/images/facebook.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/instagram.png b/Core/src/org/sleuthkit/autopsy/images/instagram.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/instagram.png rename to Core/src/org/sleuthkit/autopsy/images/instagram.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/messaging.png b/Core/src/org/sleuthkit/autopsy/images/messaging.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/messaging.png rename to Core/src/org/sleuthkit/autopsy/images/messaging.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/phone.png b/Core/src/org/sleuthkit/autopsy/images/phone.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/phone.png rename to Core/src/org/sleuthkit/autopsy/images/phone.png diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/twitter.png b/Core/src/org/sleuthkit/autopsy/images/twitter.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/twitter.png rename to Core/src/org/sleuthkit/autopsy/images/twitter.png