19 package com.basistech.df.cybertriage.autopsy.ctoptions;
21 import java.awt.Desktop;
22 import java.io.IOException;
24 import java.net.URISyntaxException;
25 import java.util.logging.Level;
49 @SuppressWarnings(
"unchecked")
52 java.awt.GridBagConstraints gridBagConstraints;
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();
59 setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
LicenseDisclaimerPanel.class,
"LicenseDisclaimerPanel.border.title")));
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());
65 org.openide.awt.Mnemonics.setLocalizedText(disclaimer,
org.openide.util.NbBundle.getMessage(
LicenseDisclaimerPanel.class,
"LicenseDisclaimerPanel.disclaimer.text"));
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);
77 org.openide.awt.Mnemonics.setLocalizedText(purchaseFromLabel,
org.openide.util.NbBundle.getMessage(
LicenseDisclaimerPanel.class,
"LicenseDisclaimerPanel.purchaseFromLabel.text"));
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);
84 org.openide.awt.Mnemonics.setLocalizedText(link,
org.openide.util.NbBundle.getMessage(
LicenseDisclaimerPanel.class,
"LicenseDisclaimerPanel.link.text"));
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) {
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);
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)
104 spacerLayout.setVerticalGroup(
105 spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
106 .addGap(0, 0, Short.MAX_VALUE)
109 gridBagConstraints =
new java.awt.GridBagConstraints();
110 gridBagConstraints.gridx = 0;
111 gridBagConstraints.gridy = 2;
112 gridBagConstraints.weighty = 1.0;
113 add(spacer, gridBagConstraints);
117 if (Desktop.isDesktopSupported()) {
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);
124 LOGGER.log(Level.WARNING,
"Desktop API is not supported. Link cannot be opened.");
void linkMouseClicked(java.awt.event.MouseEvent evt)
synchronized static Logger getLogger(String name)
static final String CHECKOUT_PAGE_URL
static final Logger LOGGER