From 5238233779295f6ad1774cb3d3c013362f54630a Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dsmyda" Date: Fri, 3 Jan 2020 16:02:58 -0500 Subject: [PATCH] Updated the Video Player to use icons instead of unicode characters --- .../autopsy/contentviewers/Bundle.properties | 6 +- .../contentviewers/Bundle.properties-MERGED | 6 +- .../contentviewers/MediaPlayerPanel.form | 70 ++++++++++++++---- .../contentviewers/MediaPlayerPanel.java | 57 +++++++++----- .../contentviewers/images/Fast-forward-01.png | Bin 0 -> 415 bytes .../contentviewers/images/Fast-rewind-01.png | Bin 0 -> 436 bytes .../contentviewers/images/Pause-01.png | Bin 0 -> 247 bytes .../contentviewers/images/Play-arrow-01.png | Bin 0 -> 418 bytes 8 files changed, 102 insertions(+), 37 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-forward-01.png create mode 100755 Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-rewind-01.png create mode 100755 Core/src/org/sleuthkit/autopsy/contentviewers/images/Pause-01.png create mode 100755 Core/src/org/sleuthkit/autopsy/contentviewers/images/Play-arrow-01.png diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties index b3a384ce48..cf07682e5d 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties @@ -87,9 +87,9 @@ HtmlPanel.showImagesToggleButton.text=Download Images MediaViewImagePanel.tagsMenu.text_1=Tags Menu MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00 MediaPlayerPanel.audioSlider.toolTipText= -MediaPlayerPanel.rewindButton.text=\u2bc7\u2bc7 -MediaPlayerPanel.fastForwardButton.text=\u2bc8\u2bc8 -MediaPlayerPanel.playButton.text=\u25ba +MediaPlayerPanel.rewindButton.text= +MediaPlayerPanel.fastForwardButton.text= +MediaPlayerPanel.playButton.text= MediaPlayerPanel.infoLabel.text=No Errors MediaPlayerPanel.VolumeIcon.text=Volume MediaPlayerPanel.playBackSpeedLabel.text=Speed: diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED index 2d9df0ae33..13f3ef0710 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED @@ -158,9 +158,9 @@ HtmlPanel.showImagesToggleButton.text=Download Images MediaViewImagePanel.tagsMenu.text_1=Tags Menu MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00 MediaPlayerPanel.audioSlider.toolTipText= -MediaPlayerPanel.rewindButton.text=\u2bc7\u2bc7 -MediaPlayerPanel.fastForwardButton.text=\u2bc8\u2bc8 -MediaPlayerPanel.playButton.text=\u25ba +MediaPlayerPanel.rewindButton.text= +MediaPlayerPanel.fastForwardButton.text= +MediaPlayerPanel.playButton.text= MediaPlayerPanel.infoLabel.text=No Errors MediaPlayerPanel.VolumeIcon.text=Volume MediaPlayerPanel.playBackSpeedLabel.text=Speed: diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.form b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.form index d8433a907b..3cf845e2d0 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.form @@ -41,7 +41,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -123,9 +123,21 @@ + + + + + + + + + + + + @@ -138,6 +150,9 @@ + + + @@ -153,6 +168,9 @@ + + + @@ -172,6 +190,15 @@ + + + + + + + + + @@ -188,12 +215,16 @@ + + + - + - + + @@ -223,7 +254,7 @@ - + @@ -233,12 +264,15 @@ - - - - + + + + + + + - + @@ -260,14 +294,15 @@ - + - + - + + @@ -281,6 +316,15 @@ + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.java index 9ed6727388..e1d4646a2f 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaPlayerPanel.java @@ -61,6 +61,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskData; import javafx.embed.swing.JFXPanel; +import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JSlider; import javax.swing.SwingUtilities; @@ -201,6 +202,9 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie private static final int PROGRESS_SLIDER_SIZE = 2000; private static final int SKIP_IN_SECONDS = 30; + private final ImageIcon playIcon = new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/contentviewers/images/Play-arrow-01.png")); + private final ImageIcon pauseIcon = new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/contentviewers/images/Pause-01.png")); + private ExtractMedia extractMediaWorker; //Serialize setting the value of the Video progress slider. @@ -217,12 +221,12 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie //True for fairness. In other words, //acquire() calls are processed in order of invocation. sliderLock = new Semaphore(1, true); - + /** * See JIRA-5888 for details. Initializing gstreamer here is more stable * on Windows. */ - if(PlatformUtil.isWindowsOS()) { + if (PlatformUtil.isWindowsOS()) { Gst.init(); } } @@ -280,11 +284,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie public void stateChanged(GstObject go, State oldState, State currentState, State pendingState) { if (State.PLAYING.equals(currentState)) { SwingUtilities.invokeLater(() -> { - playButton.setText("||"); + playButton.setIcon(pauseIcon); }); } else { SwingUtilities.invokeLater(() -> { - playButton.setText("►"); + playButton.setIcon(playIcon); }); } } @@ -514,7 +518,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie // Initialize Gstreamer. It is safe to call this for every file. // It was moved here from the constructor because having it happen // earlier resulted in conflicts on Linux. See JIRA-5888. - if(!PlatformUtil.isWindowsOS()) { + if (!PlatformUtil.isWindowsOS()) { Gst.init(); } @@ -821,7 +825,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie ); videoPanelLayout.setVerticalGroup( videoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 131, Short.MAX_VALUE) + .addGap(0, 117, Short.MAX_VALUE) ); progressSlider.setValue(0); @@ -835,7 +839,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie buttonPanel.setLayout(new java.awt.GridBagLayout()); + playButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/contentviewers/images/Play-arrow-01.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(playButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.playButton.text")); // NOI18N + playButton.setMaximumSize(new java.awt.Dimension(53, 29)); + playButton.setMinimumSize(new java.awt.Dimension(53, 29)); + playButton.setPreferredSize(new java.awt.Dimension(49, 29)); playButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { playButtonActionPerformed(evt); @@ -849,6 +857,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 0); buttonPanel.add(playButton, gridBagConstraints); + fastForwardButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/contentviewers/images/Fast-forward-01.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(fastForwardButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.fastForwardButton.text")); // NOI18N fastForwardButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -862,6 +871,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 0); buttonPanel.add(fastForwardButton, gridBagConstraints); + rewindButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/contentviewers/images/Fast-rewind-01.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(rewindButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.rewindButton.text")); // NOI18N rewindButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -877,6 +887,9 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie org.openide.awt.Mnemonics.setLocalizedText(VolumeIcon, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.VolumeIcon.text")); // NOI18N VolumeIcon.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); + VolumeIcon.setMaximumSize(new java.awt.Dimension(34, 29)); + VolumeIcon.setMinimumSize(new java.awt.Dimension(34, 29)); + VolumeIcon.setPreferredSize(new java.awt.Dimension(34, 19)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; @@ -891,8 +904,10 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie audioSlider.setMinorTickSpacing(5); audioSlider.setToolTipText(org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.audioSlider.toolTipText")); // NOI18N audioSlider.setValue(25); - audioSlider.setMinimumSize(new java.awt.Dimension(200, 21)); - audioSlider.setPreferredSize(new java.awt.Dimension(200, 21)); + audioSlider.setMaximumSize(new java.awt.Dimension(32767, 19)); + audioSlider.setMinimumSize(new java.awt.Dimension(200, 19)); + audioSlider.setPreferredSize(new java.awt.Dimension(200, 30)); + audioSlider.setRequestFocusEnabled(false); audioSlider.setUI(new CircularJSliderUI(audioSlider, new CircularJSliderConfiguration(new Dimension(15,15)))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; @@ -909,9 +924,10 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie playBackSpeedComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "0.25x", "0.50x", "0.75x", "1x", "1.25x", "1.50x", "1.75x", "2x" })); playBackSpeedComboBox.setSelectedIndex(3); - playBackSpeedComboBox.setMaximumSize(new java.awt.Dimension(53, 23)); - playBackSpeedComboBox.setMinimumSize(new java.awt.Dimension(53, 23)); - playBackSpeedComboBox.setPreferredSize(new java.awt.Dimension(53, 23)); + playBackSpeedComboBox.setMaximumSize(new java.awt.Dimension(53, 29)); + playBackSpeedComboBox.setMinimumSize(new java.awt.Dimension(53, 29)); + playBackSpeedComboBox.setPreferredSize(new java.awt.Dimension(53, 29)); + playBackSpeedComboBox.setRequestFocusEnabled(false); playBackSpeedComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { playBackSpeedComboBoxActionPerformed(evt); @@ -919,13 +935,16 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie }); org.openide.awt.Mnemonics.setLocalizedText(playBackSpeedLabel, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.playBackSpeedLabel.text")); // NOI18N + playBackSpeedLabel.setMaximumSize(new java.awt.Dimension(34, 19)); + playBackSpeedLabel.setMinimumSize(new java.awt.Dimension(34, 19)); + playBackSpeedLabel.setPreferredSize(new java.awt.Dimension(34, 19)); javax.swing.GroupLayout playBackPanelLayout = new javax.swing.GroupLayout(playBackPanel); playBackPanel.setLayout(playBackPanelLayout); playBackPanelLayout.setHorizontalGroup( playBackPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(playBackPanelLayout.createSequentialGroup() - .addComponent(playBackSpeedLabel) + .addComponent(playBackSpeedLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(playBackSpeedComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(13, 13, 13)) @@ -933,11 +952,13 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie playBackPanelLayout.setVerticalGroup( playBackPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(playBackPanelLayout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(playBackPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(playBackSpeedComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(playBackSpeedLabel)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(7, 7, 7) + .addGroup(playBackPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(playBackPanelLayout.createSequentialGroup() + .addGap(2, 2, 2) + .addComponent(playBackSpeedLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(playBackSpeedComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(10, 10, 10)) ); javax.swing.GroupLayout controlPanelLayout = new javax.swing.GroupLayout(controlPanel); @@ -969,7 +990,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie .addGap(5, 5, 5) .addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(playBackPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) + .addComponent(playBackPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(14, 14, 14) .addComponent(infoLabel)) ); diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-forward-01.png b/Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-forward-01.png new file mode 100755 index 0000000000000000000000000000000000000000..8261b2962a1457c501d6ad1487734fb77d9fac52 GIT binary patch literal 415 zcmV;Q0bu@#P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0W?WOK~y+TV;BWP z5SW>nDMFbTz|_=K!ok6T1IonmY$v-H&h4?{{8!B{Q2|e(}sqI z`cNU90L4%!NM&JRIR|u^DU^>4beNc!P69112C}i~1p}-SjEszGK$jf_YOViHS)tgbM-07K#&-Yz|9=PNBLk3F*qJkD)MP@t=B0b|)3sG()`>eYXt!Z7d?h)aNSZYNKkd;$?d z1=tLo4Gcr0(?9^_BZDizRACM@uouYw2N5CwsFkBe!H@t93;-tXU~@8+Yajps002ov JPDHLkV1i04rCk63 literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-rewind-01.png b/Core/src/org/sleuthkit/autopsy/contentviewers/images/Fast-rewind-01.png new file mode 100755 index 0000000000000000000000000000000000000000..a941bae845240a89083d1fe983cdf2f02814138a GIT binary patch literal 436 zcmV;l0ZaagP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0ZB7VrUVm?2q6*jCQ|~e+|e}c8S#)AfwZaTd248Rk9dh%qLLE? z!2<4`VC6$qRX4b9&}xbaK~WShh`Y=PzV|N6vPZ--)FPD<8cl86-p6o@>QONTR@KA9 zo)8Djbkk^>B*`6y1Js0yDeAhOU=Ozuhs<=-di^v_Lrm@?J}@JQ<9Mv=`VQhL>XS+d z(u0bk=pD`X5RXwGRC2;FEOGA~U&R2cf8)A=v?-^;N e)SN$oqI?13KVWm5qS%Q50000k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0h7I;J!GcfQS24TkI`72U@f<2xtjv*HQ$r45lf?myyK)}Gw-EBLCn{9vH zU#q&8mzIVH=rzxqH%~%ZdbTQ1xc=WC%Zi7GTKNO?n1!dXF{`PmJ^laxf4;*p2XCH* zml7BrEndy|ve~Pdv1{QKrp0YR@;y>swFX%lUm4%>{{8;`eyp3@F@_W#9qseZOAj&} laSvy{#6DFnsG*UOp-IF+X;Z+_0HC`VJYD@<);T3K0RX$}QWyXL literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/images/Play-arrow-01.png b/Core/src/org/sleuthkit/autopsy/contentviewers/images/Play-arrow-01.png new file mode 100755 index 0000000000000000000000000000000000000000..624c1841d802baef8f7699b524991b0c5f59de56 GIT binary patch literal 418 zcmV;T0bTxyP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0XIoRK~y+TV;H)? z(9lp6$|M^wL1{Q(WMu3$F)^8GU|=8s6(Sj67|O)N#Q6XJ|1@T1=4(L1gQ3DC0SrTt zfF#iHHO9uq8_dnkWuRh20eptSfd8LAf36xC8D#_6#Hc4u5fJbJ!+HwP;KQb-rrJ<3 zoPbzE!2oEm)xUrL&H;m@Nkv749V(0gNHP=(*nqf}pP&B%(B-xeAyhz)p)jBUboqXu ztKFb{IH1JP8^EA&I(zo)E+`)k$T9R65I2AP_|f3}`SXV$La2ZwLxJh`7%+1f0bN&j z=gysC;!CVmJXYhHhkGVbKN}I2FkL2NA*#@EQ6X7`vfB zuLhhvdGZNVj3|I%C@@C<0}Y$?_wQe=GiT1MfeKRws8OB{6~Mp%02sYm)M!^>Y5)KL M07*qoM6N<$f<1|;Y5)KL literal 0 HcmV?d00001