Autopsy  4.6.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({
54  "AutopsyOptionsPanel.invalidImageFile.msg=The selected file was not able to be used as an agency logo.",
55  "AutopsyOptionsPanel.invalidImageFile.title=Invalid Image File",
56  "AutopsyOptionsPanel.memFieldValidationLabel.not64BitInstall.text=JVM memory settings only enabled for 64 bit version",
57  "AutopsyOptionsPanel.memFieldValidationLabel.noValueEntered.text=No value entered",
58  "AutopsyOptionsPanel.memFieldValidationLabel.invalidCharacters.text=Invalid characters, value must be a positive integer",
59  "# {0} - minimumMemory",
60  "AutopsyOptionsPanel.memFieldValidationLabel.underMinMemory.text=Value must be at least {0}GB",
61  "# {0} - systemMemory",
62  "AutopsyOptionsPanel.memFieldValidationLabel.overMaxMemory.text=Value must be less than the total system memory of {0}GB",
63  "AutopsyOptionsPanel.memFieldValidationLabel.developerMode.text=Memory settings are not available while running in developer mode",
64  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidPath.text=Path is not valid.",
65  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidImageSpecified.text=Invalid image file specified.",
66  "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.pathNotSet.text=Agency logo path must be set.",
67  "AutopsyOptionsPanel.logNumAlert.invalidInput.text=A positive integer is required here."
68 })
69 
70 final class AutopsyOptionsPanel extends javax.swing.JPanel {
71 
72  private static final long serialVersionUID = 1L;
73  private final JFileChooser fileChooser;
74  private final TextFieldListener textFieldListener;
75  private static final String ETC_FOLDER_NAME = "etc";
76  private static final String CONFIG_FILE_EXTENSION = ".conf";
77  private static final long ONE_BILLION = 1000000000L; //used to roughly convert system memory from bytes to gigabytes
78  private static final long MEGA_IN_GIGA = 1024; //used to convert memory settings saved as megabytes to gigabytes
79  private static final int MIN_MEMORY_IN_GB = 2; //the enforced minimum memory in gigabytes
80  private static final Logger logger = Logger.getLogger(AutopsyOptionsPanel.class.getName());
81  private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
82 
86  AutopsyOptionsPanel() {
87  initComponents();
88  fileChooser = new JFileChooser();
89  fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
90  fileChooser.setMultiSelectionEnabled(false);
91  fileChooser.setAcceptAllFileFilterUsed(false);
92  fileChooser.setFileFilter(new GeneralFilter(GeneralFilter.GRAPHIC_IMAGE_EXTS, GeneralFilter.GRAPHIC_IMG_DECR));
93  if (!PlatformUtil.is64BitJVM() || Version.getBuildType() == Version.Type.DEVELOPMENT) {
94  //32 bit JVM has a max heap size of 1.4 gb to 4 gb depending on OS
95  //So disabling the setting of heap size when the JVM is not 64 bit
96  //Is the safest course of action
97  //And the file won't exist in the install folder when running through netbeans
98  memField.setEnabled(false);
99  }
100  systemMemoryTotal.setText(Long.toString(getSystemMemoryInGB()));
101 
102  textFieldListener = new TextFieldListener();
103  agencyLogoPathField.getDocument().addDocumentListener(textFieldListener);
104  logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
105  }
106 
113  private long getSystemMemoryInGB() {
114  long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
115  .getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
116  return memorySize / ONE_BILLION;
117  }
118 
124  private long getCurrentJvmMaxMemoryInGB() throws IOException {
125  String currentXmx = getCurrentXmxValue();
126  char units = '-';
127  Long value = 0L;
128  if (currentXmx.length() > 1) {
129  units = currentXmx.charAt(currentXmx.length() - 1);
130  value = Long.parseLong(currentXmx.substring(0, currentXmx.length() - 1));
131  } else {
132  throw new IOException("No memory setting found in String: " + currentXmx);
133  }
134  //some older .conf files might have the units as megabytes instead of gigabytes
135  switch (units) {
136  case 'g':
137  case 'G':
138  return value;
139  case 'm':
140  case 'M':
141  return value / MEGA_IN_GIGA;
142  default:
143  throw new IOException("Units were not recognized as parsed: " + units);
144  }
145  }
146 
147  /*
148  * The value currently saved in the conf file as the max java heap space
149  * available to this application. Form will be an integer followed by a
150  * character indicating units. Helper method for
151  * getCurrentJvmMaxMemoryInGB()
152  *
153  * @return the saved value for the max java heap space
154  *
155  * @throws IOException if the conf file does not exist in either the user
156  * directory or the install directory
157  */
158  private String getCurrentXmxValue() throws IOException {
159  String[] settings;
160  String currentSetting = "";
161  File userConfFile = getUserFolderConfFile();
162  if (!userConfFile.exists()) {
163  settings = getDefaultsFromFileContents(readConfFile(getInstallFolderConfFile()));
164  } else {
165  settings = getDefaultsFromFileContents(readConfFile(userConfFile));
166  }
167  for (String option : settings) {
168  if (option.startsWith("-J-Xmx")) {
169  currentSetting = option.replace("-J-Xmx", "").trim();
170  }
171  }
172  return currentSetting;
173  }
174 
183  private static File getInstallFolderConfFile() throws IOException {
184  String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
185  String installFolder = PlatformUtil.getInstallPath();
186  File installFolderEtc = new File(installFolder, ETC_FOLDER_NAME);
187  File installFolderConfigFile = new File(installFolderEtc, confFileName);
188  if (!installFolderConfigFile.exists()) {
189  throw new IOException("Conf file could not be found" + installFolderConfigFile.toString());
190  }
191  return installFolderConfigFile;
192  }
193 
201  private static File getUserFolderConfFile() {
202  String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
203  File userFolder = PlatformUtil.getUserDirectory();
204  File userEtcFolder = new File(userFolder, ETC_FOLDER_NAME);
205  if (!userEtcFolder.exists()) {
206  userEtcFolder.mkdir();
207  }
208  return new File(userEtcFolder, confFileName);
209  }
210 
219  private void writeEtcConfFile() throws IOException {
220  StringBuilder content = new StringBuilder();
221  List<String> confFile = readConfFile(getInstallFolderConfFile());
222  for (String line : confFile) {
223  if (line.contains("-J-Xmx")) {
224  String[] splitLine = line.split(" ");
225  StringJoiner modifiedLine = new StringJoiner(" ");
226  for (String piece : splitLine) {
227  if (piece.contains("-J-Xmx")) {
228  piece = "-J-Xmx" + memField.getText() + "g";
229  }
230  modifiedLine.add(piece);
231  }
232  content.append(modifiedLine.toString());
233  } else {
234  content.append(line);
235  }
236  content.append("\n");
237  }
238  Files.write(getUserFolderConfFile().toPath(), content.toString().getBytes());
239  }
240 
250  private static List<String> readConfFile(File configFile) {
251  List<String> lines = new ArrayList<>();
252  if (null != configFile) {
253  Path filePath = configFile.toPath();
254  Charset charset = Charset.forName("UTF-8");
255  try {
256  lines = Files.readAllLines(filePath, charset);
257  } catch (IOException e) {
258  logger.log(Level.SEVERE, "Error reading config file contents. {}", configFile.getAbsolutePath());
259  }
260  }
261  return lines;
262  }
263 
275  private static String[] getDefaultsFromFileContents(List<String> list) {
276  Optional<String> defaultSettings = list.stream().filter(line -> line.startsWith("default_options=")).findFirst();
277 
278  if (defaultSettings.isPresent()) {
279  return defaultSettings.get().replace("default_options=", "").replaceAll("\"", "").split(" ");
280  }
281  return new String[]{};
282  }
283 
287  void load() {
288  boolean keepPreferredViewer = UserPreferences.keepPreferredContentViewer();
289  keepCurrentViewerRB.setSelected(keepPreferredViewer);
290  useBestViewerRB.setSelected(!keepPreferredViewer);
291  dataSourcesHideKnownCB.setSelected(UserPreferences.hideKnownFilesInDataSourcesTree());
292  viewsHideKnownCB.setSelected(UserPreferences.hideKnownFilesInViewsTree());
293  dataSourcesHideSlackCB.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
294  viewsHideSlackCB.setSelected(UserPreferences.hideSlackFilesInViewsTree());
295  boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
296  useLocalTimeRB.setSelected(useLocalTime);
297  useGMTTimeRB.setSelected(!useLocalTime);
298  String path = ModuleSettings.getConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP);
299  boolean useDefault = (path == null || path.isEmpty());
300  defaultLogoRB.setSelected(useDefault);
301  specifyLogoRB.setSelected(!useDefault);
302  agencyLogoPathField.setEnabled(!useDefault);
303  browseLogosButton.setEnabled(!useDefault);
304  logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
305  try {
306  updateAgencyLogo(path);
307  } catch (IOException ex) {
308  logger.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex);
309  }
310  if (memField.isEnabled()) {
311  try {
312  initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB());
313  } catch (IOException ex) {
314  logger.log(Level.SEVERE, "Can't read current Jvm max memory setting from file", ex);
315  memField.setEnabled(false);
316  }
317  memField.setText(initialMemValue);
318  }
319 
320  valid(); //ensure the error messages are up to date
321  }
322 
330  private void updateAgencyLogo(String path) throws IOException {
331  agencyLogoPathField.setText(path);
332  ImageIcon agencyLogoIcon = new ImageIcon();
333  agencyLogoPreview.setText(NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPreview.text"));
334  if (!agencyLogoPathField.getText().isEmpty()) {
335  File file = new File(agencyLogoPathField.getText());
336  if (file.exists()) {
337  BufferedImage image = ImageIO.read(file); //create it as an image first to support BMP files
338  if (image == null) {
339  throw new IOException("Unable to read file as a BufferedImage for file " + file.toString());
340  }
341  agencyLogoIcon = new ImageIcon(image.getScaledInstance(64, 64, 4));
342  agencyLogoPreview.setText("");
343  }
344  }
345  agencyLogoPreview.setIcon(agencyLogoIcon);
346  agencyLogoPreview.repaint();
347  }
348 
352  void store() {
353  UserPreferences.setKeepPreferredContentViewer(keepCurrentViewerRB.isSelected());
354  UserPreferences.setHideKnownFilesInDataSourcesTree(dataSourcesHideKnownCB.isSelected());
355  UserPreferences.setHideKnownFilesInViewsTree(viewsHideKnownCB.isSelected());
356  UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCB.isSelected());
357  UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCB.isSelected());
358  UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRB.isSelected());
359  UserPreferences.setLogFileCount(Integer.parseInt(logFileCount.getText()));
360  if (!agencyLogoPathField.getText().isEmpty()) {
361  File file = new File(agencyLogoPathField.getText());
362  if (file.exists()) {
363  ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP, agencyLogoPathField.getText());
364  }
365  } else {
366  ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP, "");
367  }
368  if (memField.isEnabled()) { //if the field could of been changed we need to try and save it
369  try {
370  writeEtcConfFile();
371  } catch (IOException ex) {
372  logger.log(Level.WARNING, "Unable to save config file to " + PlatformUtil.getUserDirectory() + "\\" + ETC_FOLDER_NAME, ex);
373  }
374  }
375  }
376 
382  boolean valid() {
383  boolean valid = true;
384 
385  if (!isAgencyLogoPathValid()) {
386  valid = false;
387  }
388  if (!isMemFieldValid()) {
389  valid = false;
390  }
391  if (!isLogNumFieldValid()) {
392  valid = false;
393  }
394 
395  return valid;
396  }
397 
404  boolean isAgencyLogoPathValid() {
405  boolean valid = true;
406 
407  if (defaultLogoRB.isSelected()) {
408  agencyLogoPathFieldValidationLabel.setText("");
409  } else {
410  String agencyLogoPath = agencyLogoPathField.getText();
411  if (agencyLogoPath.isEmpty()) {
412  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_pathNotSet_text());
413  valid = false;
414  } else {
415  File file = new File(agencyLogoPathField.getText());
416  if (file.exists() && file.isFile()) {
417  BufferedImage image;
418  try { //ensure the image can be read
419  image = ImageIO.read(file); //create it as an image first to support BMP files
420  if (image == null) {
421  throw new IOException("Unable to read file as a BufferedImage for file " + file.toString());
422  }
423  agencyLogoPathFieldValidationLabel.setText("");
424  } catch (IOException | IndexOutOfBoundsException ignored) {
425  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidImageSpecified_text());
426  valid = false;
427  }
428  } else {
429  agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidPath_text());
430  valid = false;
431  }
432  }
433  }
434 
435  return valid;
436  }
437 
443  private boolean isMemFieldValid() {
444  String memText = memField.getText();
445  memFieldValidationLabel.setText("");
446  if (!PlatformUtil.is64BitJVM()) {
447  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_not64BitInstall_text());
448  //the panel should be valid when it is a 32 bit jvm because the memfield will be disabled.
449  return true;
450  }
451  if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
452  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_developerMode_text());
453  //the panel should be valid when you are running in developer mode because the memfield will be disabled
454  return true;
455  }
456  if (memText.length() == 0) {
457  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_noValueEntered_text());
458  return false;
459  }
460  if (memText.replaceAll("[^\\d]", "").length() != memText.length()) {
461  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_invalidCharacters_text());
462  return false;
463  }
464  int parsedInt = Integer.parseInt(memText);
465  if (parsedInt < MIN_MEMORY_IN_GB) {
466  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_underMinMemory_text(MIN_MEMORY_IN_GB));
467  return false;
468  }
469  if (parsedInt > getSystemMemoryInGB()) {
470  memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_overMaxMemory_text(getSystemMemoryInGB()));
471  return false;
472  }
473  return true;
474  }
475 
481  private boolean isLogNumFieldValid() {
482  String count = logFileCount.getText();
483  logNumAlert.setText("");
484  try {
485  int count_num = Integer.parseInt(count);
486  if (count_num < 1) {
487  logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
488  return false;
489  }
490  } catch (NumberFormatException e) {
491  logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
492  return false;
493  }
494  return true;
495  }
500  private class TextFieldListener implements DocumentListener {
501 
502  @Override
503  public void insertUpdate(DocumentEvent e) {
504  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
505  }
506 
507  @Override
508  public void removeUpdate(DocumentEvent e) {
509  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
510  }
511 
512  @Override
513  public void changedUpdate(DocumentEvent e) {
514  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
515  }
516  }
517 
523  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
524  private void initComponents() {
525 
526  fileSelectionButtonGroup = new javax.swing.ButtonGroup();
527  displayTimesButtonGroup = new javax.swing.ButtonGroup();
528  logoSourceButtonGroup = new javax.swing.ButtonGroup();
529  jScrollPane1 = new javax.swing.JScrollPane();
530  jPanel1 = new javax.swing.JPanel();
531  logoPanel = new javax.swing.JPanel();
532  agencyLogoPathField = new javax.swing.JTextField();
533  browseLogosButton = new javax.swing.JButton();
534  agencyLogoPreview = new javax.swing.JLabel();
535  defaultLogoRB = new javax.swing.JRadioButton();
536  specifyLogoRB = new javax.swing.JRadioButton();
537  agencyLogoPathFieldValidationLabel = new javax.swing.JLabel();
538  viewPanel = new javax.swing.JPanel();
539  jLabelSelectFile = new javax.swing.JLabel();
540  useBestViewerRB = new javax.swing.JRadioButton();
541  keepCurrentViewerRB = new javax.swing.JRadioButton();
542  jLabelHideKnownFiles = new javax.swing.JLabel();
543  dataSourcesHideKnownCB = new javax.swing.JCheckBox();
544  viewsHideKnownCB = new javax.swing.JCheckBox();
545  jLabelHideSlackFiles = new javax.swing.JLabel();
546  dataSourcesHideSlackCB = new javax.swing.JCheckBox();
547  viewsHideSlackCB = new javax.swing.JCheckBox();
548  jLabelTimeDisplay = new javax.swing.JLabel();
549  useLocalTimeRB = new javax.swing.JRadioButton();
550  useGMTTimeRB = new javax.swing.JRadioButton();
551  runtimePanel = new javax.swing.JPanel();
552  maxMemoryLabel = new javax.swing.JLabel();
553  maxMemoryUnitsLabel = new javax.swing.JLabel();
554  totalMemoryLabel = new javax.swing.JLabel();
555  systemMemoryTotal = new javax.swing.JLabel();
556  restartNecessaryWarning = new javax.swing.JLabel();
557  memField = new javax.swing.JTextField();
558  memFieldValidationLabel = new javax.swing.JLabel();
559  maxMemoryUnitsLabel1 = new javax.swing.JLabel();
560  maxLogFileCount = new javax.swing.JLabel();
561  logFileCount = new javax.swing.JTextField();
562  logNumAlert = new javax.swing.JTextField();
563 
564  setPreferredSize(new java.awt.Dimension(1022, 488));
565 
566  jScrollPane1.setBorder(null);
567  jScrollPane1.setPreferredSize(new java.awt.Dimension(1022, 407));
568 
569  jPanel1.setPreferredSize(new java.awt.Dimension(1022, 407));
570 
571  logoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.logoPanel.border.title"))); // NOI18N
572  logoPanel.setPreferredSize(new java.awt.Dimension(533, 87));
573 
574  agencyLogoPathField.setText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPathField.text")); // NOI18N
575 
576  org.openide.awt.Mnemonics.setLocalizedText(browseLogosButton, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.browseLogosButton.text")); // NOI18N
577  browseLogosButton.addActionListener(new java.awt.event.ActionListener() {
578  public void actionPerformed(java.awt.event.ActionEvent evt) {
579  browseLogosButtonActionPerformed(evt);
580  }
581  });
582 
583  agencyLogoPreview.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
584  org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPreview, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPreview.text")); // NOI18N
585  agencyLogoPreview.setBorder(javax.swing.BorderFactory.createEtchedBorder());
586  agencyLogoPreview.setMaximumSize(new java.awt.Dimension(64, 64));
587  agencyLogoPreview.setMinimumSize(new java.awt.Dimension(64, 64));
588  agencyLogoPreview.setPreferredSize(new java.awt.Dimension(64, 64));
589 
590  logoSourceButtonGroup.add(defaultLogoRB);
591  org.openide.awt.Mnemonics.setLocalizedText(defaultLogoRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.defaultLogoRB.text")); // NOI18N
592  defaultLogoRB.addActionListener(new java.awt.event.ActionListener() {
593  public void actionPerformed(java.awt.event.ActionEvent evt) {
594  defaultLogoRBActionPerformed(evt);
595  }
596  });
597 
598  logoSourceButtonGroup.add(specifyLogoRB);
599  org.openide.awt.Mnemonics.setLocalizedText(specifyLogoRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.specifyLogoRB.text")); // NOI18N
600  specifyLogoRB.addActionListener(new java.awt.event.ActionListener() {
601  public void actionPerformed(java.awt.event.ActionEvent evt) {
602  specifyLogoRBActionPerformed(evt);
603  }
604  });
605 
606  agencyLogoPathFieldValidationLabel.setForeground(new java.awt.Color(255, 0, 0));
607  org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPathFieldValidationLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.text")); // NOI18N
608 
609  javax.swing.GroupLayout logoPanelLayout = new javax.swing.GroupLayout(logoPanel);
610  logoPanel.setLayout(logoPanelLayout);
611  logoPanelLayout.setHorizontalGroup(
612  logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
613  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
614  .addContainerGap()
615  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
616  .addComponent(specifyLogoRB)
617  .addComponent(defaultLogoRB))
618  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
619  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
620  .addGroup(logoPanelLayout.createSequentialGroup()
621  .addComponent(agencyLogoPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
622  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
623  .addComponent(browseLogosButton))
624  .addComponent(agencyLogoPathFieldValidationLabel))
625  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
626  .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
627  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
628  );
629  logoPanelLayout.setVerticalGroup(
630  logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
631  .addGroup(logoPanelLayout.createSequentialGroup()
632  .addGap(6, 6, 6)
633  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
634  .addComponent(defaultLogoRB)
635  .addComponent(agencyLogoPathFieldValidationLabel))
636  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
637  .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
638  .addComponent(specifyLogoRB)
639  .addComponent(agencyLogoPathField)
640  .addComponent(browseLogosButton)))
641  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
642  .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
643  .addGap(0, 0, Short.MAX_VALUE))
644  );
645 
646  viewPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewPanel.border.title"))); // NOI18N
647 
648  org.openide.awt.Mnemonics.setLocalizedText(jLabelSelectFile, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelSelectFile.text")); // NOI18N
649 
650  fileSelectionButtonGroup.add(useBestViewerRB);
651  org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.text")); // NOI18N
652  useBestViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useBestViewerRB.toolTipText")); // NOI18N
653  useBestViewerRB.addActionListener(new java.awt.event.ActionListener() {
654  public void actionPerformed(java.awt.event.ActionEvent evt) {
655  useBestViewerRBActionPerformed(evt);
656  }
657  });
658 
659  fileSelectionButtonGroup.add(keepCurrentViewerRB);
660  org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.text")); // NOI18N
661  keepCurrentViewerRB.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText")); // NOI18N
662  keepCurrentViewerRB.addActionListener(new java.awt.event.ActionListener() {
663  public void actionPerformed(java.awt.event.ActionEvent evt) {
664  keepCurrentViewerRBActionPerformed(evt);
665  }
666  });
667 
668  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideKnownFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideKnownFiles.text")); // NOI18N
669 
670  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideKnownCB.text")); // NOI18N
671  dataSourcesHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
672  public void actionPerformed(java.awt.event.ActionEvent evt) {
673  dataSourcesHideKnownCBActionPerformed(evt);
674  }
675  });
676 
677  org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideKnownCB.text")); // NOI18N
678  viewsHideKnownCB.addActionListener(new java.awt.event.ActionListener() {
679  public void actionPerformed(java.awt.event.ActionEvent evt) {
680  viewsHideKnownCBActionPerformed(evt);
681  }
682  });
683 
684  org.openide.awt.Mnemonics.setLocalizedText(jLabelHideSlackFiles, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelHideSlackFiles.text")); // NOI18N
685 
686  org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideSlackCB.text")); // NOI18N
687  dataSourcesHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
688  public void actionPerformed(java.awt.event.ActionEvent evt) {
689  dataSourcesHideSlackCBActionPerformed(evt);
690  }
691  });
692 
693  org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.viewsHideSlackCB.text")); // NOI18N
694  viewsHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
695  public void actionPerformed(java.awt.event.ActionEvent evt) {
696  viewsHideSlackCBActionPerformed(evt);
697  }
698  });
699 
700  org.openide.awt.Mnemonics.setLocalizedText(jLabelTimeDisplay, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelTimeDisplay.text")); // NOI18N
701 
702  displayTimesButtonGroup.add(useLocalTimeRB);
703  org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useLocalTimeRB.text")); // NOI18N
704  useLocalTimeRB.addActionListener(new java.awt.event.ActionListener() {
705  public void actionPerformed(java.awt.event.ActionEvent evt) {
706  useLocalTimeRBActionPerformed(evt);
707  }
708  });
709 
710  displayTimesButtonGroup.add(useGMTTimeRB);
711  org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.useGMTTimeRB.text")); // NOI18N
712  useGMTTimeRB.addActionListener(new java.awt.event.ActionListener() {
713  public void actionPerformed(java.awt.event.ActionEvent evt) {
714  useGMTTimeRBActionPerformed(evt);
715  }
716  });
717 
718  javax.swing.GroupLayout viewPanelLayout = new javax.swing.GroupLayout(viewPanel);
719  viewPanel.setLayout(viewPanelLayout);
720  viewPanelLayout.setHorizontalGroup(
721  viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
722  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPanelLayout.createSequentialGroup()
723  .addContainerGap()
724  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
725  .addGroup(viewPanelLayout.createSequentialGroup()
726  .addGap(10, 10, 10)
727  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
728  .addGroup(viewPanelLayout.createSequentialGroup()
729  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
730  .addComponent(useGMTTimeRB)
731  .addComponent(keepCurrentViewerRB)
732  .addComponent(useBestViewerRB)
733  .addComponent(dataSourcesHideKnownCB)
734  .addComponent(viewsHideKnownCB))
735  .addGap(0, 0, Short.MAX_VALUE))
736  .addGroup(viewPanelLayout.createSequentialGroup()
737  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
738  .addComponent(dataSourcesHideSlackCB)
739  .addComponent(viewsHideSlackCB)
740  .addComponent(useLocalTimeRB))
741  .addContainerGap(158, Short.MAX_VALUE))))
742  .addGroup(viewPanelLayout.createSequentialGroup()
743  .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
744  .addComponent(jLabelHideSlackFiles)
745  .addComponent(jLabelTimeDisplay)
746  .addComponent(jLabelHideKnownFiles)
747  .addComponent(jLabelSelectFile))
748  .addGap(30, 30, 30))))
749  );
750  viewPanelLayout.setVerticalGroup(
751  viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
752  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPanelLayout.createSequentialGroup()
753  .addContainerGap()
754  .addComponent(jLabelSelectFile)
755  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
756  .addComponent(useBestViewerRB)
757  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
758  .addComponent(keepCurrentViewerRB)
759  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
760  .addComponent(jLabelHideKnownFiles)
761  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
762  .addComponent(dataSourcesHideKnownCB)
763  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
764  .addComponent(viewsHideKnownCB)
765  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
766  .addComponent(jLabelHideSlackFiles)
767  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
768  .addComponent(dataSourcesHideSlackCB)
769  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
770  .addComponent(viewsHideSlackCB)
771  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
772  .addComponent(jLabelTimeDisplay)
773  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
774  .addComponent(useLocalTimeRB)
775  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
776  .addComponent(useGMTTimeRB))
777  );
778 
779  runtimePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.runtimePanel.border.title"))); // NOI18N
780 
781  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryLabel.text")); // NOI18N
782 
783  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryUnitsLabel.text")); // NOI18N
784 
785  org.openide.awt.Mnemonics.setLocalizedText(totalMemoryLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.totalMemoryLabel.text")); // NOI18N
786 
787  systemMemoryTotal.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
788 
789  restartNecessaryWarning.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/warning16.png"))); // NOI18N
790  org.openide.awt.Mnemonics.setLocalizedText(restartNecessaryWarning, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.restartNecessaryWarning.text")); // NOI18N
791 
792  memField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
793  memField.addKeyListener(new java.awt.event.KeyAdapter() {
794  public void keyReleased(java.awt.event.KeyEvent evt) {
795  memFieldKeyReleased(evt);
796  }
797  });
798 
799  memFieldValidationLabel.setForeground(new java.awt.Color(255, 0, 0));
800 
801  org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel1, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxMemoryUnitsLabel.text")); // NOI18N
802 
803  org.openide.awt.Mnemonics.setLocalizedText(maxLogFileCount, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.maxLogFileCount.text")); // NOI18N
804 
805  logFileCount.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
806  logFileCount.addKeyListener(new java.awt.event.KeyAdapter() {
807  public void keyReleased(java.awt.event.KeyEvent evt) {
808  logFileCountKeyReleased(evt);
809  }
810  });
811 
812  logNumAlert.setEditable(false);
813  logNumAlert.setFont(logNumAlert.getFont().deriveFont(logNumAlert.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
814  logNumAlert.setForeground(new java.awt.Color(255, 0, 0));
815  logNumAlert.setText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.logNumAlert.text")); // NOI18N
816  logNumAlert.setBorder(null);
817 
818  javax.swing.GroupLayout runtimePanelLayout = new javax.swing.GroupLayout(runtimePanel);
819  runtimePanel.setLayout(runtimePanelLayout);
820  runtimePanelLayout.setHorizontalGroup(
821  runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
822  .addGroup(runtimePanelLayout.createSequentialGroup()
823  .addContainerGap()
824  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
825  .addGroup(runtimePanelLayout.createSequentialGroup()
826  .addComponent(totalMemoryLabel)
827  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
828  .addComponent(systemMemoryTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
829  .addGap(6, 6, 6)
830  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
831  .addGroup(runtimePanelLayout.createSequentialGroup()
832  .addComponent(maxMemoryUnitsLabel1)
833  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
834  .addComponent(restartNecessaryWarning, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
835  .addGroup(runtimePanelLayout.createSequentialGroup()
836  .addComponent(maxMemoryUnitsLabel)
837  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
838  .addComponent(memFieldValidationLabel)
839  .addGap(0, 0, Short.MAX_VALUE))))
840  .addGroup(runtimePanelLayout.createSequentialGroup()
841  .addComponent(maxMemoryLabel)
842  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
843  .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
844  .addGap(0, 0, Short.MAX_VALUE))
845  .addGroup(runtimePanelLayout.createSequentialGroup()
846  .addComponent(maxLogFileCount)
847  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
848  .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
849  .addGap(18, 18, 18)
850  .addComponent(logNumAlert)))
851  .addContainerGap())
852  );
853 
854  runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {maxLogFileCount, maxMemoryLabel, totalMemoryLabel});
855 
856  runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {logFileCount, memField});
857 
858  runtimePanelLayout.setVerticalGroup(
859  runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
860  .addGroup(runtimePanelLayout.createSequentialGroup()
861  .addContainerGap()
862  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
863  .addComponent(totalMemoryLabel)
864  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
865  .addComponent(restartNecessaryWarning)
866  .addComponent(maxMemoryUnitsLabel1))
867  .addComponent(systemMemoryTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
868  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
869  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
870  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
871  .addComponent(maxMemoryLabel)
872  .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
873  .addComponent(maxMemoryUnitsLabel))
874  .addComponent(memFieldValidationLabel))
875  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
876  .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
877  .addComponent(maxLogFileCount)
878  .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
879  .addComponent(logNumAlert, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
880  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
881  );
882 
883  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
884  jPanel1.setLayout(jPanel1Layout);
885  jPanel1Layout.setHorizontalGroup(
886  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
887  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
888  .addContainerGap()
889  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
890  .addComponent(logoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1010, Short.MAX_VALUE)
891  .addGroup(jPanel1Layout.createSequentialGroup()
892  .addComponent(viewPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
893  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
894  .addComponent(runtimePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
895  .addContainerGap())
896  );
897  jPanel1Layout.setVerticalGroup(
898  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
899  .addGroup(jPanel1Layout.createSequentialGroup()
900  .addGap(0, 0, 0)
901  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
902  .addComponent(viewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
903  .addComponent(runtimePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
904  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
905  .addComponent(logoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
906  .addContainerGap())
907  );
908 
909  jScrollPane1.setViewportView(jPanel1);
910 
911  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
912  this.setLayout(layout);
913  layout.setHorizontalGroup(
914  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
915  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
916  );
917  layout.setVerticalGroup(
918  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
919  .addGroup(layout.createSequentialGroup()
920  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 479, Short.MAX_VALUE)
921  .addGap(0, 0, Short.MAX_VALUE))
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(this,
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: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.