Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
LicenseDisclaimerPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2023 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 com.basistech.df.cybertriage.autopsy.ctoptions;
20 
21 import java.awt.Desktop;
22 import java.io.IOException;
23 import java.net.URI;
24 import java.net.URISyntaxException;
25 import java.util.logging.Level;
27 
31 public class LicenseDisclaimerPanel extends javax.swing.JPanel {
32 
33  private static final Logger LOGGER = Logger.getLogger(LicenseDisclaimerPanel.class.getName());
34 
35  private static final String CHECKOUT_PAGE_URL = "https://cybertriage.com/autopsy-checkout";
36 
42  }
43 
49  @SuppressWarnings("unchecked")
50  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
51  private void initComponents() {
52  java.awt.GridBagConstraints gridBagConstraints;
53 
54  javax.swing.JLabel disclaimer = new javax.swing.JLabel();
55  javax.swing.JLabel purchaseFromLabel = new javax.swing.JLabel();
56  javax.swing.JLabel link = new javax.swing.JLabel();
57  javax.swing.JPanel spacer = new javax.swing.JPanel();
58 
59  setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.border.title"))); // NOI18N
60  setMaximumSize(new java.awt.Dimension(2147483647, 90));
61  setMinimumSize(new java.awt.Dimension(562, 90));
62  setPreferredSize(new java.awt.Dimension(400, 90));
63  setLayout(new java.awt.GridBagLayout());
64 
65  org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.disclaimer.text")); // NOI18N
66  disclaimer.setVerticalAlignment(javax.swing.SwingConstants.TOP);
67  gridBagConstraints = new java.awt.GridBagConstraints();
68  gridBagConstraints.gridx = 0;
69  gridBagConstraints.gridy = 0;
70  gridBagConstraints.gridwidth = 2;
71  gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
72  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
73  gridBagConstraints.weightx = 1.0;
74  gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
75  add(disclaimer, gridBagConstraints);
76 
77  org.openide.awt.Mnemonics.setLocalizedText(purchaseFromLabel, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.purchaseFromLabel.text")); // NOI18N
78  gridBagConstraints = new java.awt.GridBagConstraints();
79  gridBagConstraints.gridy = 1;
80  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
81  gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 3);
82  add(purchaseFromLabel, gridBagConstraints);
83 
84  org.openide.awt.Mnemonics.setLocalizedText(link, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.link.text")); // NOI18N
85  link.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
86  link.addMouseListener(new java.awt.event.MouseAdapter() {
87  public void mouseClicked(java.awt.event.MouseEvent evt) {
88  linkMouseClicked(evt);
89  }
90  });
91  gridBagConstraints = new java.awt.GridBagConstraints();
92  gridBagConstraints.gridy = 1;
93  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
94  gridBagConstraints.weightx = 1.0;
95  gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5);
96  add(link, gridBagConstraints);
97 
98  javax.swing.GroupLayout spacerLayout = new javax.swing.GroupLayout(spacer);
99  spacer.setLayout(spacerLayout);
100  spacerLayout.setHorizontalGroup(
101  spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
102  .addGap(0, 0, Short.MAX_VALUE)
103  );
104  spacerLayout.setVerticalGroup(
105  spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
106  .addGap(0, 0, Short.MAX_VALUE)
107  );
108 
109  gridBagConstraints = new java.awt.GridBagConstraints();
110  gridBagConstraints.gridx = 0;
111  gridBagConstraints.gridy = 2;
112  gridBagConstraints.weighty = 1.0;
113  add(spacer, gridBagConstraints);
114  }// </editor-fold>//GEN-END:initComponents
115 
116  private void linkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_linkMouseClicked
117  if (Desktop.isDesktopSupported()) {
118  try {
119  Desktop.getDesktop().browse(new URI(CHECKOUT_PAGE_URL));
120  } catch (IOException | URISyntaxException e) {
121  LOGGER.log(Level.SEVERE, "Error opening link to: " + CHECKOUT_PAGE_URL, e);
122  }
123  } else {
124  LOGGER.log(Level.WARNING, "Desktop API is not supported. Link cannot be opened.");
125  }
126  }//GEN-LAST:event_linkMouseClicked
127 
128 
129  // Variables declaration - do not modify//GEN-BEGIN:variables
130  // End of variables declaration//GEN-END:variables
131 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

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