Autopsy  4.9.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ProgressPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.progress;
20 
24 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
25 class ProgressPanel extends javax.swing.JPanel {
26 
27  private static final long serialVersionUID = 1L;
28 
29  ProgressPanel() {
30  initComponents();
31  this.progressBar.setMinimum(0);
32  this.progressBar.setIndeterminate(true);
33  }
34 
35  void setMessage(String message) {
36  this.progressMessage.setText(message);
37  }
38 
39  void setIndeterminate(boolean indeterminate) {
40  this.progressBar.setIndeterminate(indeterminate);
41  }
42 
43  void setMaximum(int max) {
44  this.progressBar.setMaximum(max);
45  }
46 
47  void setCurrent(int current) {
48  this.progressBar.setValue(current);
49  }
50 
56  @SuppressWarnings("unchecked")
57  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
58  private void initComponents() {
59 
60  progressMessage = new javax.swing.JLabel();
61  progressBar = new javax.swing.JProgressBar();
62 
63  org.openide.awt.Mnemonics.setLocalizedText(progressMessage, org.openide.util.NbBundle.getMessage(ProgressPanel.class, "ProgressPanel.progressMessage.text")); // NOI18N
64 
65  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
66  this.setLayout(layout);
67  layout.setHorizontalGroup(
68  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
69  .addGroup(layout.createSequentialGroup()
70  .addGap(22, 22, 22)
71  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
72  .addComponent(progressMessage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
73  .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE))
74  .addContainerGap(23, Short.MAX_VALUE))
75  );
76  layout.setVerticalGroup(
77  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
78  .addGroup(layout.createSequentialGroup()
79  .addGap(24, 24, 24)
80  .addComponent(progressMessage)
81  .addGap(18, 18, 18)
82  .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
83  .addContainerGap(33, Short.MAX_VALUE))
84  );
85  }// </editor-fold>//GEN-END:initComponents
86 
87 
88  // Variables declaration - do not modify//GEN-BEGIN:variables
89  private javax.swing.JProgressBar progressBar;
90  private javax.swing.JLabel progressMessage;
91  // End of variables declaration//GEN-END:variables
92 }

Copyright © 2012-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.