mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
progress bar threading tweaks
This commit is contained in:
parent
47eb2cfd7c
commit
589cf178eb
@ -16,9 +16,9 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.sleuthkit.autopsy.timeline;
|
package org.sleuthkit.autopsy.timeline;
|
||||||
|
|
||||||
|
import java.awt.EventQueue;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
@ -74,22 +74,38 @@ public class TimelineProgressDialog extends javax.swing.JDialog {
|
|||||||
return returnStatus;
|
return returnStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateProgressBar(int progress) {
|
void updateProgressBar(final int progress) {
|
||||||
this.progressBar.setValue(progress);
|
EventQueue.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
progressBar.setValue(progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateProgressBar(String message) {
|
void updateProgressBar(final String message) {
|
||||||
this.progressBar.setStringPainted(true);
|
EventQueue.invokeLater(new Runnable() {
|
||||||
this.progressBar.setString(message);
|
@Override
|
||||||
|
public void run() {
|
||||||
|
progressBar.setString(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setProgressTotal(int total) {
|
void setProgressTotal(final int total) {
|
||||||
this.progressBar.setIndeterminate(false);
|
EventQueue.invokeLater(new Runnable() {
|
||||||
this.progressBar.setMaximum(total);
|
@Override
|
||||||
this.progressBar.setValue(0);
|
public void run() {
|
||||||
|
progressBar.setIndeterminate(false);
|
||||||
|
progressBar.setMaximum(total);
|
||||||
|
progressBar.setValue(0);
|
||||||
|
progressBar.setStringPainted(true);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
@ -144,14 +160,11 @@ public class TimelineProgressDialog extends javax.swing.JDialog {
|
|||||||
doClose(RET_CANCEL);
|
doClose(RET_CANCEL);
|
||||||
}//GEN-LAST:event_closeDialog
|
}//GEN-LAST:event_closeDialog
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void doClose(int retStatus) {
|
public void doClose(int retStatus) {
|
||||||
returnStatus = retStatus;
|
returnStatus = retStatus;
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JLabel jLabel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JProgressBar progressBar;
|
private javax.swing.JProgressBar progressBar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user