19 package org.sleuthkit.autopsy.corecomponents;
 
   21 import java.awt.Cursor;
 
   22 import java.awt.Window;
 
   24 import java.net.MalformedURLException;
 
   26 import java.text.MessageFormat;
 
   27 import java.util.Locale;
 
   28 import javax.swing.Icon;
 
   29 import javax.swing.ImageIcon;
 
   30 import javax.swing.JPanel;
 
   31 import javax.swing.SwingUtilities;
 
   32 import javax.swing.event.HyperlinkEvent;
 
   33 import javax.swing.event.HyperlinkListener;
 
   34 import org.netbeans.core.actions.HTMLViewAction;
 
   35 import org.openide.awt.HtmlBrowser;
 
   36 import org.openide.modules.Places;
 
   37 import org.openide.util.ImageUtilities;
 
   38 import org.openide.util.NbBundle;
 
   46 @SuppressWarnings(
"PMD.SingularField") 
 
   49     private static final long serialVersionUID = 1L;
 
   50     private URL url = null;
 
   55         about = 
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/splash.png"));
 
   60         about = 
new ImageIcon(ImageUtilities.loadImage(pathToBrandingImage));
 
   66         logoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
 
   68                 "LBL_Description", 
new Object[]{getProductVersionValue(), getJavaValue(), getVMValue(),
 
   69                     getOperatingSystemValue(), getEncodingValue(), getSystemLocaleValue(), getUserDirValue(), getSleuthKitVersionValue(), Version.getNetbeansBuild(), Version.getBuildType().toString()}));
 
   70         description.addHyperlinkListener(
this);
 
   71         copyright.addHyperlinkListener(
this);
 
   72         copyright.setBackground(getBackground());
 
   73         if (verboseLoggingIsSet()) {
 
   74             disableVerboseLoggingButton();
 
   81         logoLabel = 
new javax.swing.JLabel();
 
   82         jScrollPane3 = 
new javax.swing.JScrollPane();
 
   83         copyright = 
new javax.swing.JTextPane();
 
   84         jScrollPane2 = 
new javax.swing.JScrollPane();
 
   85         description = 
new javax.swing.JTextPane();
 
   86         verboseLoggingButton = 
new javax.swing.JButton();
 
   87         jButton2 = 
new javax.swing.JButton();
 
   89         setBackground(
new java.awt.Color(255, 255, 255));
 
   91         logoLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
 
   92         logoLabel.setIcon(about);
 
   93         logoLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
 
   94         logoLabel.addMouseListener(
new java.awt.event.MouseAdapter() {
 
   95             public void mouseClicked(java.awt.event.MouseEvent evt) {
 
   96                 logoLabelMouseClicked(evt);
 
  100         jScrollPane3.setBorder(null);
 
  102         copyright.setEditable(
false);
 
  103         copyright.setBorder(null);
 
  104         copyright.setContentType(
"text/html"); 
 
  105         copyright.setText(
org.openide.util.NbBundle.getBundle(
AboutWindowPanel.class).getString(
"LBL_Copyright")); 
 
  106         copyright.addMouseListener(
new java.awt.event.MouseAdapter() {
 
  107             public void mouseClicked(java.awt.event.MouseEvent evt) {
 
  108                 copyrightMouseClicked(evt);
 
  111         jScrollPane3.setViewportView(copyright);
 
  113         description.setEditable(
false);
 
  114         description.setContentType(
"text/html"); 
 
  115         jScrollPane2.setViewportView(description);
 
  117         verboseLoggingButton.setBackground(
new java.awt.Color(255, 255, 255));
 
  118         verboseLoggingButton.setText(
"Activate verbose logging");
 
  119         verboseLoggingButton.addActionListener(
new java.awt.event.ActionListener() {
 
  120             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  121                 activateVerboseLogging(evt);
 
  125         jButton2.setBackground(
new java.awt.Color(255, 255, 255));
 
  127         jButton2.addActionListener(
new java.awt.event.ActionListener() {
 
  128             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  129                 jButton2ActionPerformed(evt);
 
  133         javax.swing.GroupLayout layout = 
new javax.swing.GroupLayout(
this);
 
  134         this.setLayout(layout);
 
  135         layout.setHorizontalGroup(
 
  136             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  137             .addGroup(layout.createSequentialGroup()
 
  139                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  140                     .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
 
  141                     .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
 
  142                     .addComponent(logoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
 
  143                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
 
  144                         .addGap(0, 0, Short.MAX_VALUE)
 
  145                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  146                             .addComponent(verboseLoggingButton, javax.swing.GroupLayout.Alignment.TRAILING)
 
  147                             .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING))))
 
  150         layout.setVerticalGroup(
 
  151             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  152             .addGroup(layout.createSequentialGroup()
 
  154                 .addComponent(logoLabel)
 
  155                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 
  156                 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  157                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 
  158                 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  159                 .addGap(18, 18, Short.MAX_VALUE)
 
  160                 .addComponent(verboseLoggingButton)
 
  162                 .addComponent(jButton2)
 
  179     } 
catch (MalformedURLException ex) {
 
  186         startVerboseLogging();
 
  187         disableVerboseLoggingButton();
 
  200         this.verboseLoggingButton.setEnabled(
false);
 
  201         this.verboseLoggingButton.setText(
 
  202                 NbBundle.getMessage(
this.getClass(), 
"ProductInformationPanel.verbLoggingEnabled.text"));
 
  206         Window w = SwingUtilities.getWindowAncestor(
this);
 
  213             org.openide.awt.StatusDisplayer.getDefault().setStatusText(
 
  214                     NbBundle.getMessage(HTMLViewAction.class, 
"CTL_OpeningBrowser")); 
 
  215             HtmlBrowser.URLDisplayer.getDefault().showURL(url);
 
  220         return SleuthkitJNI.getVersion();
 
  224         return MessageFormat.format(
 
  225                 NbBundle.getBundle(
"org.netbeans.core.startup.Bundle").getString(
"currentVersion"), 
 
  226                 new Object[]{System.getProperty(
"netbeans.buildnumber")});
 
  230         return NbBundle.getMessage(
AboutWindowPanel.class, 
"Format_OperatingSystem_Value",
 
  231                 System.getProperty(
"os.name", 
 
  233                                 "ProductInformationPanel.propertyUnknown.text")),
 
  234                 System.getProperty(
"os.version", 
 
  236                                 "ProductInformationPanel.propertyUnknown.text")),
 
  237                 System.getProperty(
"os.arch", 
 
  239                                 "ProductInformationPanel.propertyUnknown.text")));
 
  243         return System.getProperty(
"java.version", 
 
  245                         "ProductInformationPanel.propertyUnknown.text"));
 
  250                 "ProductInformationPanel.getVMValue.text",
 
  251                 System.getProperty(
"java.vm.name", 
 
  253                                 "ProductInformationPanel.propertyUnknown.text")),
 
  254                 System.getProperty(
"java.vm.version", 
"")); 
 
  259         return Locale.getDefault().toString() + ((branding = NbBundle.getBranding()) == null ? 
"" : (
" (" + branding + 
")")); 
 
  263         return Places.getUserDirectory().getAbsolutePath();
 
  267         return System.getProperty(
"file.encoding", 
 
  268                 NbBundle.getMessage(
AboutWindowPanel.class, 
"ProductInformationPanel.propertyUnknown.text"));
 
  272         copyright.setText(text);
 
  277         if (HyperlinkEvent.EventType.ENTERED == event.getEventType()) {
 
  278             url = 
event.getURL();
 
  279         } 
else if (HyperlinkEvent.EventType.EXITED == event.getEventType()) {
 
  288         verboseLogging = 
true;
 
  291         SleuthkitJNI.startVerboseLogging(logPath);
 
  300         return verboseLogging;
 
javax.swing.JTextPane copyright
static String getVMValue()
void disableVerboseLoggingButton()
static String getProductVersionValue()
static String getJavaValue()
AboutWindowPanel(String pathToBrandingImage)
static String getOperatingSystemValue()
void logoLabelMouseClicked(java.awt.event.MouseEvent evt)
javax.swing.JTextPane description
static String getEncodingValue()
boolean verboseLoggingIsSet()
javax.swing.JScrollPane jScrollPane2
void hyperlinkUpdate(HyperlinkEvent event)
javax.swing.JButton jButton2
void activateVerboseLogging(java.awt.event.ActionEvent evt)
javax.swing.JLabel logoLabel
void copyrightMouseClicked(java.awt.event.MouseEvent evt)
javax.swing.JButton verboseLoggingButton
void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
void startVerboseLogging()
static String getSleuthKitVersionValue()
javax.swing.JScrollPane jScrollPane3
void setCopyright(String text)
static String getSystemLocaleValue()