View Javadoc
1   package edu.jiangxin.apktoolbox.file.checksum;
2   
3   import edu.jiangxin.apktoolbox.file.checksum.panel.*;
4   import edu.jiangxin.apktoolbox.swing.extend.EasyChildTabbedPanel;
5   import edu.jiangxin.apktoolbox.swing.extend.EasyPanel;
6   
7   import javax.swing.*;
8   
9   public class ChecksumPanel extends EasyPanel {
10      private static final long serialVersionUID = 63924900336217723L;
11  
12      @Override
13      public void initUI() {
14          BoxLayout boxLayout = new BoxLayout(this, BoxLayout.Y_AXIS);
15          setLayout(boxLayout);
16  
17          JTabbedPane tabbedPane = new JTabbedPane();
18  
19          EasyChildTabbedPanel fileChecksumPanel = new FileChecksumPanel();
20          tabbedPane.addTab("File Checksum", null, fileChecksumPanel, "File Checksum");
21  
22          EasyChildTabbedPanel verifyChecksumPanel = new VerifyChecksumPanel();
23          tabbedPane.addTab("Verify Checksum", null, verifyChecksumPanel, "Verify Checksum");
24  
25          EasyChildTabbedPanel compareFilesPanel = new CompareFilesPanel();
26          tabbedPane.addTab("Compare Files", null, compareFilesPanel, "Compare Files");
27  
28          EasyChildTabbedPanel scanFolderPanel = new ScanFolderPanel();
29          tabbedPane.addTab("Scan Folder", null, scanFolderPanel, "Scan Folder");
30  
31          EasyChildTabbedPanel stringHashPanel = new StringHashPanel();
32          tabbedPane.addTab("String Hash", null, stringHashPanel, "String Hash");
33  
34          tabbedPane.addChangeListener(e -> {
35              EasyChildTabbedPanel selectedPanel = (EasyChildTabbedPanel) tabbedPane.getSelectedComponent();
36              selectedPanel.onTabSelected();
37          });
38  
39          tabbedPane.setSelectedComponent(stringHashPanel);
40          stringHashPanel.onTabSelected();
41  
42          add(tabbedPane);
43          add(Box.createVerticalGlue());
44      }
45  
46  }