19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.awt.image.BufferedImage;
23 import java.io.IOException;
24 import java.util.logging.Level;
25 import javax.imageio.ImageIO;
26 import javax.swing.ImageIcon;
27 import org.openide.explorer.ExplorerManager;
28 import org.openide.nodes.Node;
38 public final class ContactDetailsPane extends javax.swing.JPanel implements ExplorerManager.Provider {
42 private final static String
DEFAULT_IMAGE_PATH =
"/org/sleuthkit/autopsy/communications/images/defaultContact.png";
54 defaultImage =
new ImageIcon(
ContactDetailsPane.class.getResource(DEFAULT_IMAGE_PATH));
63 if (nodes != null && nodes.length == 1) {
64 nameLabel.setText(nodes[0].getDisplayName());
68 BlackboardArtifact n = nodes[0].getLookup().lookup(BlackboardArtifact.class);
87 if(artifact == null) {
91 BlackboardArtifact.ARTIFACT_TYPE artifactType = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID());
92 if(artifactType != BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT) {
97 for(Content content: artifact.getChildren()) {
98 if(content instanceof AbstractFile) {
99 AbstractFile file = (AbstractFile)content;
102 BufferedImage image = ImageIO.read(
new File(file.getLocalAbsPath()));
103 imageIcon =
new ImageIcon(image);
105 }
catch (IOException ex) {
112 }
catch (TskCoreException ex) {
113 logger.log(Level.WARNING, String.format(
"Unable to load image for contact: %d", artifact.getId()), ex);
124 @SuppressWarnings(
"unchecked")
127 java.awt.GridBagConstraints gridBagConstraints;
132 setLayout(
new java.awt.GridBagLayout());
136 gridBagConstraints =
new java.awt.GridBagConstraints();
137 gridBagConstraints.gridx = 0;
138 gridBagConstraints.gridy = 0;
139 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
140 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
141 gridBagConstraints.weightx = 1.0;
142 gridBagConstraints.insets =
new java.awt.Insets(16, 15, 15, 15);
146 gridBagConstraints =
new java.awt.GridBagConstraints();
147 gridBagConstraints.gridx = 0;
148 gridBagConstraints.gridy = 1;
149 gridBagConstraints.gridwidth = 2;
150 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
151 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
152 gridBagConstraints.weightx = 1.0;
153 gridBagConstraints.weighty = 1.0;
154 gridBagConstraints.insets =
new java.awt.Insets(9, 15, 16, 15);
synchronized static Logger getLogger(String name)