1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Merge pull request #1163 from sidheshenator/report_generation_panel_fix

Cancel button disabled on report generation completion(with or without e...
This commit is contained in:
Richard Cordovano
2015-04-16 10:02:42 -04:00
9 changed files with 63 additions and 159 deletions

View File

@@ -11,12 +11,9 @@ ReportVisualPanel2.advancedButton.text=Data Types
ArtifactSelectionDialog.deselectAllButton.text=Deselect All
ArtifactSelectionDialog.selectAllButton.text=Select All
ReportGenerationPanel.closeButton.text=Close
ReportGenerationPanel.cancelAllButton.text=Cancel All
ReportProgressPanel.reportLabel.text=reportLabel
ReportProgressPanel.pathLabel.text=pathLabel
ReportProgressPanel.separationLabel.text=-
ReportProgressPanel.cancelButton.toolTipText=Queuing
ReportProgressPanel.cancelButton.text=Cancel
ReportProgressPanel.processingLabel.text=processingLabel
ReportGenerationPanel.titleLabel.text=Report Generation Progress
ReportVisualPanel2.taggedResultsRadioButton.text=Tagged Results
@@ -65,7 +62,7 @@ ReportExcel.cellVal.examiner=Examiner\:
ReportExcel.cellVal.numImages=Number of Images\:
ReportGenerationPanel.confDlg.sureToClose.msg=Are you sure you'd like to close the dialog?\nAll reports will be canceled.
ReportGenerationPanel.confDlg.title.closing=Closing
ReportGenerationPanel.confDlg.cancelReports.msg=Are you sure you'd like to cancel all the reports?
ReportGenerationPanel.confDlg.cancelReport.msg=Are you sure you'd like to cancel the report?
ReportGenerator.displayProgress.title.text=Report Generation Progress...
ReportGenerator.progress.queryingDb.text=Querying database...
ReportGenerator.progress.processingFile.text=Now processing {0}
@@ -251,4 +248,5 @@ ReportGenerator.errList.failedQueryHashsetHits=Failed to query hashsets hits.
ReportGenerator.errList.coreExceptionWhileGenRptRow=Core exception while generating row data for artifact report.
ReportKML.latLongStartPoint={0};{1};;{2} (Start)\n
ReportKML.latLongEndPoint={0};{1};;{2} (End)\n
ReportGenerationPanel.cancelButton.actionCommand=Cancel
ReportGenerationPanel.cancelButton.text=Cancel

View File

@@ -32,8 +32,8 @@
<EmptySpace min="0" pref="522" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="380" max="32767" attributes="0"/>
<Component id="cancelAllButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="546" max="32767" attributes="0"/>
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="closeButton" min="-2" max="-2" attributes="0"/>
</Group>
@@ -56,7 +56,7 @@
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="closeButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cancelAllButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -74,14 +74,17 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="closeButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="cancelAllButton">
<Component class="javax.swing.JButton" name="cancelButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportGenerationPanel.cancelAllButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportGenerationPanel.cancelButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportGenerationPanel.cancelButton.actionCommand" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelAllButtonActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="reportScrollPane">

View File

@@ -20,8 +20,6 @@ package org.sleuthkit.autopsy.report;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Box;
import javax.swing.JOptionPane;
@@ -30,7 +28,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
class ReportGenerationPanel extends javax.swing.JPanel {
private GridBagConstraints c;
private List<ReportProgressPanel> progressPanels;
ReportProgressPanel progressPanel;
private Component glue;
private ActionListener actionListener;
@@ -44,7 +42,6 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
private void customInit() {
reportPanel.setLayout(new GridBagLayout());
progressPanels = new ArrayList<ReportProgressPanel>();
c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.gridx = 0;
@@ -64,12 +61,10 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
// Remove the glue
reportPanel.remove(glue);
// Add the new panel
ReportProgressPanel panel = new ReportProgressPanel(reportName, reportPath);
progressPanels.add(panel);
progressPanel = new ReportProgressPanel(reportName, reportPath);
c.weighty = 0.0;
c.anchor = GridBagConstraints.NORTH;
reportPanel.add(panel, c);
reportPanel.add(progressPanel, c);
c.gridy++;
// Add the glue back to the bottom
@@ -77,9 +72,10 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
c.anchor = GridBagConstraints.PAGE_END;
reportPanel.add(glue, c);
reportPanel.setPreferredSize(new Dimension(600, progressPanels.size() * 80));
// 80 px per progressPanel.
reportPanel.setPreferredSize(new Dimension(600, 1 * 80));
reportPanel.repaint();
return panel;
return progressPanel;
}
/**
@@ -87,10 +83,8 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
*/
void close() {
boolean closeable = true;
for (ReportProgressPanel panel : progressPanels) {
if (panel.getStatus() != ReportStatus.CANCELED && panel.getStatus() != ReportStatus.COMPLETE) {
closeable = false;
}
if (progressPanel.getStatus() != ReportStatus.CANCELED && progressPanel.getStatus() != ReportStatus.COMPLETE && progressPanel.getStatus() != ReportStatus.ERROR) {
closeable = false;
}
if (closeable) {
actionListener.actionPerformed(null);
@@ -102,20 +96,12 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
"ReportGenerationPanel.confDlg.title.closing"),
JOptionPane.YES_NO_OPTION);
if (result == 0) {
cancelAllReports();
progressPanel.cancel();
actionListener.actionPerformed(null);
}
}
}
/**
* Cancel all reports.
*/
private void cancelAllReports() {
for (ReportProgressPanel panel : progressPanels) {
panel.cancel();
}
}
/**
* This method is called from within the constructor to initialize the form.
@@ -127,7 +113,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
private void initComponents() {
closeButton = new javax.swing.JButton();
cancelAllButton = new javax.swing.JButton();
cancelButton = new javax.swing.JButton();
reportScrollPane = new javax.swing.JScrollPane();
reportPanel = new javax.swing.JPanel();
titleLabel = new javax.swing.JLabel();
@@ -143,10 +129,11 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
}
});
org.openide.awt.Mnemonics.setLocalizedText(cancelAllButton, org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.cancelAllButton.text")); // NOI18N
cancelAllButton.addActionListener(new java.awt.event.ActionListener() {
org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.cancelButton.text")); // NOI18N
cancelButton.setActionCommand(org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.cancelButton.actionCommand")); // NOI18N
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelAllButtonActionPerformed(evt);
cancelButtonActionPerformed(evt);
}
});
@@ -168,7 +155,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
reportScrollPane.setViewportView(reportPanel);
titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 11));
titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.titleLabel.text")); // NOI18N
titleSeparator.setForeground(new java.awt.Color(0, 0, 0));
@@ -189,8 +176,8 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
.addComponent(titleLabel)
.addGap(0, 522, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(0, 380, Short.MAX_VALUE)
.addComponent(cancelAllButton)
.addGap(0, 546, Short.MAX_VALUE)
.addComponent(cancelButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(closeButton)))
.addContainerGap())
@@ -209,7 +196,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(closeButton)
.addComponent(cancelAllButton))
.addComponent(cancelButton))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
@@ -218,23 +205,25 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
close();
}//GEN-LAST:event_closeButtonActionPerformed
private void cancelAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelAllButtonActionPerformed
int result = JOptionPane.showConfirmDialog(null, NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.confDlg.cancelReports.msg"),
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
if(progressPanel.getStatus() == ReportStatus.QUEUING || progressPanel.getStatus() == ReportStatus.RUNNING) {
int result = JOptionPane.showConfirmDialog(null, NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.confDlg.cancelReport.msg"),
NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.cancelAllButton.text"),
JOptionPane.YES_NO_OPTION);
"ReportGenerationPanel.cancelButton.text"),
JOptionPane.YES_NO_OPTION);
if (result == 0) {
cancelAllReports();
progressPanel.cancel();
}
}//GEN-LAST:event_cancelAllButtonActionPerformed
}
}//GEN-LAST:event_cancelButtonActionPerformed
void addCloseAction(ActionListener l) {
this.actionListener = l;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelAllButton;
private javax.swing.JButton cancelButton;
private javax.swing.JButton closeButton;
private javax.swing.JSeparator optionSeparator;
private javax.swing.JPanel reportPanel;

View File

@@ -27,8 +27,7 @@
<Component id="processingLabel" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="reportProgressBar" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="58" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="reportLabel" min="-2" max="-2" attributes="0"/>
@@ -46,10 +45,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="cancelButton" max="32767" attributes="0"/>
<Component id="reportProgressBar" max="32767" attributes="0"/>
</Group>
<Component id="reportProgressBar" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="reportLabel" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -66,30 +62,6 @@
<SubComponents>
<Component class="javax.swing.JProgressBar" name="reportProgressBar">
</Component>
<Component class="javax.swing.JButton" name="cancelButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/report/images/report_loading.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportProgressPanel.cancelButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportProgressPanel.cancelButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="focusPainted" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cancelButtonMouseEntered"/>
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cancelButtonMouseExited"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="reportLabel">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">

View File

@@ -138,9 +138,6 @@ public class ReportProgressPanel extends javax.swing.JPanel {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS
cancelButton.setToolTipText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.cancelButton.text"));
processingLabel.setText(NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.progress.text"));
STATUS = ReportStatus.RUNNING;
}
@@ -252,22 +249,26 @@ public class ReportProgressPanel extends javax.swing.JPanel {
switch (reportStatus) {
case COMPLETE: {
STATUS = ReportStatus.COMPLETE;
processingLabel.setForeground(Color.BLACK);
processingLabel.setText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.processLbl.text"));
reportProgressBar.setValue(reportProgressBar.getMaximum());
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete.png"))); //NON-NLS
cancelButton.setToolTipText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.cancelButton.text"));
reportProgressBar.setStringPainted(true);
// set reportProgressBar color as green.
reportProgressBar.setForeground(new Color(50,205,50));
reportProgressBar.setString("Complete"); //NON-NLS
break;
}
case ERROR: {
STATUS = ReportStatus.ERROR;
processingLabel.setForeground(new Color(178,34,34));
processingLabel.setText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.processLb2.text"));
reportProgressBar.setValue(reportProgressBar.getMaximum());
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete_with_errors.png"))); //NON-NLS
cancelButton.setToolTipText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.cancelButton.text"));
reportProgressBar.setStringPainted(true);
// set reportProgressBar color as red.
reportProgressBar.setForeground(new Color(178,34,34));
reportProgressBar.setString("Error"); //NON-NLS
break;
}
// add finer grained result codes here.
@@ -291,7 +292,6 @@ public class ReportProgressPanel extends javax.swing.JPanel {
private void initComponents() {
reportProgressBar = new javax.swing.JProgressBar();
cancelButton = new javax.swing.JButton();
reportLabel = new javax.swing.JLabel();
pathLabel = new javax.swing.JLabel();
processingLabel = new javax.swing.JLabel();
@@ -299,33 +299,12 @@ public class ReportProgressPanel extends javax.swing.JPanel {
setMinimumSize(new java.awt.Dimension(486, 68));
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.text")); // NOI18N
cancelButton.setToolTipText(org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.toolTipText")); // NOI18N
cancelButton.setBorder(null);
cancelButton.setBorderPainted(false);
cancelButton.setContentAreaFilled(false);
cancelButton.setFocusPainted(false);
cancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
cancelButtonMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
cancelButtonMouseExited(evt);
}
});
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButtonActionPerformed(evt);
}
});
reportLabel.setFont(reportLabel.getFont().deriveFont(Font.BOLD, 11));
reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(reportLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.reportLabel.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(pathLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.pathLabel.text")); // NOI18N
processingLabel.setFont(processingLabel.getFont().deriveFont(Font.ITALIC, 10));
processingLabel.setFont(new java.awt.Font("Tahoma", 2, 10)); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(processingLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.processingLabel.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(separationLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.separationLabel.text")); // NOI18N
@@ -340,8 +319,7 @@ public class ReportProgressPanel extends javax.swing.JPanel {
.addComponent(processingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(reportProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGap(58, 58, 58))
.addGroup(layout.createSequentialGroup()
.addComponent(reportLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -354,9 +332,7 @@ public class ReportProgressPanel extends javax.swing.JPanel {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cancelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(reportProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(reportProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(reportLabel)
@@ -368,10 +344,6 @@ public class ReportProgressPanel extends javax.swing.JPanel {
);
}// </editor-fold>//GEN-END:initComponents
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
cancel();
}//GEN-LAST:event_cancelButtonActionPerformed
/**
* Cancels the current report, based on it's status. If the report is
* complete or has already been completed, nothing happens.
@@ -382,53 +354,23 @@ public class ReportProgressPanel extends javax.swing.JPanel {
break;
case CANCELED:
break;
case ERROR:
break;
default:
STATUS = ReportStatus.CANCELED;
cancelButton.setEnabled(false);
cancelButton.setToolTipText(
NbBundle.getMessage(this.getClass(), "ReportProgressPanel.cancel.cancelButton.toolTipText"));
reportProgressBar.setIndeterminate(false);
reportProgressBar.setValue(0);
reportProgressBar.setForeground(Color.RED);
reportProgressBar.setBackground(Color.RED);
processingLabel.setForeground(Color.RED);
reportProgressBar.setStringPainted(true);
// set reportProgressBar color as red.
reportProgressBar.setForeground(new Color(178,34,34));
reportProgressBar.setString("Cancelled"); //NON-NLS
processingLabel.setForeground(new Color(178,34,34));
processingLabel.setText(NbBundle.getMessage(this.getClass(), "ReportProgressPanel.cancel.procLbl.text"));
break;
}
}
private void cancelButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelButtonMouseEntered
switch(STATUS) {
case COMPLETE:
break;
case CANCELED:
break;
default:
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel_hover.png"))); //NON-NLS
break;
}
}//GEN-LAST:event_cancelButtonMouseEntered
private void cancelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelButtonMouseExited
switch(STATUS) {
case COMPLETE:
break;
case CANCELED:
break;
case QUEUING:
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); //NON-NLS
break;
case RUNNING:
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS
break;
}
}//GEN-LAST:event_cancelButtonMouseExited
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelButton;
private javax.swing.JLabel pathLabel;
private javax.swing.JLabel processingLabel;
private javax.swing.JLabel reportLabel;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B