From fe5f587198cd9f2cee9f46c7e09fbe953cf642ff Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Thu, 3 Oct 2019 15:12:21 -0400 Subject: [PATCH] Cleaned up changes --- .../communications/CVTTopComponent.java | 40 ++++++++++++------ .../autopsy/communications/FiltersPanel.form | 11 ++--- .../autopsy/communications/FiltersPanel.java | 10 +++-- .../communications/VisualizationPanel.form | 6 +-- .../communications/VisualizationPanel.java | 8 ++-- .../communications/images/arrow-180.png | Bin 0 -> 1022 bytes .../autopsy/communications/images/arrow.png | Bin 0 -> 1062 bytes .../DataResultViewerThumbnail.java | 1 + .../WrapLayout.java | 2 +- 9 files changed, 48 insertions(+), 30 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/communications/images/arrow-180.png create mode 100755 Core/src/org/sleuthkit/autopsy/communications/images/arrow.png rename Core/src/org/sleuthkit/autopsy/{corecomponents => uicomponents}/WrapLayout.java (99%) mode change 100644 => 100755 diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java index db62579ad5..69ea42c8aa 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java @@ -24,6 +24,7 @@ import java.awt.Component; import java.awt.Font; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.HashSet; import java.util.List; import java.util.stream.Collectors; import javax.swing.ImageIcon; @@ -37,7 +38,9 @@ import org.openide.windows.RetainLocation; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.communications.relationships.RelationshipBrowser; +import org.sleuthkit.autopsy.communications.relationships.SelectionInfo; import org.sleuthkit.autopsy.coreutils.ThreadConfined; +import org.sleuthkit.datamodel.CommunicationsFilter; /** * Top component which displays the Communications Visualization Tool. @@ -51,11 +54,11 @@ public final class CVTTopComponent extends TopComponent { private static final long serialVersionUID = 1L; private boolean filtersVisible = true; - private final RelationshipBrowser relationshipBrowser; + private final RelationshipBrowser relationshipBrowser = new RelationshipBrowser(); + private CommunicationsFilter currentFilter; @ThreadConfined(type = ThreadConfined.ThreadType.AWT) public CVTTopComponent() { - relationshipBrowser = new RelationshipBrowser(); initComponents(); splitPane.setRightComponent(relationshipBrowser); @@ -77,6 +80,8 @@ public final class CVTTopComponent extends TopComponent { Lookup lookup = ((Lookup.Provider)selectedComponent).getLookup(); proxyLookup.setNewLookups(lookup); } + + relationshipBrowser.setSelectionInfo(new SelectionInfo(new HashSet<>(), new HashSet<>(), currentFilter)); }); @@ -88,12 +93,20 @@ public final class CVTTopComponent extends TopComponent { CVTEvents.getCVTEventBus().register(vizPanel); CVTEvents.getCVTEventBus().register(accountsBrowser); CVTEvents.getCVTEventBus().register(filtersPane); + + filterTabbedPane.setIconAt(0, new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/communications/images/arrow-180.png"))); + filterTabbedPane.setTitleAt(0, ""); } @Subscribe void pinAccount(CVTEvents.PinAccountsEvent pinEvent) { browseVisualizeTabPane.setSelectedIndex(1); } + + @Subscribe + void handle(final CVTEvents.FilterChangeEvent filterChangeEvent) { + currentFilter = filterChangeEvent.getNewFilter(); + } /** * This method is called from within the constructor to initialize the form. @@ -103,7 +116,7 @@ public final class CVTTopComponent extends TopComponent { // //GEN-BEGIN:initComponents private void initComponents() { - filterTabPane = new JTabbedPane(); + filterTabbedPane = new JTabbedPane(); filterTabPanel = new JPanel(); filtersPane = new FiltersPanel(); splitPane = new JSplitPane(); @@ -113,17 +126,18 @@ public final class CVTTopComponent extends TopComponent { setLayout(new BorderLayout()); - filterTabPane.addMouseListener(new MouseAdapter() { + filterTabbedPane.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { - filterTabPaneMouseClicked(evt); + filterTabbedPaneMouseClicked(evt); } }); - filterTabPanel.add(filtersPane); + filterTabPanel.setLayout(new BorderLayout()); + filterTabPanel.add(filtersPane, BorderLayout.CENTER); - filterTabPane.addTab(NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.filterTabPanel.TabConstraints.tabTitle"), filterTabPanel); // NOI18N + filterTabbedPane.addTab(NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.filterTabPanel.TabConstraints.tabTitle"), filterTabPanel); // NOI18N - add(filterTabPane, BorderLayout.WEST); + add(filterTabbedPane, BorderLayout.WEST); splitPane.setDividerLocation(1); splitPane.setResizeWeight(0.25); @@ -138,15 +152,17 @@ public final class CVTTopComponent extends TopComponent { add(splitPane, BorderLayout.CENTER); }// //GEN-END:initComponents - private void filterTabPaneMouseClicked(MouseEvent evt) {//GEN-FIRST:event_filterTabPaneMouseClicked - int index = filterTabPane.indexAtLocation(evt.getX(), evt.getY()); + private void filterTabbedPaneMouseClicked(MouseEvent evt) {//GEN-FIRST:event_filterTabPaneMouseClicked + int index = filterTabbedPane.indexAtLocation(evt.getX(), evt.getY()); if(index != -1) { if(filtersVisible) { + filterTabbedPane.setIconAt(0, new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/communications/images/arrow.png"))); filterTabPanel.removeAll(); filterTabPanel.revalidate(); filtersVisible = false; } else { - filterTabPanel.add(filtersPane); + filterTabbedPane.setIconAt(0, new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/communications/images/arrow-180.png"))); + filterTabPanel.add(filtersPane, BorderLayout.CENTER); filterTabPanel.revalidate(); filtersVisible = true; } @@ -157,7 +173,7 @@ public final class CVTTopComponent extends TopComponent { // Variables declaration - do not modify//GEN-BEGIN:variables private AccountsBrowser accountsBrowser; private JTabbedPane browseVisualizeTabPane; - private JTabbedPane filterTabPane; + private JTabbedPane filterTabbedPane; private JPanel filterTabPanel; private FiltersPanel filtersPane; private JSplitPane splitPane; diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form index 33fe6d5228..c1b520127e 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.form @@ -18,6 +18,7 @@ + @@ -37,7 +38,7 @@ - + @@ -128,7 +129,7 @@ - + @@ -222,7 +223,7 @@ - + @@ -325,7 +326,7 @@ - + @@ -422,7 +423,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index a9c6f58e4e..61485832b0 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -477,6 +477,7 @@ final public class FiltersPanel extends JPanel { setLayout(new java.awt.GridBagLayout()); + scrollPane.setAutoscrolls(true); scrollPane.setBorder(null); mainPanel.setLayout(new java.awt.GridBagLayout()); @@ -541,7 +542,7 @@ final public class FiltersPanel extends JPanel { gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; - gridBagConstraints.insets = new java.awt.Insets(15, 0, 15, 0); + gridBagConstraints.insets = new java.awt.Insets(15, 0, 15, 25); mainPanel.add(limitPane, gridBagConstraints); startDatePicker.setEnabled(false); @@ -608,7 +609,7 @@ final public class FiltersPanel extends JPanel { gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 0); + gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 25); mainPanel.add(dateRangePane, gridBagConstraints); devicesPane.setLayout(new java.awt.GridBagLayout()); @@ -686,7 +687,7 @@ final public class FiltersPanel extends JPanel { gridBagConstraints.ipady = 100; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 0); + gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 25); mainPanel.add(devicesPane, gridBagConstraints); accountTypesPane.setLayout(new java.awt.GridBagLayout()); @@ -760,7 +761,7 @@ final public class FiltersPanel extends JPanel { gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 0); + gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 25); mainPanel.add(accountTypesPane, gridBagConstraints); topPane.setLayout(new java.awt.GridBagLayout()); @@ -810,6 +811,7 @@ final public class FiltersPanel extends JPanel { gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 25); mainPanel.add(topPane, gridBagConstraints); scrollPane.setViewportView(mainPanel); diff --git a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.form b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.form index 4d8b4860dc..910b2a8bd3 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.form @@ -15,7 +15,7 @@ - + @@ -40,9 +40,9 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java index 4d689f0642..cd52af336c 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java @@ -47,8 +47,6 @@ import java.awt.FlowLayout; import java.awt.Font; import java.awt.Frame; import java.awt.Graphics; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -113,7 +111,7 @@ import org.sleuthkit.datamodel.AccountDeviceInstance; import org.sleuthkit.datamodel.CommunicationsFilter; import org.sleuthkit.datamodel.CommunicationsManager; import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.autopsy.corecomponents.WrapLayout; +import org.sleuthkit.autopsy.uicomponents.WrapLayout; /** * A panel that goes in the Visualize tab of the Communications Visualization * Tool. Hosts an JGraphX mxGraphComponent that implements the communications @@ -410,9 +408,9 @@ final public class VisualizationPanel extends JPanel { placeHolderPanel.setLayout(placeHolderPanelLayout); placeHolderPanelLayout.setHorizontalGroup(placeHolderPanelLayout.createParallelGroup(GroupLayout.LEADING) .add(placeHolderPanelLayout.createSequentialGroup() - .addContainerGap(315, Short.MAX_VALUE) + .addContainerGap(316, Short.MAX_VALUE) .add(jTextArea1, GroupLayout.PREFERRED_SIZE, 424, GroupLayout.PREFERRED_SIZE) - .addContainerGap(482, Short.MAX_VALUE)) + .addContainerGap(481, Short.MAX_VALUE)) ); placeHolderPanelLayout.setVerticalGroup(placeHolderPanelLayout.createParallelGroup(GroupLayout.LEADING) .add(placeHolderPanelLayout.createSequentialGroup() diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/arrow-180.png b/Core/src/org/sleuthkit/autopsy/communications/images/arrow-180.png new file mode 100755 index 0000000000000000000000000000000000000000..4d2aa3ccb2d59ecf6cc1db2006bc330a7b32423c GIT binary patch literal 1022 zcmVRjB2*F4(xR45i}(ZdXOyZf!3Qo}2)YslD~eKZV@Gh)g_|}sRsu<1 zNhZl;9-eb2GfkSwyTyeUPVOCY=brC;=W)+)mSw@e96bEvA<|Fp{b>+Haa{xfcxNt% zv*vgncodvvd{sgQN2)1Uj>WwHK<0lwIBo-IV#toZjaoi%X^%u_zn=qqF58qzr@_$m z#)7aOV*>y!n{7yWy#Scycdj0gVlfS}S-Wl+Mkxd2Z!bn# z1;CUKT{|Q#F6L1Ay3Y-RcNLP=W`%fY1puRc`1%oPVIfE3`{rM-!o0>R!~O7N|ulGpOEI~RZvxLzZ!-GgIA79j`768`Wgyr z%UwGxInS@&&3ZB*qd(=*fs@kQT)Lui8u56JNuz^+w6}|Hwul>*-@SFZV7U%kHHd+Y z0GRT7Lub(E^(oi!fLx9;Ba3xGW6vxo@pO*kuuh0f{C>YH^h_67835BX$X!60R82W4 zNMof-rBY0}SM-x|`%II8qCNCp9!oRbs6L+$!35kCwl5saO2J9iWyACYRG(2Kb^~Hi(H&N>5MFwgO*RT3v<6;vZN_ra&X=c%g>y zpmV%E0|%sr&G@d4=jq5y9y7=*2pI^XX6*5lJUV<%n*I@m3|)Ji0LWj-*5Gy@v;{=4 z3Q^^zpyP^yJ9s8M2-L{Xn&%K4R{?-cSD5_wXmU#K>pv@f|CR8hI1~!Nw~va_Y$hN$ zrD7$t3QW9t@manwcwU-`B+K@+@qShbu{Apdg}~d~rj%mBG{f(oe^3s0cR<<~C>7Dq z0*V@sR_+46Mko^#;jd5MDhGFmKt;ulqy;}qC6YX4MU%H-Jv|`af$1NAngEJbH0UMhP#e4t@P%kp+dR4f@RP>ps(jdaC~iTQ`ml_N>GG~EjfJ;7+cU4yC5jwV&mbeA13r&5bEp%5o`Zu18|t2 sS*o^a4eyT~U0u}+(trPT{8xYh0B3Hci}D$em;e9(07*qoM6N<$g7{g=ssI20 literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/arrow.png b/Core/src/org/sleuthkit/autopsy/communications/images/arrow.png new file mode 100755 index 0000000000000000000000000000000000000000..12077d33242acb0933fb8a1eb1e9b283173bf3b6 GIT binary patch literal 1062 zcmV+>1ljwEP)d$S)&?kl^eV&NR`W^b9D_uDuB_hydyz7PMhDe#Y*Mqj)7EBzD;EG&31)W6H*DIij(Awk%dwK@v83a%?qRH*h@7lsGA5=Ww`IzUcc+g<_S zgXalp1Tiz?z|g?nL=a6EB2qu;f`<`^00IaPzJIr2u)llF<9O$~<$1j~ZyJDd*unEa zWwu0ZXB)umjXQ~)rv{*GDdUN#3MvHH-U=``dP_Q26F5%=K+a2r+M5*tbhe=Lk+H;Y zo(h1(wuGnRdaVU3&;0e9f%67}YYKo)Jxln%pix`6mX*#~O6Q3H3iI=84I$?_r3vRU gZU6g!$G-#^01aB=1TgL}r2qf`07*qoM6N<$g5+G`YXATM literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java index 3199dbd7e8..807acc5e07 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java @@ -56,6 +56,7 @@ import static org.sleuthkit.autopsy.corecomponents.Bundle.*; import org.sleuthkit.autopsy.corecomponents.ResultViewerPersistence.SortCriterion; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.uicomponents.WrapLayout; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/WrapLayout.java b/Core/src/org/sleuthkit/autopsy/uicomponents/WrapLayout.java old mode 100644 new mode 100755 similarity index 99% rename from Core/src/org/sleuthkit/autopsy/corecomponents/WrapLayout.java rename to Core/src/org/sleuthkit/autopsy/uicomponents/WrapLayout.java index 152d0e8647..92d4af32db --- a/Core/src/org/sleuthkit/autopsy/corecomponents/WrapLayout.java +++ b/Core/src/org/sleuthkit/autopsy/uicomponents/WrapLayout.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.corecomponents; +package org.sleuthkit.autopsy.uicomponents; import java.awt.Component; import java.awt.Container;