Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
LoadingPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 2020 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.discovery.ui;
20 
21 import javax.swing.JPanel;
22 import org.apache.commons.lang3.StringUtils;
23 import org.openide.util.NbBundle;
24 
28 class LoadingPanel extends JPanel {
29 
30  private static final long serialVersionUID = 1L;
31 
35  LoadingPanel() {
36  this(null);
37  }
38 
39  @NbBundle.Messages({"LoadingPanel.loading.text=Loading, please wait.",
40  "# {0} - resultInfo",
41  "LoadingPanel.retrieving.text=Retrieving results for {0}."})
42 
43  LoadingPanel(String details) {
44  initComponents();
45  loadingLabel.setText(Bundle.LoadingPanel_loading_text());
46  if (!StringUtils.isBlank(details)) {
47  detailsLabel.setText(Bundle.LoadingPanel_retrieving_text(details));
48  }
49  }
50 
56  @SuppressWarnings("unchecked")
57  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
58  private void initComponents() {
59 
60  loadingLabel = new javax.swing.JLabel();
61  detailsLabel = new javax.swing.JLabel();
62 
63  loadingLabel.setFont(loadingLabel.getFont().deriveFont(loadingLabel.getFont().getSize()+4f));
64  loadingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
65  loadingLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
66 
67  detailsLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
68  detailsLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
69  detailsLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
70  detailsLabel.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
71 
72  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
73  this.setLayout(layout);
74  layout.setHorizontalGroup(
75  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
76  .addComponent(loadingLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
77  .addComponent(detailsLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE)
78  );
79  layout.setVerticalGroup(
80  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
81  .addGroup(layout.createSequentialGroup()
82  .addComponent(loadingLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
83  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
84  .addComponent(detailsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
85  .addContainerGap(30, Short.MAX_VALUE))
86  );
87 
88  detailsLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LoadingPanel.class, "LoadingPanel.detailsLabel.AccessibleContext.accessibleName")); // NOI18N
89  }// </editor-fold>//GEN-END:initComponents
90 
91 
92  // Variables declaration - do not modify//GEN-BEGIN:variables
93  private javax.swing.JLabel detailsLabel;
94  private javax.swing.JLabel loadingLabel;
95  // End of variables declaration//GEN-END:variables
96 
97 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.