From 5c72b20f11552107316b79cd4b6fab8720db3442 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 27 May 2016 10:43:42 -0400 Subject: [PATCH 1/7] Added timeline to the toolbar. --- .../sleuthkit/autopsy/casemodule/Case.java | 5 +- Core/src/org/sleuthkit/autopsy/core/layer.xml | 4 +- .../autopsy/timeline/OpenTimelineAction.java | 48 +++++++++++++++++- .../timeline/images/btn_icon_timeline.png | Bin 0 -> 1390 bytes .../images/btn_icon_image_gallery.png | Bin 0 -> 2169 bytes .../OpenAction.java | 0 6 files changed, 51 insertions(+), 6 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline.png create mode 100755 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery.png rename ImageGallery/src/org/sleuthkit/autopsy/imagegallery/{actions => publicactions}/OpenAction.java (100%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 7677b5be68..3c0e223064 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -46,7 +46,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; -import org.apache.commons.io.FileUtils; import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.util.actions.CallableSystemAction; @@ -76,6 +75,7 @@ import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; import org.sleuthkit.autopsy.ingest.IngestJob; import org.sleuthkit.autopsy.ingest.IngestManager; +import org.sleuthkit.autopsy.timeline.OpenTimelineAction; import org.sleuthkit.datamodel.BlackboardArtifactTag; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentTag; @@ -1523,7 +1523,7 @@ public class Case implements SleuthkitCase.ErrorObserver { CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu - + CallableSystemAction.get(OpenTimelineAction.class).setEnabled(true); if (toChangeTo.hasData()) { // open all top components SwingUtilities.invokeLater(() -> { @@ -1560,6 +1560,7 @@ public class Case implements SleuthkitCase.ErrorObserver { CallableSystemAction.get(CaseCloseAction.class).setEnabled(false); // Case Close menu CallableSystemAction.get(CasePropertiesAction.class).setEnabled(false); // Case Properties menu CallableSystemAction.get(CaseDeleteAction.class).setEnabled(false); // Delete Case menu + CallableSystemAction.get(OpenTimelineAction.class).setEnabled(false); }); } diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index b2852f6069..b6a7828a57 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -387,11 +387,11 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index b766394926..7c16b9da8e 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -18,8 +18,13 @@ */ package org.sleuthkit.autopsy.timeline; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.io.IOException; import java.util.logging.Level; +import javax.swing.ImageIcon; +import javax.swing.JButton; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; @@ -27,6 +32,7 @@ import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; +import org.openide.util.actions.Presenter; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.Installer; import org.sleuthkit.autopsy.coreutils.Logger; @@ -36,8 +42,9 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined; @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.timeline.Timeline") @ActionRegistration(displayName = "#CTL_MakeTimeline", lazy = false) @ActionReferences(value = { - @ActionReference(path = "Menu/Tools", position = 100)}) -public class OpenTimelineAction extends CallableSystemAction { + @ActionReference(path = "Menu/Tools", position = 100), + @ActionReference(path = "Toolbars/Case", position = 102)}) +public class OpenTimelineAction extends CallableSystemAction implements Presenter.Toolbar { private static final Logger LOGGER = Logger.getLogger(OpenTimelineAction.class.getName()); @@ -45,10 +52,22 @@ public class OpenTimelineAction extends CallableSystemAction { private static TimeLineController timeLineController = null; + private JButton toolbarButton = new JButton(); + synchronized static void invalidateController() { timeLineController = null; } + public OpenTimelineAction() { + toolbarButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + performAction(); + } + }); + this.setEnabled(false); + } + @Override public boolean isEnabled() { /** @@ -102,4 +121,29 @@ public class OpenTimelineAction extends CallableSystemAction { public boolean asynchronous() { return false; // run on edt } + + /** + * Set this action to be enabled/disabled + * + * @param value whether to enable this action or not + */ + @Override + public void setEnabled(boolean value) { + super.setEnabled(value); + toolbarButton.setEnabled(value); + } + + /** + * Returns the toolbar component of this action + * + * @return component the toolbar button + */ + @Override + public Component getToolbarPresenter() { + ImageIcon icon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\timeline\\images\\btn_icon_timeline.png"); //NON-NLS + toolbarButton.setIcon(icon); + toolbarButton.setText(this.getName()); + + return toolbarButton; + } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline.png new file mode 100755 index 0000000000000000000000000000000000000000..f44034ff012b20ef0e2db418541e0f699ac803ab GIT binary patch literal 1390 zcmZ{kdo&by6vuz8!5D*3UWvv$SZ11;ERC5wM`qGkkIC^!FFVMHSJG7i0Kn-q zs=JiB-&0XuT7@T1iKUPWwPV-;(3k_;3xG&_!$6ul1Aurm0K8NHcBB$-1%Mbl0Pp+( zuqpvSD@xGeMv)HWSYbZ5dfIR_mlx;0&S_Nz@;-B73Lv&P+7#~ zjlWUSrG9j(9g{X#SmejP5v)0wG`{^s!BzN|B3Z(&Nlk2Vq#@g9d~Vb`Z~gzt zBd9(N_m9(NjZpNbXA{CoHpDp+1+K_PBeP(hELvyatUVzyyb0_f<d8jv?zUZLEc8cTD$xp^!3e78X} z`3S@)uUvOtj=3wJwicp-0O{FH;ry!`7$vmK%|qrj9F&N#L+W!IUInjbUKY-+!y&{gV8dzAcTz)=*+zkVS0aaQQh?j()tL=y4Y_mJ(zjpddA}Tu_b3)-K`H z0d}>pZdk>C%$4!*&sQe|Z|>~#ft8pZ8zE0F+ZYmw$-8d)j=sKJ6NsXv&qv6~FDKZ0 zJ7%ppzg&;c_{ydGK9AYxj9cu_aosHUJ>ECf=sBR~BUicT-o>A2;YS6gp735Jk9W0p zvs!-Do$!c63UH|{Mq4)h$wl2UU1NIV9s&CubMyzBA_cSS(!)L3%zfFXs46k$c)_Qe zCsJTEVM?x!jW^Ozjg7jk$S_)}ko*-{Pu%8A)ZeG2lh_^HTzKcJo&}C*3VtB5yVnMD zq>)JaZGw2$Ix&l-HP)rCos~BkOD^48)T$=gCiwhbtzp7O^)nAfAd;LlCUvyF88|_= zRAm#VioC-z4q;x7ud-U6JsDM%h~(572%a@mWHXcchynM%e)?vRAKwC3(YB62zWsR- zpsW$7Xtxl*WlozMdI9Vyq&e3)PwW+JNq-ND>*&P|3g8A?1zrf20ub>83oQO8EYXsQ uCt2Z%R!7aTcylW}zWYps@qY{vkwKi0xc@hZW&S9T8UWqVg<5a#&;J)70Z&B$ literal 0 HcmV?d00001 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..eea6d5083537a19c24f1191a1021791992666e83 GIT binary patch literal 2169 zcmZ{lXEYlO7sq3dM^NKMP_)#j6|158Sh06#k=lfkmxjD+}1^~eOXMde|vCw--A2XOW01$Bn0EkTh0FLQW>@ollt_lFGdIA7CF984{ zR9=(4E`7l2ZD|UnlO9J#%@63{K$*Fq>DxyCB!i(`E`~0$g_&C$vrV&zazNw<@H@kF z<&HVjz|pLeoYk8mHY%9d7P)rI$?5(c^375S)~wd|dzSB)EQF{S8=qORu|BVA_ocKF zRd$t@WRA~Lo+lEJ+7`=NqL4Wh7w1G__T_4yOBA!LH3fCwxG`~K!fnFMZ6sX6rOU^V z%Y8Avj+8R>EOL{yBzCALb#^fQbD`Ju1L|RhtnIN%>)|XmJHGioUd&oLf=hWIp&@QuyI6z0oWQAmZEAU;^J030hX;cz zIUvV<&8*FvH`7}UAUY(E!_*+=uptAjxwH$)Me zlc8Z_ITH=0jSI^g|4C4NuX*$|SNaKySZq_o-fC+=(f2&P@xWBxZrcT4=NA$|z{Al< zH{6|>qXK>t5mSjiXSbl5D9v7CQsp znx>{?uwRjwasOJblEQvH*UjvaM4%;`xL3Vd`IWL^bm17zd$3e2)5TR0rhFv%%C6?n z*c!XZP2l#9nK5W0i|?jBhb7nf4}9A?;L$;@6+Bqa`}{gkDF*w#Z*UIy_!OMsYoW`B zqdc~0?B5$`3X23cH)m}=O{6;1-zyFfX|tOznHpw~vt!`XudJv*t$dSl$1Y@c1mqYK z$YKUPa>%(BnaP;nH_lEv*XCWGC@MYV0KZ962lfO4gA8jBj6E0uc{^y9?0Wb;NJNF} zcr{b_90i!bdxoqgH~cM(>o}9kB&BqRTivbJpRUf>d&)N-&RLa|SjcztaOc?z>@wyd z&8^ep{F|46Kjfo!B2AH4E-BBR4uG6+ZGh@VMYI6_!l z`iQ;>D3-;{_A$1dO>h#mUs`#pqE0q?N+DN6Ah>L`WOY1C5Pk*`JL^+)NP+WE)@5Q`Qi)aG3|!C@mqgUb@{hxQ;8T_$4pm0-rY(4 zVrMEn#*UA50$aaBkIrh*e#8+_`VwMB*sFVa6I9$&`DsMk;N5Y_nOfF*ZB&tr}vCKS$(&Qm0 zz}>l11`)<_NjrlXuW+%7=hb1{_lagWzb+b8$dz;~MQB}|th!=zd`C@#|T(U*#7_Z$Vm&gfc2ui%i+gzG=o+Ak#~3p$2S zP~ZHs1~9++Kq+h~>kZeVes%-lk=Jpu@G$(~Hjj$ait*tkCjUUbi^IjIA3D z(AW6%VuuRy`3aRHkL6?r);C(hg$y@NBB`XCQNuR-mf zdzZ;Ev(Df$Va`$&_&^GOsYJ)Fu6-qq6uy@7$f4Bc5u+qKBSYEu|1Mr%VtmCp96jan z=fuaH&u7cp-q(rLdJ8RtS6Y+^7{+!;l^C(78A6tLsUdoq)I$91Vt?*=%e{@UY61N$ z1b5fN7DojcZ2o~|$v1*gBKK*eR_BwGX0G&N0YdNH0 znJz7!YSQhimd(W)|KZ2RzG;!YMACr~JDAUK91r7eBL;8q8(*LZi!itI;9*O3is~*| zz+GJl$kOaNUmk!X%}m~5VAt=X75nqsNFtHujNG^nLb#aZFI}*E0SlCZE@Iu4OEhS3 zAKV~CxUo$rO6Z({=_h-amdbb&{SC{689RshdW9i$d_oa)0Mt~$T1u*#N@~{}Rkd|A swRAMVN~#( Date: Tue, 7 Jun 2016 13:33:39 -0400 Subject: [PATCH 2/7] Updated as per PR notes. --- .../org/sleuthkit/autopsy/casemodule/Case.java | 17 ++++++++++------- Core/src/org/sleuthkit/autopsy/core/layer.xml | 2 +- .../autopsy/timeline/OpenTimelineAction.java | 2 +- ...con_net_32.png => btn_icon_timeline_32.png} | Bin ....png => btn_icon_timeline_32_colorized.png} | Bin ....png => btn_icon_timeline_colorized_26.png} | Bin .../ImageGalleryOptionsPanelController.java | 2 +- ...llery.png => btn_icon_image_gallery_26.png} | Bin ...uette.png => btn_icon_image_gallery_32.png} | Bin ...uette.png => btn_icon_image_gallery_48.png} | Bin 10 files changed, 13 insertions(+), 10 deletions(-) rename Core/src/org/sleuthkit/autopsy/timeline/images/{20140521121247760_easyicon_net_32.png => btn_icon_timeline_32.png} (100%) rename Core/src/org/sleuthkit/autopsy/timeline/images/{20140521121247760_easyicon_net_32_colorized.png => btn_icon_timeline_32_colorized.png} (100%) rename Core/src/org/sleuthkit/autopsy/timeline/images/{btn_icon_timeline.png => btn_icon_timeline_colorized_26.png} (100%) rename ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/{btn_icon_image_gallery.png => btn_icon_image_gallery_26.png} (100%) rename ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/{polaroid_32_silhouette.png => btn_icon_image_gallery_32.png} (100%) rename ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/{polaroid_48_silhouette.png => btn_icon_image_gallery_48.png} (100%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 3c0e223064..26b53d47f8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -1519,11 +1519,14 @@ public class Case implements SleuthkitCase.ErrorObserver { if (RuntimeProperties.coreComponentsAreActive()) { // enable these menus - CallableSystemAction.get(AddImageAction.class).setEnabled(true); - CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); - CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); - CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu - CallableSystemAction.get(OpenTimelineAction.class).setEnabled(true); + SwingUtilities.invokeLater(() -> { + CallableSystemAction.get(AddImageAction.class).setEnabled(true); + CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); + CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); + CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu + CallableSystemAction.get(OpenTimelineAction.class).setEnabled(true); + }); + if (toChangeTo.hasData()) { // open all top components SwingUtilities.invokeLater(() -> { @@ -1665,7 +1668,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * Deletes reports from the case. * * @param reports Collection of Report to be deleted from the case. - * @param deleteFromDisk No longer supported - ignored. + * @param deleteFromDisk No longer supported - ignored. * * @throws TskCoreException * @deprecated Use deleteReports(Collection reports) @@ -1675,5 +1678,5 @@ public class Case implements SleuthkitCase.ErrorObserver { public void deleteReports(Collection reports, boolean deleteFromDisk) throws TskCoreException { deleteReports(reports); } - + } diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index b6a7828a57..cd72a061f9 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -387,7 +387,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index 7c16b9da8e..8796c4f7ca 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -140,7 +140,7 @@ public class OpenTimelineAction extends CallableSystemAction implements Presente */ @Override public Component getToolbarPresenter() { - ImageIcon icon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\timeline\\images\\btn_icon_timeline.png"); //NON-NLS + ImageIcon icon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\timeline\\images\\btn_icon_timeline_colorized_26.png"); //NON-NLS toolbarButton.setIcon(icon); toolbarButton.setText(this.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32.png diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32_colorized.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32_colorized.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32_colorized.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32_colorized.png diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java index 28d507619e..3d893fa88a 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java @@ -31,7 +31,7 @@ import org.openide.util.Lookup; */ @OptionsPanelController.TopLevelRegistration( categoryName = "#OptionsCategory_Name_Options", - iconBase = "org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png", + iconBase = "org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png", keywords = "#OptionsCategory_Keywords_Options", keywordsCategory = "Options", position = 10 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_26.png similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery.png rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_26.png diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_48_silhouette.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_48.png similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_48_silhouette.png rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_48.png From c50537fff7738cd0b1871fb67f6c52638022750b Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 7 Jun 2016 14:23:15 -0400 Subject: [PATCH 3/7] Updated case to be more efficient when closing/opening case. --- .../sleuthkit/autopsy/casemodule/Case.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 26b53d47f8..cb57dc8e27 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -1525,25 +1525,20 @@ public class Case implements SleuthkitCase.ErrorObserver { CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu CallableSystemAction.get(OpenTimelineAction.class).setEnabled(true); - }); - if (toChangeTo.hasData()) { - // open all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.openCoreWindows(); - }); - } else { - // close all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.closeCoreWindows(); - }); - } - } - - if (RuntimeProperties.coreComponentsAreActive()) { - SwingUtilities.invokeLater(() -> { - updateMainWindowTitle(currentCase.getName()); + if (toChangeTo.hasData()) { + // open all top components + SwingUtilities.invokeLater(() -> { + CoreComponentControl.openCoreWindows(); + }); + } else { + // close all top components + SwingUtilities.invokeLater(() -> { + CoreComponentControl.closeCoreWindows(); + }); + } }); + updateMainWindowTitle(currentCase.getName()); } else { SwingUtilities.invokeLater(() -> { Frame f = WindowManager.getDefault().getMainWindow(); @@ -1570,9 +1565,6 @@ public class Case implements SleuthkitCase.ErrorObserver { //clear pending notifications SwingUtilities.invokeLater(() -> { MessageNotifyUtil.Notify.clear(); - }); - - SwingUtilities.invokeLater(() -> { Frame f = WindowManager.getDefault().getMainWindow(); f.setTitle(Case.getAppName()); // set the window name to just application name }); From c7a29107b4c6607766ebd542095b5f9f9a422bcf Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 7 Jun 2016 14:48:07 -0400 Subject: [PATCH 4/7] Updated case to be more efficient when closing/opening case. --- .../org/sleuthkit/autopsy/casemodule/Case.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index cb57dc8e27..016c842155 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -1528,14 +1528,10 @@ public class Case implements SleuthkitCase.ErrorObserver { if (toChangeTo.hasData()) { // open all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.openCoreWindows(); - }); + CoreComponentControl.openCoreWindows(); } else { // close all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.closeCoreWindows(); - }); + CoreComponentControl.closeCoreWindows(); } }); updateMainWindowTitle(currentCase.getName()); @@ -1547,9 +1543,9 @@ public class Case implements SleuthkitCase.ErrorObserver { } } else { // case is closed - if (RuntimeProperties.coreComponentsAreActive()) { + SwingUtilities.invokeLater(() -> { + if (RuntimeProperties.coreComponentsAreActive()) { - SwingUtilities.invokeLater(() -> { // close all top components first CoreComponentControl.closeCoreWindows(); @@ -1559,11 +1555,9 @@ public class Case implements SleuthkitCase.ErrorObserver { CallableSystemAction.get(CasePropertiesAction.class).setEnabled(false); // Case Properties menu CallableSystemAction.get(CaseDeleteAction.class).setEnabled(false); // Delete Case menu CallableSystemAction.get(OpenTimelineAction.class).setEnabled(false); - }); - } + } - //clear pending notifications - SwingUtilities.invokeLater(() -> { + //clear pending notifications MessageNotifyUtil.Notify.clear(); Frame f = WindowManager.getDefault().getMainWindow(); f.setTitle(Case.getAppName()); // set the window name to just application name From 34a7dddb5dd64dc942b9f461e680a38f26326f17 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 8 Jun 2016 09:13:42 -0400 Subject: [PATCH 5/7] changed image name. --- .../autopsy/timeline/OpenTimelineAction.java | 2 +- ...rized.png => btn_icon_timeline_colorized_32.png} | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename Core/src/org/sleuthkit/autopsy/timeline/images/{btn_icon_timeline_32_colorized.png => btn_icon_timeline_colorized_32.png} (100%) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index 8796c4f7ca..47d7f6940d 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -140,7 +140,7 @@ public class OpenTimelineAction extends CallableSystemAction implements Presente */ @Override public Component getToolbarPresenter() { - ImageIcon icon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\timeline\\images\\btn_icon_timeline_colorized_26.png"); //NON-NLS + ImageIcon icon = new ImageIcon("Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png"); //NON-NLS toolbarButton.setIcon(icon); toolbarButton.setText(this.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32_colorized.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_32.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32_colorized.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_32.png From 03ed3040b081ff23b91c9c28f5b45d6733bd11aa Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 8 Jun 2016 10:00:50 -0400 Subject: [PATCH 6/7] Got rid of publicactions folder. --- .../publicactions/OpenAction.java | 123 ------------------ 1 file changed, 123 deletions(-) delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/publicactions/OpenAction.java diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/publicactions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/publicactions/OpenAction.java deleted file mode 100644 index ea0d04abf8..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/publicactions/OpenAction.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2013 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.imagegallery.actions; - -import java.awt.Component; -import javax.swing.JButton; -import javax.swing.JOptionPane; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; -import org.openide.awt.ActionRegistration; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle.Messages; -import org.openide.util.actions.CallableSystemAction; -import org.openide.windows.WindowManager; -import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.core.Installer; -import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; -import org.sleuthkit.autopsy.imagegallery.ImageGalleryModule; -import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; - -@ActionID(category = "Tools", - id = "org.sleuthkit.autopsy.imagegallery.OpenAction") -@ActionReference(path = "Menu/Tools" /* , position = 333 */) -@ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", - lazy = false, - displayName = "#CTL_OpenAction") -@Messages({"CTL_OpenAction=View Images/Videos", - "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + - "Do you want to update and listen for further ingest results?\n" + - "Choosing 'yes' will update the database and enable listening to future ingests.", - "OpenAction.stale.confDlg.title=Image Gallery"}) -public final class OpenAction extends CallableSystemAction { - - private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); - - private static final boolean fxInited = Installer.isJavaFxInited(); - - private static final Logger LOGGER = Logger.getLogger(OpenAction.class.getName()); - - public OpenAction() { - super(); - } - - @Override - public boolean isEnabled() { - return Case.isCaseOpen() && fxInited && Case.getCurrentCase().hasData(); - } - - /** Returns the toolbar component of this action - * - * @return component the toolbar button */ - @Override - public Component getToolbarPresenter() { - JButton toolbarButton = new JButton(this); - toolbarButton.setText(VIEW_IMAGES_VIDEOS); - toolbarButton.addActionListener(this); - - return toolbarButton; - } - - @Override - @SuppressWarnings("fallthrough") - public void performAction() { - - //check case - if (!Case.existsCurrentCase()) { - return; - } - final Case currentCase = Case.getCurrentCase(); - - if (ImageGalleryModule.isDrawableDBStale(currentCase)) { - //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction_stale_confDlg_msg(), - Bundle.OpenAction_stale_confDlg_title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); - - switch (answer) { - case JOptionPane.YES_OPTION: - ImageGalleryController.getDefault().setListeningEnabled(true); - //fall through - case JOptionPane.NO_OPTION: - ImageGalleryTopComponent.openTopComponent(); - break; - case JOptionPane.CANCEL_OPTION: - break; //do nothing - } - } else { - //drawable db is not stale, just open it - ImageGalleryTopComponent.openTopComponent(); - } - } - - @Override - public String getName() { - return VIEW_IMAGES_VIDEOS; - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - public boolean asynchronous() { - return false; // run on edt - } -} From d0f92f5868ff40ea7fb4f1bd1b2942c7ce60709a Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 8 Jun 2016 10:10:04 -0400 Subject: [PATCH 7/7] Fixed packages. --- .../imagegallery/actions/OpenAction.java | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100755 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java new file mode 100755 index 0000000000..ea0d04abf8 --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -0,0 +1,123 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.imagegallery.actions; + +import java.awt.Component; +import javax.swing.JButton; +import javax.swing.JOptionPane; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle.Messages; +import org.openide.util.actions.CallableSystemAction; +import org.openide.windows.WindowManager; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.core.Installer; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; +import org.sleuthkit.autopsy.imagegallery.ImageGalleryModule; +import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; + +@ActionID(category = "Tools", + id = "org.sleuthkit.autopsy.imagegallery.OpenAction") +@ActionReference(path = "Menu/Tools" /* , position = 333 */) +@ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", + lazy = false, + displayName = "#CTL_OpenAction") +@Messages({"CTL_OpenAction=View Images/Videos", + "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests.", + "OpenAction.stale.confDlg.title=Image Gallery"}) +public final class OpenAction extends CallableSystemAction { + + private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); + + private static final boolean fxInited = Installer.isJavaFxInited(); + + private static final Logger LOGGER = Logger.getLogger(OpenAction.class.getName()); + + public OpenAction() { + super(); + } + + @Override + public boolean isEnabled() { + return Case.isCaseOpen() && fxInited && Case.getCurrentCase().hasData(); + } + + /** Returns the toolbar component of this action + * + * @return component the toolbar button */ + @Override + public Component getToolbarPresenter() { + JButton toolbarButton = new JButton(this); + toolbarButton.setText(VIEW_IMAGES_VIDEOS); + toolbarButton.addActionListener(this); + + return toolbarButton; + } + + @Override + @SuppressWarnings("fallthrough") + public void performAction() { + + //check case + if (!Case.existsCurrentCase()) { + return; + } + final Case currentCase = Case.getCurrentCase(); + + if (ImageGalleryModule.isDrawableDBStale(currentCase)) { + //drawable db is stale, ask what to do + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction_stale_confDlg_msg(), + Bundle.OpenAction_stale_confDlg_title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + + switch (answer) { + case JOptionPane.YES_OPTION: + ImageGalleryController.getDefault().setListeningEnabled(true); + //fall through + case JOptionPane.NO_OPTION: + ImageGalleryTopComponent.openTopComponent(); + break; + case JOptionPane.CANCEL_OPTION: + break; //do nothing + } + } else { + //drawable db is not stale, just open it + ImageGalleryTopComponent.openTopComponent(); + } + } + + @Override + public String getName() { + return VIEW_IMAGES_VIDEOS; + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public boolean asynchronous() { + return false; // run on edt + } +}