19 package org.sleuthkit.autopsy.report;
21 import org.openide.util.NbBundle;
24 import java.awt.event.MouseEvent;
25 import java.awt.event.MouseListener;
27 import java.io.IOException;
28 import java.util.logging.Level;
53 private void customInit(String reportName, String reportPath) {
58 processingLabel.setText(NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.progress.queuing"));
61 if (reportPath != null) {
66 final String linkPath = reportPath;
67 pathLabel.addMouseListener(
new MouseListener() {
70 public void mouseClicked(MouseEvent e) {
74 public void mousePressed(MouseEvent e) {
78 public void mouseReleased(MouseEvent e) {
79 File file =
new File(linkPath);
81 Desktop.getDesktop().open(file);
82 }
catch (IOException ex) {
83 }
catch (IllegalArgumentException ex) {
86 Desktop.getDesktop().open(file.getParentFile());
87 }
catch (IOException ex1) {
93 public void mouseEntered(MouseEvent e) {
95 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
99 public void mouseExited(MouseEvent e) {
101 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
107 pathLabel.setText(NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.initPathLabel.noFile"));
115 if (path.length() > 100) {
116 path = path.substring(0, 10 + path.substring(10).indexOf(File.separator) + 1) +
"..."
117 + path.substring((path.length() - 70) + path.substring(path.length() - 70).indexOf(File.separator));
138 EventQueue.invokeLater(
new Runnable() {
141 processingLabel.setText(NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.start.progress.text"));
153 EventQueue.invokeLater(
new Runnable() {
167 EventQueue.invokeLater(
new Runnable() {
183 EventQueue.invokeLater(
new Runnable() {
199 EventQueue.invokeLater(
new Runnable() {
218 EventQueue.invokeLater(
new Runnable() {
245 EventQueue.invokeLater(
new Runnable() {
249 switch (reportStatus) {
254 NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.complete.processLbl.text"));
266 NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.complete.processLb2.text"));
276 logger.log(Level.SEVERE,
"Invalid ReportStatus code {0}", reportStatus);
290 @SuppressWarnings(
"unchecked")
300 setMinimumSize(
new java.awt.Dimension(486, 68));
302 reportLabel.setFont(
new java.awt.Font(
"Tahoma", 1, 11));
312 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
313 this.setLayout(layout);
314 layout.setHorizontalGroup(
315 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
316 .addGroup(layout.createSequentialGroup()
318 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
319 .addComponent(
processingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
320 .addGroup(layout.createSequentialGroup()
321 .addComponent(
reportProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
323 .addGroup(layout.createSequentialGroup()
325 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
327 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
328 .addComponent(
pathLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)))
331 layout.setVerticalGroup(
332 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
333 .addGroup(layout.createSequentialGroup()
335 .addComponent(
reportProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
336 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
337 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
343 .addContainerGap(20, Short.MAX_VALUE))
368 processingLabel.setText(NbBundle.getMessage(
this.getClass(),
"ReportProgressPanel.cancel.procLbl.text"));
ReportProgressPanel(String reportName, String reportPath)
static final Logger logger
void complete(ReportStatus reportStatus)
javax.swing.JLabel reportLabel
javax.swing.JLabel separationLabel
javax.swing.JLabel processingLabel
javax.swing.JLabel pathLabel
void customInit(String reportName, String reportPath)
void setProgress(final int value)
void updateStatusLabel(final String status)
void setMaximumProgress(final int max)
String shortenPath(String path)
javax.swing.JProgressBar reportProgressBar
static Logger getLogger(String name)
void setIndeterminate(final boolean indeterminate)