mirror of
https://github.com/elisspace/autopsy.git
synced 2026-09-06 02:24:30 +00:00
Changed how progress bar works.
This commit is contained in:
@@ -104,7 +104,7 @@ public final class ReportAction extends CallableSystemAction implements Presente
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ReportPanel.this.actionPerformed(e);
|
||||
ReportAction.this.actionPerformed(e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ReportHTML implements ReportModule{
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateReport(ReportConfiguration reportconfig, ReportFilter rr) throws ReportModuleException {
|
||||
public String generateReport(ReportConfiguration reportconfig) throws ReportModuleException {
|
||||
config = reportconfig;
|
||||
ReportGen reportobj = new ReportGen();
|
||||
reportobj.populateReport(reportconfig);
|
||||
@@ -239,7 +239,6 @@ public class ReportHTML implements ReportModule{
|
||||
if (ReportFilter.cancel == true) {
|
||||
break;
|
||||
}
|
||||
int cc = 0;
|
||||
|
||||
if (alt > 0) {
|
||||
altRow = " class=\"alt\"";
|
||||
@@ -286,7 +285,7 @@ public class ReportHTML implements ReportModule{
|
||||
}
|
||||
value = ReportUtils.insertPeriodically(value, "<br>", 30);
|
||||
attributes.put(type, value);
|
||||
cc++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -370,8 +369,6 @@ public class ReportHTML implements ReportModule{
|
||||
artifact.append("</tr>");
|
||||
nodeDevice.append(artifact);
|
||||
}
|
||||
cc++;
|
||||
rr.progBarSet(cc);
|
||||
}
|
||||
//Add them back in order
|
||||
//formatted_Report.append(nodeGen);
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ReportModule {
|
||||
* @return absolute file path to the report generated
|
||||
* @throws ReportModuleException if report generation failed
|
||||
*/
|
||||
public String generateReport(ReportConfiguration config, ReportFilter rr) throws ReportModuleException;
|
||||
public String generateReport(ReportConfiguration config) throws ReportModuleException;
|
||||
|
||||
/**
|
||||
* This saves a copy of the report (current one) to another place specified
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ReportPanelAction {
|
||||
|
||||
private static final String ACTION_NAME = "Report Preview";
|
||||
private StringBuilder viewReport = new StringBuilder();
|
||||
|
||||
private int cc = 0;
|
||||
public ReportPanelAction() {
|
||||
}
|
||||
|
||||
@@ -62,12 +62,11 @@ public class ReportPanelAction {
|
||||
rr.progBarStartText();
|
||||
}
|
||||
});
|
||||
report.populateReport(reportconfig);
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
rr.progBarCount(2 * report.Results.size());
|
||||
rr.progBarCount(classList.size());
|
||||
}
|
||||
});
|
||||
//Turn our results into the appropriate xml/html reports
|
||||
@@ -78,13 +77,13 @@ public class ReportPanelAction {
|
||||
public void run() {
|
||||
|
||||
for (String s : classList) {
|
||||
|
||||
cc++;
|
||||
try {
|
||||
Class reportclass = Class.forName(s);
|
||||
Object reportObject = reportclass.newInstance();
|
||||
Class[] argTypes = new Class[] { ReportConfiguration.class, ReportFilter.class};
|
||||
Class[] argTypes = new Class[] { ReportConfiguration.class};
|
||||
Method generatereport = reportclass.getDeclaredMethod("generateReport",argTypes);
|
||||
Object invoke = generatereport.invoke(reportObject,reportconfig,rr);
|
||||
Object invoke = generatereport.invoke(reportObject,reportconfig);
|
||||
String path = invoke.toString();
|
||||
Class[] argTypes2 = new Class[] { String.class};
|
||||
Method getpreview = reportclass.getMethod("getPreview",argTypes2);
|
||||
@@ -94,10 +93,11 @@ public class ReportPanelAction {
|
||||
{
|
||||
getpreview.invoke(reportObject,path);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
rr.progBarSet(cc);
|
||||
}
|
||||
|
||||
// StopWatch a = new StopWatch();
|
||||
@@ -151,7 +151,7 @@ public class ReportPanelAction {
|
||||
// initialize panel with loaded settings
|
||||
|
||||
//Set the temporary label to let the user know its done and is waiting on the report
|
||||
rr.progBarText();
|
||||
|
||||
final ReportPanel panel = new ReportPanel();
|
||||
|
||||
|
||||
@@ -173,7 +173,8 @@ public class ReportPanelAction {
|
||||
double h = popUpWindow.getSize().getHeight();
|
||||
popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
|
||||
|
||||
reportThread.join();
|
||||
reportThread.join();
|
||||
rr.progBarText();
|
||||
rr.progBarDone();
|
||||
panel.setFinishedReportText();
|
||||
popUpWindow.setVisible(true);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ReportXLS implements ReportModule {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateReport(ReportConfiguration reportconfig, ReportFilter rr) throws ReportModuleException {
|
||||
public String generateReport(ReportConfiguration reportconfig) throws ReportModuleException {
|
||||
config = reportconfig;
|
||||
ReportGen reportobj = new ReportGen();
|
||||
reportobj.populateReport(reportconfig);
|
||||
@@ -386,10 +386,6 @@ public class ReportXLS implements ReportModule {
|
||||
temp.createCell(1).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_ID.getTypeID()));
|
||||
temp.createCell(2).setCellValue(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()));
|
||||
}
|
||||
|
||||
|
||||
cc++;
|
||||
rr.progBarSet(cc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ReportXML implements ReportModule {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateReport(ReportConfiguration reportconfig, ReportFilter rr) throws ReportModuleException {
|
||||
public String generateReport(ReportConfiguration reportconfig) throws ReportModuleException {
|
||||
ReportGen reportobj = new ReportGen();
|
||||
reportobj.populateReport(reportconfig);
|
||||
HashMap<BlackboardArtifact, ArrayList<BlackboardAttribute>> report = reportobj.Results;
|
||||
@@ -177,8 +177,7 @@ public class ReportXML implements ReportModule {
|
||||
if (entry.getKey().getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID()) {
|
||||
nodeDevice.addContent(artifact);
|
||||
}
|
||||
cc++;
|
||||
rr.progBarSet(cc);
|
||||
|
||||
//end of master loop
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user