Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
AutopsyOptionsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 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.corecomponents;
20 
21 import java.awt.image.BufferedImage;
22 import java.io.File;
23 import java.io.IOException;
24 import java.lang.management.ManagementFactory;
25 import java.nio.charset.Charset;
26 import java.nio.file.Files;
27 import java.nio.file.Path;
28 import java.util.ArrayList;
29 import java.util.List;
30 import java.util.Optional;
31 import java.util.StringJoiner;
32 import java.util.logging.Level;
33 import javax.imageio.ImageIO;
34 import javax.swing.ImageIcon;
35 import javax.swing.JFileChooser;
36 import javax.swing.JOptionPane;
37 import javax.swing.event.DocumentEvent;
38 import javax.swing.event.DocumentListener;
39 import org.netbeans.spi.options.OptionsPanelController;
40 import org.openide.util.NbBundle;
42 import org.openide.util.NbBundle.Messages;
49 
53 @Messages({"AutopsyOptionsPanel.agencyLogoPreview.text=<html><div style='text-align: center;'>No logo<br>selected</div></html>",
54  "AutopsyOptionsPanel.logoPanel.border.title=Logo",
55  "AutopsyOptionsPanel.viewPanel.border.title=View",
56  "AutopsyOptionsPanel.invalidImageFile.msg=The selected file was not able to be used as an agency logo.",
57  "AutopsyOptionsPanel.invalidImageFile.title=Invalid Image File",
58  "AutopsyOptionsPanel.restartNecessaryWarning.text=A restart is necessary for any changes to max memory to take effect.",
59  "AutopsyOptionsPanel.totalMemoryLabel.text=Total System Memory:",
60  "AutopsyOptionsPanel.maxMemoryLabel.text=Maximum JVM Memory:",
61  "AutopsyOptionsPanel.maxMemoryUnitsLabel.text=GB",
62  "AutopsyOptionsPanel.runtimePanel.border.title=Runtime",
63  "AutopsyOptionsPanel.memFieldValidationLabel.not64BitInstall.text=JVM memory settings only enabled for 64 bit version",
64  "AutopsyOptionsPanel.memFieldValidationLabel.noValueEntered.text=No value entered",
65  "AutopsyOptionsPanel.memFieldValidationLabel.invalidCharacters.text=Invalid characters, value must be a positive integer",
66  "# {0} - minimumMemory",
67  "AutopsyOptionsPanel.memFieldValidationLabel.underMinMemory.text=Value must be at least {0}GB",
68  "# {0} - systemMemory",
69  "AutopsyOptionsPanel.memFieldValidationLabel.overMaxMemory.text=Value must be less than the total system memory of {0}GB",
70  "AutopsyOptionsPanel.memFieldValidationLabel.developerMode.text=Memory settings are not available while running in developer mode",
71  "AutopsyOptionsPanel.defaultLogoRB.text=Use default",
72  "AutopsyOptionsPanel.specifyLogoRB.text=Specify a logo",
73  "AutopsyOptionsPanel.browseLogosButton.text=Browse",
74  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidPath.text=Path is not valid.",
75  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidImageSpecified.text=Invalid image file specified.",
76  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.pathNotSet.text=Agency logo path must be set.",
77  "AutopsyOptionsPanel.maxLogFileCount.text=Maximum Log Files:",
78  "AutopsyOptionsPanel.logNumAlert.invalidInput.text=A positive integer is required here."
79 })
80 
81 final class AutopsyOptionsPanel extends javax.swing.JPanel {
82 
83  private static final long serialVersionUID = 1L;
84  private final JFileChooser fileChooser;
85  private final TextFieldListener textFieldListener;
86  private static final String ETC_FOLDER_NAME = "etc";
87  private static final String CONFIG_FILE_EXTENSION = ".conf";
88  private static final long ONE_BILLION = 1000000000L; //used to roughly convert system memory from bytes to gigabytes
89  private static final long MEGA_IN_GIGA = 1024; //used to convert memory settings saved as megabytes to gigabytes
90  private static final int MIN_MEMORY_IN_GB = 2; //the enforced minimum memory in gigabytes
91  private static final Logger LOGGER = Logger.getLogger(AutopsyOptionsPanel.class.getName());
92  private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
93 
97  AutopsyOptionsPanel() {
98  initComponents();
99  fileChooser = new JFileChooser();
100  fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
101  fileChooser.setMultiSelectionEnabled(false);
102  fileChooser.setAcceptAllFileFilterUsed(false);
103  fileChooser.setFileFilter(new GeneralFilter(GeneralFilter.GRAPHIC_IMAGE_EXTS, GeneralFilter.GRAPHIC_IMG_DECR));
104  if (!PlatformUtil.is64BitJVM() || Version.getBuildType() == Version.Type.DEVELOPMENT) {
105  //32 bit JVM has a max heap size of 1.4 gb to 4 gb depending on OS
106  //So disabling the setting of heap size when the JVM is not 64 bit
107  //Is the safest course of action
108  //And the file won't exist in the install folder when running through netbeans
109  memField.setEnabled(false);
110  }
111  systemMemoryTotal.setText(Long.toString(getSystemMemoryInGB()));
112 
113  textFieldListener = new TextFieldListener();
114  agencyLogoPathField.getDocument().addDocumentListener(textFieldListener);
115  logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
116  }
117 
124  private long getSystemMemoryInGB() {
125  long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
126  .getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
127  return memorySize / ONE_BILLION;
128  }
129 
135  private long getCurrentJvmMaxMemoryInGB() throws IOException {
136  String currentXmx = getCurrentXmxValue();
137  char units = '-';
138  Long value = 0L;
139  if (currentXmx.length() > 1) {
140  units = currentXmx.charAt(currentXmx.length() - 1);
141  value = Long.parseLong(currentXmx.substring(0, currentXmx.length() - 1));
142  } else {
143  throw new IOException("No memory setting found in String: " + currentXmx);
144  }
145  //some older .conf files might have the units as megabytes instead of gigabytes
146  switch (units) {
147  case 'g':
148  case 'G':
149  return value;
150  case 'm':
151  case 'M':
152  return value / MEGA_IN_GIGA;
153  default:
154  throw new IOException("Units were not recognized as parsed: " + units);
155  }
156  }
157 
158  /*
159  * The value currently saved in the conf file as the max java heap space
160  * available to this application. Form will be an integer followed by a
161  * character indicating units. Helper method for
162  * getCurrentJvmMaxMemoryInGB()
163  *
164  * @return the saved value for the max java heap space
165  *
166  * @throws IOException if the conf file does not exist in either the user
167  * directory or the install directory
168  */
169  private String getCurrentXmxValue() throws IOException {
170  String[] settings;
171  String currentSetting = "";
172  File userConfFile = getUserFolderConfFile();
173  if (!userConfFile.exists()) {
174  settings = getDefaultsFromFileContents(readConfFile(getInstallFolderConfFile()));
175  } else {
176  settings = getDefaultsFromFileContents(readConfFile(userConfFile));
177  }
178  for (String option : settings) {
179  if (option.startsWith("-J-Xmx")) {
180  currentSetting = option.replace("-J-Xmx", "").trim();
181  }
182  }
183  return currentSetting;
184  }
185 
194  private static File getInstallFolderConfFile() throws IOException {
195  String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
196  String installFolder = PlatformUtil.getInstallPath();
197  File installFolderEtc = new File(installFolder, ETC_FOLDER_NAME);
198  File installFolderConfigFile = new File(installFolderEtc, confFileName);
199  if (!installFolderConfigFile.exists()) {
200  throw new IOException("Conf file could not be found" + installFolderConfigFile.toString());
201  }
202  return installFolderConfigFile;
203  }
204 
212  private static File getUserFolderConfFile() {
213  String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
214  File userFolder = PlatformUtil.getUserDirectory();
215  File userEtcFolder = new File(userFolder, ETC_FOLDER_NAME);
216  if (!userEtcFolder.exists()) {
217  userEtcFolder.mkdir();
218  }
219  return new File(userEtcFolder, confFileName);
220  }
221 
230  private void writeEtcConfFile() throws IOException {
231  StringBuilder content = new StringBuilder();
232  List<String> confFile = readConfFile(getInstallFolderConfFile());
233  for (String line : confFile) {
234  if (line.contains("-J-Xmx")) {
235  String[] splitLine = line.split(" ");
236  StringJoiner modifiedLine = new StringJoiner(" ");
237  for (String piece : splitLine) {
238  if (piece.contains("-J-Xmx")) {
239  piece = "-J-Xmx" + memField.getText() + "g";
240  }
241  modifiedLine.add(piece);
242  }
243  content.append(modifiedLine.toString());
244  } else {
245  content.append(line);
246  }
247  content.append("\n");
248  }
249  Files.write(getUserFolderConfFile().toPath(), content.toString().getBytes());
250  }
251 
261  private static List<String> readConfFile(File configFile) {
262  List<String> lines = new ArrayList<>();
263  if (null != configFile) {
264  Path filePath = configFile.toPath();
265  Charset charset = Charset.forName("UTF-8");
266  try {
267  lines = Files.readAllLines(filePath, charset);
268  } catch (IOException e) {
269  LOGGER.log(Level.SEVERE, "Error reading config file contents. {}", configFile.getAbsolutePath());
270  }
271  }
272  return lines;
273  }
274 
286  private static String[] getDefaultsFromFileContents(List<String> list) {
287  Optional<String> defaultSettings = list.stream().filter(line -> line.startsWith("default_options=")).findFirst();
288 
289  if (defaultSettings.isPresent()) {
290  return defaultSettings.get().replace("default_options=", "").replaceAll("\"", "").split(" ");
291  }
292  return new String[]{};
293  }
294 
298  void load() {
299  boolean keepPreferredViewer = UserPreferences.keepPreferredContentViewer();
300  keepCurrentViewerRB.setSelected(keepPreferredViewer);
301  useBestViewerRB.setSelected(!keepPreferredViewer);
302  dataSourcesHideKnownCB.setSelected(UserPreferences.hideKnownFilesInDataSourcesTree());
303  viewsHideKnownCB.setSelected(UserPreferences.hideKnownFilesInViewsTree());
304  dataSourcesHideSlackCB.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
305  viewsHideSlackCB.setSelected(UserPreferences.hideSlackFilesInViewsTree());
306  boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
307  useLocalTimeRB.setSelected(useLocalTime);
308  useGMTTimeRB.setSelected(!useLocalTime);
309  String path = ModuleSettings.getConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP);
310  boolean useDefault = (path == null || path.isEmpty());
311  defaultLogoRB.setSelected(useDefault);
312  specifyLogoRB.setSelected(!useDefault);
313  agencyLogoPathField.setEnabled(!useDefault);
314  browseLogosButton.setEnabled(!useDefault);
315  logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
316  try {
317  updateAgencyLogo(path);
318  } catch (IOException ex) {
319  LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex);
320  }
321  if (memField.isEnabled()) {
322  try {
323  initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB());
324  } catch (IOException ex) {
325  LOGGER.log(Level.SEVERE, "Can't read current Jvm max memory setting from file", ex);
326  memField.setEnabled(false);
327  }
328  memField.setText(initialMemValue);
329  }
330 
331  valid(); //ensure the error messages are up to date
332  }
333 
341  private void updateAgencyLogo(String path) throws IOException {
342  agencyLogoPathField.setText(path);
343  ImageIcon agencyLogoIcon = new ImageIcon();
344  agencyLogoPreview.setText(Bundle.AutopsyOptionsPanel_agencyLogoPreview_text());
345  if (!agencyLogoPathField.getText().isEmpty()) {
346  File file = new File(agencyLogoPathField.getText());
347  if (file.exists()) {
348  BufferedImage image = ImageIO.read(file); //create it as an image first to support BMP files
349  if (image == null) {
350  throw new IOException("Unable to read file as a BufferedImage for file " + file.toString());
351  }
352  agencyLogoIcon = new ImageIcon(image.getScaledInstance(64, 64, 4));
353  agencyLogoPreview.setText("");
354  }
355  }
356  agencyLogoPreview.setIcon(agencyLogoIcon);
357  agencyLogoPreview.repaint();
358  }
359 
363  void store() {
364  UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRB.isSelected());
365  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCB.isSelected());
366  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCB.isSelected());
367  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCB.isSelected());
368  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCB.isSelected());
369  UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRB.isSelected());
370  UserPreferences.setLogFileCount(Integer.parseInt(logFileCount.getText()));
371  if (!agencyLogoPathField.getText().isEmpty()) {
372  File file = new File(agencyLogoPathField.getText());
373  if (file.exists()) {
374  ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP, agencyLogoPathField.getText());
375  }
376  } else {
377  ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP, "");
378  }
379  if (memField.isEnabled()) { //if the field could of been changed we need to try and save it
380  try {
381  writeEtcConfFile();
382  } catch (IOException ex) {
383  LOGGER.log(Level.WARNING, "Unable to save config file to " + PlatformUtil.getUserDirectory() + "\\" + ETC_FOLDER_NAME, ex);
384  }
385  }
386  }
387 
393  boolean valid() {
394  boolean valid = true;
395 
396  if (!isAgencyLogoPathValid()) {
397  valid = false;
398  }
399  if (!isMemFieldValid()) {
400  valid = false;
401  }
402  if (!isLogNumFieldValid()) {
403  valid = false;
404  }
405 
406  return valid;
407  }
408 
415  boolean isAgencyLogoPathValid() {
416  boolean valid = true;
417 
418  if (defaultLogoRB.isSelected()) {
419  agencyLogoPathFieldValidationLabel.setText("");
420  } else {
421  String agencyLogoPath = agencyLogoPathField.getText();
422  if (agencyLogoPath.isEmpty()) {
423  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_pathNotSet_text());
424  valid = false;
425  } else {
426  File file = new File(agencyLogoPathField.getText());
427  if (file.exists() && file.isFile()) {
428  BufferedImage image;
429  try { //ensure the image can be read
430  image = ImageIO.read(file); //create it as an image first to support BMP files
431  if (image == null) {
432  throw new IOException("Unable to read file as a BufferedImage for file " + file.toString());
433  }
434  agencyLogoPathFieldValidationLabel.setText("");
435  } catch (IOException | IndexOutOfBoundsException ignored) {
436  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidImageSpecified_text());
437  valid = false;
438  }
439  } else {
440  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidPath_text());
441  valid = false;
442  }
443  }
444  }
445 
446  return valid;
447  }
448 
454  private boolean isMemFieldValid() {
455  String memText = memField.getText();
456  memFieldValidationLabel.setText("");
457  if (!PlatformUtil.is64BitJVM()) {
458  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_not64BitInstall_text());
459  //the panel should be valid when it is a 32 bit jvm because the memfield will be disabled.
460  return true;
461  }
462  if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
463  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_developerMode_text());
464  //the panel should be valid when you are running in developer mode because the memfield will be disabled
465  return true;
466  }
467  if (memText.length() == 0) {
468  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_noValueEntered_text());
469  return false;
470  }
471  if (memText.replaceAll("[^\\d]", "").length() != memText.length()) {
472  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_invalidCharacters_text());
473  return false;
474  }
475  int parsedInt = Integer.parseInt(memText);
476  if (parsedInt < MIN_MEMORY_IN_GB) {
477  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_underMinMemory_text(MIN_MEMORY_IN_GB));
478  return false;
479  }
480  if (parsedInt > getSystemMemoryInGB()) {
481  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_overMaxMemory_text(getSystemMemoryInGB()));
482  return false;
483  }
484  return true;
485  }
486 
492  private boolean isLogNumFieldValid() {
493  String count = logFileCount.getText();
494  logNumAlert.setText("");
495  try {
496  int count_num = Integer.parseInt(count);
497  if (count_num < 1) {
498  logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
499  return false;
500  }
501  } catch (NumberFormatException e) {
502  logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
503  return false;
504  }
505  return true;
506  }
511  private class TextFieldListener implements DocumentListener {
512 
513  @Override
514  public void insertUpdate(DocumentEvent e) {
515  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
516  }
517 
518  @Override
519  public void removeUpdate(DocumentEvent e) {
520  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
521  }
522 
523  @Override
524  public void changedUpdate(DocumentEvent e) {
525  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
526  }
527  }
528 
534  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
535  private void initComponents() {
536 
537  fileSelectionButtonGroup = new javax.swing.ButtonGroup();
538  displayTimesButtonGroup = new javax.swing.ButtonGroup();
539  logoSourceButtonGroup = new javax.swing.ButtonGroup();
540  jScrollPane1 = new javax.swing.JScrollPane();
541  jPanel1 = new javax.swing.JPanel();
542  logoPanel = new javax.swing.JPanel();
543  agencyLogoPathField = new javax.swing.JTextField();
544  browseLogosButton = new javax.swing.JButton();
545  agencyLogoPreview = new javax.swing.JLabel();
546  defaultLogoRB = new javax.swing.JRadioButton();
547  specifyLogoRB = new javax.swing.JRadioButton();
548  agencyLogoPathFieldValidationLabel = new javax.swing.JLabel();
549  viewPanel = new javax.swing.JPanel();
550  jLabelSelectFile = new javax.swing.JLabel();
551  useBestViewerRB = new javax.swing.JRadioButton();
552  keepCurrentViewerRB = new javax.swing.JRadioButton();
553  jLabelHideKnownFiles = new javax.swing.JLabel();
554  dataSourcesHideKnownCB = new javax.swing.JCheckBox();
555  viewsHideKnownCB = new javax.swing.JCheckBox();
556  jLabelHideSlackFiles = new javax.swing.JLabel();
557  dataSourcesHideSlackCB = new javax.swing.JCheckBox();
558  viewsHideSlackCB = new javax.swing.JCheckBox();
559  jLabelTimeDisplay = new javax.swing.JLabel();
560  useLocalTimeRB = new javax.swing.JRadioButton();
561  useGMTTimeRB = new javax.swing.JRadioButton();
562  runtimePanel = new javax.swing.JPanel();
563  maxMemoryLabel = new javax.swing.JLabel();
564  maxMemoryUnitsLabel = new javax.swing.JLabel();
565  totalMemoryLabel = new javax.swing.JLabel();
566  systemMemoryTotal = new javax.swing.JLabel();
567  restartNecessaryWarning = new javax.swing.JLabel();
568  memField = new javax.swing.JTextField();
569  memFieldValidationLabel = new javax.swing.JLabel();
570  maxMemoryUnitsLabel1 = new javax.swing.JLabel();
571  maxLogFileCount = new javax.swing.JLabel();
572  logFileCount = new javax.swing.JTextField();
573  logNumAlert = new javax.swing.JTextField();
574 
575  jScrollPane1.setBorder(null);
576 
577  jPanel1.setPreferredSize(new java.awt.Dimension(671, 488));
578 
579  logoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.logoPanel.border.title"))); // NOI18N
580 
581  agencyLogoPathField.setText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPathField.text")); // NOI18N
582 
583  org.openide.awt.Mnemonics.setLocalizedText(browseLogosButton, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.browseLogosButton.text")); // NOI18N
584  browseLogosButton.addActionListener(new java.awt.event.ActionListener() {
585  public void actionPerformed(java.awt.event.ActionEvent evt) {
586  browseLogosButtonActionPerformed(evt);
587  }
588  });
589 
590  agencyLogoPreview.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
591  org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPreview, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPreview.text")); // NOI18N
592  agencyLogoPreview.setBorder(javax.swing.BorderFactory.createEtchedBorder());
593  agencyLogoPreview.setMaximumSize(new java.awt.Dimension(64, 64));
594  agencyLogoPreview.setMinimumSize(new java.awt.Dimension(64, 64));
595  agencyLogoPreview.setPreferredSize(new java.awt.Dimension(64, 64));
596 
597  logoSourceButtonGroup.add(defaultLogoRB);
598  org.openide.awt.Mnemonics.setLocalizedText(defaultLogoRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.defaultLogoRB.text")); // NOI18N
599  defaultLogoRB.addActionListener(new java.awt.event.ActionListener() {
600  public void actionPerformed(java.awt.event.ActionEvent evt) {
601  defaultLogoRBActionPerformed(evt);
602  }
603  });
604 
605  logoSourceButtonGroup.add(specifyLogoRB);
606  org.openide.awt.Mnemonics.setLocalizedText(specifyLogoRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.specifyLogoRB.text")); // NOI18N
607  specifyLogoRB.addActionListener(new java.awt.event.ActionListener() {
608  public void actionPerformed(java.awt.event.ActionEvent evt) {
609  specifyLogoRBActionPerformed(evt);
610  }
611  });
612 
613  agencyLogoPathFieldValidationLabel.setForeground(new java.awt.Color(255, 0, 0));
614  org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPathFieldValidationLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.text")); // NOI18N
615 
616  javax.swing.GroupLayout logoPanelLayout = new javax.swing.GroupLayout(logoPanel);
617  logoPanel.setLayout(logoPanelLayout);
618  logoPanelLayout.setHorizontalGroup(
619  logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
620  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
621  .addContainerGap()
622  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
623  .addComponent(specifyLogoRB, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
624  .addComponent(defaultLogoRB, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
625  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
626  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
627  .addGroup(logoPanelLayout.createSequentialGroup()
628  .addComponent(agencyLogoPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
629  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
630  .addComponent(browseLogosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
631  .addComponent(agencyLogoPathFieldValidationLabel))
632  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
633  .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
634  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
635  );
636  logoPanelLayout.setVerticalGroup(
637  logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
638  .addGroup(logoPanelLayout.createSequentialGroup()
639  .addGap(6, 6, 6)
640  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
641  .addComponent(defaultLogoRB)
642  .addComponent(agencyLogoPathFieldValidationLabel))
643  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
644  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
645  .addComponent(specifyLogoRB)
646  .addComponent(agencyLogoPathField)
647  .addComponent(browseLogosButton)))
648  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
649  .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
650  .addGap(0, 0, Short.MAX_VALUE))
651  );
652 
653  viewPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewPanel.border.title"))); // NOI18N
654 
655  org.openide.awt.Mnemonics.setLocalizedText(jLabelSelectFile, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelSelectFile.text")); // NOI18N
656 
657  fileSelectionButtonGroup.add(useBestViewerRB);
658  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.text")); // NOI18N
659  useBestViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.toolTipText")); // NOI18N
660  useBestViewerRB.addActionListener(new java.awt.event.ActionListener() {
661  public void actionPerformed(java.awt.event.ActionEvent evt) {
662  useBestViewerRBActionPerformed(evt);
663  }
664  });
665 
666  fileSelectionButtonGroup.add(keepCurrentViewerRB);
667  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.text")); // NOI18N
668  keepCurrentViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText")); // NOI18N
669  keepCurrentViewerRB.addActionListener(new java.awt.event.ActionListener() {
670  public void actionPerformed(java.awt.event.ActionEvent evt) {
671  keepCurrentViewerRBActionPerformed(evt);
672  }
673  });
674 
675  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideKnownFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideKnownFiles.text")); // NOI18N
676 
677  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideKnownCB.text")); // NOI18N
678  dataSourcesHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
679  public void actionPerformed(java.awt.event.ActionEvent evt) {
680  dataSourcesHideKnownCBActionPerformed(evt);
681  }
682  });
683 
684  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideKnownCB.text")); // NOI18N
685  viewsHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
686  public void actionPerformed(java.awt.event.ActionEvent evt) {
687  viewsHideKnownCBActionPerformed(evt);
688  }
689  });
690 
691  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideSlackFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideSlackFiles.text")); // NOI18N
692 
693  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideSlackCB.text")); // NOI18N
694  dataSourcesHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
695  public void actionPerformed(java.awt.event.ActionEvent evt) {
696  dataSourcesHideSlackCBActionPerformed(evt);
697  }
698  });
699 
700  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideSlackCB.text")); // NOI18N
701  viewsHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
702  public void actionPerformed(java.awt.event.ActionEvent evt) {
703  viewsHideSlackCBActionPerformed(evt);
704  }
705  });
706 
707  org.openide.awt.Mnemonics.setLocalizedText(jLabelTimeDisplay, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelTimeDisplay.text")); // NOI18N
708 
709  displayTimesButtonGroup.add(useLocalTimeRB);
710  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useLocalTimeRB.text")); // NOI18N
711  useLocalTimeRB.addActionListener(new java.awt.event.ActionListener() {
712  public void actionPerformed(java.awt.event.ActionEvent evt) {
713  useLocalTimeRBActionPerformed(evt);
714  }
715  });
716 
717  displayTimesButtonGroup.add(useGMTTimeRB);
718  org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useGMTTimeRB.text")); // NOI18N
719  useGMTTimeRB.addActionListener(new java.awt.event.ActionListener() {
720  public void actionPerformed(java.awt.event.ActionEvent evt) {
721  useGMTTimeRBActionPerformed(evt);
722  }
723  });
724 
725  javax.swing.GroupLayout viewPanelLayout = new javax.swing.GroupLayout(viewPanel);
726  viewPanel.setLayout(viewPanelLayout);
727  viewPanelLayout.setHorizontalGroup(
728  viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
729  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPanelLayout.createSequentialGroup()
730  .addContainerGap()
731  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
732  .addGroup(viewPanelLayout.createSequentialGroup()
733  .addGap(10, 10, 10)
734  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
735  .addGroup(viewPanelLayout.createSequentialGroup()
736  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
737  .addComponent(useGMTTimeRB)
738  .addComponent(keepCurrentViewerRB)
739  .addComponent(useBestViewerRB)
740  .addComponent(dataSourcesHideKnownCB)
741  .addComponent(viewsHideKnownCB))
742  .addGap(0, 0, Short.MAX_VALUE))
743  .addGroup(viewPanelLayout.createSequentialGroup()
744  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
745  .addComponent(dataSourcesHideSlackCB)
746  .addComponent(viewsHideSlackCB)
747  .addComponent(useLocalTimeRB))
748  .addContainerGap(158, Short.MAX_VALUE))))
749  .addGroup(viewPanelLayout.createSequentialGroup()
750  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
751  .addComponent(jLabelHideSlackFiles)
752  .addComponent(jLabelTimeDisplay)
753  .addComponent(jLabelHideKnownFiles)
754  .addComponent(jLabelSelectFile))
755  .addGap(30, 30, 30))))
756  );
757  viewPanelLayout.setVerticalGroup(
758  viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
759  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPanelLayout.createSequentialGroup()
760  .addContainerGap()
761  .addComponent(jLabelSelectFile)
762  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
763  .addComponent(useBestViewerRB)
764  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
765  .addComponent(keepCurrentViewerRB)
766  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
767  .addComponent(jLabelHideKnownFiles)
768  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
769  .addComponent(dataSourcesHideKnownCB)
770  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
771  .addComponent(viewsHideKnownCB)
772  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
773  .addComponent(jLabelHideSlackFiles)
774  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
775  .addComponent(dataSourcesHideSlackCB)
776  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
777  .addComponent(viewsHideSlackCB)
778  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
779  .addComponent(jLabelTimeDisplay)
780  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
781  .addComponent(useLocalTimeRB)
782  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
783  .addComponent(useGMTTimeRB))
784  );
785 
786  runtimePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.runtimePanel.border.title"))); // NOI18N
787 
788  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryLabel.text")); // NOI18N
789 
790  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryUnitsLabel.text")); // NOI18N
791 
792  org.openide.awt.Mnemonics.setLocalizedText(totalMemoryLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.totalMemoryLabel.text")); // NOI18N
793 
794  systemMemoryTotal.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
795 
796  restartNecessaryWarning.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/warning16.png"))); // NOI18N
797  org.openide.awt.Mnemonics.setLocalizedText(restartNecessaryWarning, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.restartNecessaryWarning.text")); // NOI18N
798 
799  memField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
800  memField.addKeyListener(new java.awt.event.KeyAdapter() {
801  public void keyReleased(java.awt.event.KeyEvent evt) {
802  memFieldKeyReleased(evt);
803  }
804  });
805 
806  memFieldValidationLabel.setForeground(new java.awt.Color(255, 0, 0));
807 
808  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel1, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryUnitsLabel.text")); // NOI18N
809 
810  org.openide.awt.Mnemonics.setLocalizedText(maxLogFileCount, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxLogFileCount.text")); // NOI18N
811 
812  logFileCount.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
813  logFileCount.addKeyListener(new java.awt.event.KeyAdapter() {
814  public void keyReleased(java.awt.event.KeyEvent evt) {
815  logFileCountKeyReleased(evt);
816  }
817  });
818 
819  logNumAlert.setEditable(false);
820  logNumAlert.setFont(logNumAlert.getFont().deriveFont(logNumAlert.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
821  logNumAlert.setForeground(new java.awt.Color(255, 0, 0));
822  logNumAlert.setText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.logNumAlert.text")); // NOI18N
823  logNumAlert.setBorder(null);
824 
825  javax.swing.GroupLayout runtimePanelLayout = new javax.swing.GroupLayout(runtimePanel);
826  runtimePanel.setLayout(runtimePanelLayout);
827  runtimePanelLayout.setHorizontalGroup(
828  runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
829  .addGroup(runtimePanelLayout.createSequentialGroup()
830  .addContainerGap()
831  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
832  .addGroup(runtimePanelLayout.createSequentialGroup()
833  .addComponent(totalMemoryLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
834  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
835  .addComponent(systemMemoryTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
836  .addGap(2, 2, 2)
837  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
838  .addGroup(runtimePanelLayout.createSequentialGroup()
839  .addComponent(maxMemoryUnitsLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
840  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
841  .addComponent(restartNecessaryWarning, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE))
842  .addGroup(runtimePanelLayout.createSequentialGroup()
843  .addComponent(maxMemoryUnitsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
844  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
845  .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
846  .addGap(0, 0, Short.MAX_VALUE))))
847  .addGroup(runtimePanelLayout.createSequentialGroup()
848  .addComponent(maxMemoryLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
849  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
850  .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
851  .addGap(0, 0, Short.MAX_VALUE))
852  .addGroup(runtimePanelLayout.createSequentialGroup()
853  .addComponent(maxLogFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
854  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
855  .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
856  .addGap(18, 18, 18)
857  .addComponent(logNumAlert)))
858  .addContainerGap())
859  );
860  runtimePanelLayout.setVerticalGroup(
861  runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
862  .addGroup(runtimePanelLayout.createSequentialGroup()
863  .addContainerGap()
864  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
865  .addComponent(totalMemoryLabel)
866  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
867  .addComponent(restartNecessaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
868  .addComponent(maxMemoryUnitsLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
869  .addComponent(systemMemoryTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
870  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
871  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
872  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
873  .addComponent(maxMemoryLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
874  .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
875  .addComponent(maxMemoryUnitsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
876  .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
877  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
878  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
879  .addComponent(maxLogFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
880  .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
881  .addComponent(logNumAlert, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
882  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
883  );
884 
885  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
886  jPanel1.setLayout(jPanel1Layout);
887  jPanel1Layout.setHorizontalGroup(
888  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
889  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
890  .addContainerGap()
891  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
892  .addComponent(logoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
893  .addGroup(jPanel1Layout.createSequentialGroup()
894  .addComponent(viewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
895  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
896  .addComponent(runtimePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
897  .addContainerGap())
898  );
899  jPanel1Layout.setVerticalGroup(
900  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
901  .addGroup(jPanel1Layout.createSequentialGroup()
902  .addGap(0, 0, 0)
903  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
904  .addComponent(viewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
905  .addComponent(runtimePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
906  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
907  .addComponent(logoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
908  .addContainerGap())
909  );
910 
911  jScrollPane1.setViewportView(jPanel1);
912 
913  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
914  this.setLayout(layout);
915  layout.setHorizontalGroup(
916  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
917  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1010, Short.MAX_VALUE)
918  );
919  layout.setVerticalGroup(
920  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
921  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
922  );
923  }// </editor-fold>//GEN-END:initComponents
924 
925  private void logFileCountKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_logFileCountKeyReleased
926  String count = logFileCount.getText();
927  if (count.equals(String.valueOf(UserPreferences.getDefaultLogFileCount()))) {
928  //if it is still the default value don't fire change
929  return;
930  }
931  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
932  }//GEN-LAST:event_logFileCountKeyReleased
933 
934  private void memFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_memFieldKeyReleased
935  String memText = memField.getText();
936  if (memText.equals(initialMemValue)) {
937  //if it is still the initial value don't fire change
938  return;
939  }
940  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
941  }//GEN-LAST:event_memFieldKeyReleased
942 
943  private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useGMTTimeRBActionPerformed
944  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
945  }//GEN-LAST:event_useGMTTimeRBActionPerformed
946 
947  private void useLocalTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useLocalTimeRBActionPerformed
948  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
949  }//GEN-LAST:event_useLocalTimeRBActionPerformed
950 
951  private void viewsHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideSlackCBActionPerformed
952  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
953  }//GEN-LAST:event_viewsHideSlackCBActionPerformed
954 
955  private void dataSourcesHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCBActionPerformed
956  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
957  }//GEN-LAST:event_dataSourcesHideSlackCBActionPerformed
958 
959  private void viewsHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewsHideKnownCBActionPerformed
960  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
961  }//GEN-LAST:event_viewsHideKnownCBActionPerformed
962 
963  private void dataSourcesHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideKnownCBActionPerformed
964  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
965  }//GEN-LAST:event_dataSourcesHideKnownCBActionPerformed
966 
967  private void keepCurrentViewerRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keepCurrentViewerRBActionPerformed
968  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
969  }//GEN-LAST:event_keepCurrentViewerRBActionPerformed
970 
971  private void useBestViewerRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRBActionPerformed
972  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
973  }//GEN-LAST:event_useBestViewerRBActionPerformed
974 
975  private void specifyLogoRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_specifyLogoRBActionPerformed
976  agencyLogoPathField.setEnabled(true);
977  browseLogosButton.setEnabled(true);
978  try {
979  if (agencyLogoPathField.getText().isEmpty()) {
980  String path = ModuleSettings.getConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP);
981  if (path != null && !path.isEmpty()) {
982  updateAgencyLogo(path);
983  }
984  }
985  } catch (IOException ex) {
986  LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path.", ex);
987  }
988  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
989  }//GEN-LAST:event_specifyLogoRBActionPerformed
990 
991  private void defaultLogoRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_defaultLogoRBActionPerformed
992  agencyLogoPathField.setEnabled(false);
993  browseLogosButton.setEnabled(false);
994  try {
995  updateAgencyLogo("");
996  } catch (IOException ex) {
997  // This should never happen since we're not reading from a file.
998  LOGGER.log(Level.SEVERE, "Unexpected error occurred while updating the agency logo.", ex);
999  }
1000  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1001  }//GEN-LAST:event_defaultLogoRBActionPerformed
1002 
1003  private void browseLogosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLogosButtonActionPerformed
1004  String oldLogoPath = agencyLogoPathField.getText();
1005  int returnState = fileChooser.showOpenDialog(this);
1006  if (returnState == JFileChooser.APPROVE_OPTION) {
1007  String path = fileChooser.getSelectedFile().getPath();
1008  try {
1009  updateAgencyLogo(path);
1010  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1011  } catch (IOException | IndexOutOfBoundsException ex) {
1012  JOptionPane.showMessageDialog(null,
1013  NbBundle.getMessage(this.getClass(),
1014  "AutopsyOptionsPanel.invalidImageFile.msg"),
1015  NbBundle.getMessage(this.getClass(), "AutopsyOptionsPanel.invalidImageFile.title"),
1016  JOptionPane.ERROR_MESSAGE);
1017  try {
1018  updateAgencyLogo(oldLogoPath); //restore previous setting if new one is invalid
1019  } catch (IOException ex1) {
1020  LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex1);
1021  }
1022  }
1023  }
1024  }//GEN-LAST:event_browseLogosButtonActionPerformed
1025 
1026  // Variables declaration - do not modify//GEN-BEGIN:variables
1027  private javax.swing.JTextField agencyLogoPathField;
1028  private javax.swing.JLabel agencyLogoPathFieldValidationLabel;
1029  private javax.swing.JLabel agencyLogoPreview;
1030  private javax.swing.JButton browseLogosButton;
1031  private javax.swing.JCheckBox dataSourcesHideKnownCB;
1032  private javax.swing.JCheckBox dataSourcesHideSlackCB;
1033  private javax.swing.JRadioButton defaultLogoRB;
1034  private javax.swing.ButtonGroup displayTimesButtonGroup;
1035  private javax.swing.ButtonGroup fileSelectionButtonGroup;
1036  private javax.swing.JLabel jLabelHideKnownFiles;
1037  private javax.swing.JLabel jLabelHideSlackFiles;
1038  private javax.swing.JLabel jLabelSelectFile;
1039  private javax.swing.JLabel jLabelTimeDisplay;
1040  private javax.swing.JPanel jPanel1;
1041  private javax.swing.JScrollPane jScrollPane1;
1042  private javax.swing.JRadioButton keepCurrentViewerRB;
1043  private javax.swing.JTextField logFileCount;
1044  private javax.swing.JTextField logNumAlert;
1045  private javax.swing.JPanel logoPanel;
1046  private javax.swing.ButtonGroup logoSourceButtonGroup;
1047  private javax.swing.JLabel maxLogFileCount;
1048  private javax.swing.JLabel maxMemoryLabel;
1049  private javax.swing.JLabel maxMemoryUnitsLabel;
1050  private javax.swing.JLabel maxMemoryUnitsLabel1;
1051  private javax.swing.JTextField memField;
1052  private javax.swing.JLabel memFieldValidationLabel;
1053  private javax.swing.JLabel restartNecessaryWarning;
1054  private javax.swing.JPanel runtimePanel;
1055  private javax.swing.JRadioButton specifyLogoRB;
1056  private javax.swing.JLabel systemMemoryTotal;
1057  private javax.swing.JLabel totalMemoryLabel;
1058  private javax.swing.JRadioButton useBestViewerRB;
1059  private javax.swing.JRadioButton useGMTTimeRB;
1060  private javax.swing.JRadioButton useLocalTimeRB;
1061  private javax.swing.JPanel viewPanel;
1062  private javax.swing.JCheckBox viewsHideKnownCB;
1063  private javax.swing.JCheckBox viewsHideSlackCB;
1064  // End of variables declaration//GEN-END:variables
1065 
1066 }

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