19 package org.sleuthkit.autopsy.corecomponents;
21 import java.awt.image.BufferedImage;
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;
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."
81 final class AutopsyOptionsPanel extends javax.swing.JPanel {
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;
89 private static final long MEGA_IN_GIGA = 1024;
90 private static final int MIN_MEMORY_IN_GB = 2;
91 private static final Logger LOGGER = Logger.getLogger(AutopsyOptionsPanel.class.getName());
92 private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
97 AutopsyOptionsPanel() {
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) {
109 memField.setEnabled(
false);
111 systemMemoryTotal.setText(Long.toString(getSystemMemoryInGB()));
113 textFieldListener =
new TextFieldListener();
114 agencyLogoPathField.getDocument().addDocumentListener(textFieldListener);
115 logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
124 private long getSystemMemoryInGB() {
125 long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
126 .getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
127 return memorySize / ONE_BILLION;
135 private long getCurrentJvmMaxMemoryInGB() throws IOException {
136 String currentXmx = getCurrentXmxValue();
139 if (currentXmx.length() > 1) {
140 units = currentXmx.charAt(currentXmx.length() - 1);
141 value = Long.parseLong(currentXmx.substring(0, currentXmx.length() - 1));
143 throw new IOException(
"No memory setting found in String: " + currentXmx);
152 return value / MEGA_IN_GIGA;
154 throw new IOException(
"Units were not recognized as parsed: " + units);
169 private String getCurrentXmxValue() throws IOException {
171 String currentSetting =
"";
172 File userConfFile = getUserFolderConfFile();
173 if (!userConfFile.exists()) {
174 settings = getDefaultsFromFileContents(readConfFile(getInstallFolderConfFile()));
176 settings = getDefaultsFromFileContents(readConfFile(userConfFile));
178 for (String option : settings) {
179 if (option.startsWith(
"-J-Xmx")) {
180 currentSetting = option.replace(
"-J-Xmx",
"").trim();
183 return currentSetting;
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());
202 return installFolderConfigFile;
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();
219 return new File(userEtcFolder, confFileName);
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";
241 modifiedLine.add(piece);
243 content.append(modifiedLine.toString());
245 content.append(line);
247 content.append(
"\n");
249 Files.write(getUserFolderConfFile().toPath(), content.toString().getBytes());
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");
267 lines = Files.readAllLines(filePath, charset);
268 }
catch (IOException e) {
269 LOGGER.log(Level.SEVERE,
"Error reading config file contents. {}", configFile.getAbsolutePath());
286 private static String[] getDefaultsFromFileContents(List<String> list) {
287 Optional<String> defaultSettings = list.stream().filter(line -> line.startsWith(
"default_options=")).findFirst();
289 if (defaultSettings.isPresent()) {
290 return defaultSettings.get().replace(
"default_options=",
"").replaceAll(
"\"",
"").split(
" ");
292 return new String[]{};
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()));
317 updateAgencyLogo(path);
318 }
catch (IOException ex) {
319 LOGGER.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex);
321 if (memField.isEnabled()) {
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);
328 memField.setText(initialMemValue);
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());
348 BufferedImage image = ImageIO.read(file);
350 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
352 agencyLogoIcon =
new ImageIcon(image.getScaledInstance(64, 64, 4));
353 agencyLogoPreview.setText(
"");
356 agencyLogoPreview.setIcon(agencyLogoIcon);
357 agencyLogoPreview.repaint();
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());
374 ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP, agencyLogoPathField.getText());
377 ModuleSettings.setConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP,
"");
379 if (memField.isEnabled()) {
382 }
catch (IOException ex) {
383 LOGGER.log(Level.WARNING,
"Unable to save config file to " + PlatformUtil.getUserDirectory() +
"\\" + ETC_FOLDER_NAME, ex);
394 boolean valid =
true;
396 if (!isAgencyLogoPathValid()) {
399 if (!isMemFieldValid()) {
402 if (!isLogNumFieldValid()) {
415 boolean isAgencyLogoPathValid() {
416 boolean valid =
true;
418 if (defaultLogoRB.isSelected()) {
419 agencyLogoPathFieldValidationLabel.setText(
"");
421 String agencyLogoPath = agencyLogoPathField.getText();
422 if (agencyLogoPath.isEmpty()) {
423 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_pathNotSet_text());
426 File file =
new File(agencyLogoPathField.getText());
427 if (file.exists() && file.isFile()) {
430 image = ImageIO.read(file);
432 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
434 agencyLogoPathFieldValidationLabel.setText(
"");
435 }
catch (IOException | IndexOutOfBoundsException ignored) {
436 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidImageSpecified_text());
440 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidPath_text());
454 private boolean isMemFieldValid() {
455 String memText = memField.getText();
456 memFieldValidationLabel.setText(
"");
457 if (!PlatformUtil.is64BitJVM()) {
458 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_not64BitInstall_text());
462 if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
463 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_developerMode_text());
467 if (memText.length() == 0) {
468 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_noValueEntered_text());
471 if (memText.replaceAll(
"[^\\d]",
"").length() != memText.length()) {
472 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_invalidCharacters_text());
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));
480 if (parsedInt > getSystemMemoryInGB()) {
481 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_overMaxMemory_text(getSystemMemoryInGB()));
492 private boolean isLogNumFieldValid() {
493 String count = logFileCount.getText();
494 logNumAlert.setText(
"");
496 int count_num = Integer.parseInt(count);
498 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
501 }
catch (NumberFormatException e) {
502 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
515 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
520 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
525 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
535 private void initComponents() {
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();
575 jScrollPane1.setBorder(null);
577 jPanel1.setPreferredSize(
new java.awt.Dimension(671, 488));
579 logoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.logoPanel.border.title")));
581 agencyLogoPathField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPathField.text"));
583 org.openide.awt.Mnemonics.setLocalizedText(browseLogosButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.browseLogosButton.text"));
584 browseLogosButton.addActionListener(
new java.awt.event.ActionListener() {
585 public void actionPerformed(java.awt.event.ActionEvent evt) {
586 browseLogosButtonActionPerformed(evt);
590 agencyLogoPreview.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
591 org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPreview,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPreview.text"));
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));
597 logoSourceButtonGroup.add(defaultLogoRB);
598 org.openide.awt.Mnemonics.setLocalizedText(defaultLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.defaultLogoRB.text"));
599 defaultLogoRB.addActionListener(
new java.awt.event.ActionListener() {
600 public void actionPerformed(java.awt.event.ActionEvent evt) {
601 defaultLogoRBActionPerformed(evt);
605 logoSourceButtonGroup.add(specifyLogoRB);
606 org.openide.awt.Mnemonics.setLocalizedText(specifyLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.specifyLogoRB.text"));
607 specifyLogoRB.addActionListener(
new java.awt.event.ActionListener() {
608 public void actionPerformed(java.awt.event.ActionEvent evt) {
609 specifyLogoRBActionPerformed(evt);
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"));
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()
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))
636 logoPanelLayout.setVerticalGroup(
637 logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
638 .addGroup(logoPanelLayout.createSequentialGroup()
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))
653 viewPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.viewPanel.border.title")));
655 org.openide.awt.Mnemonics.setLocalizedText(jLabelSelectFile,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelSelectFile.text"));
657 fileSelectionButtonGroup.add(useBestViewerRB);
658 org.openide.awt.Mnemonics.setLocalizedText(useBestViewerRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useBestViewerRB.text"));
659 useBestViewerRB.setToolTipText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useBestViewerRB.toolTipText"));
660 useBestViewerRB.addActionListener(
new java.awt.event.ActionListener() {
661 public void actionPerformed(java.awt.event.ActionEvent evt) {
662 useBestViewerRBActionPerformed(evt);
666 fileSelectionButtonGroup.add(keepCurrentViewerRB);
667 org.openide.awt.Mnemonics.setLocalizedText(keepCurrentViewerRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.keepCurrentViewerRB.text"));
668 keepCurrentViewerRB.setToolTipText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText"));
669 keepCurrentViewerRB.addActionListener(
new java.awt.event.ActionListener() {
670 public void actionPerformed(java.awt.event.ActionEvent evt) {
671 keepCurrentViewerRBActionPerformed(evt);
675 org.openide.awt.Mnemonics.setLocalizedText(jLabelHideKnownFiles,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelHideKnownFiles.text"));
677 org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideKnownCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.dataSourcesHideKnownCB.text"));
678 dataSourcesHideKnownCB.addActionListener(
new java.awt.event.ActionListener() {
679 public void actionPerformed(java.awt.event.ActionEvent evt) {
680 dataSourcesHideKnownCBActionPerformed(evt);
684 org.openide.awt.Mnemonics.setLocalizedText(viewsHideKnownCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.viewsHideKnownCB.text"));
685 viewsHideKnownCB.addActionListener(
new java.awt.event.ActionListener() {
686 public void actionPerformed(java.awt.event.ActionEvent evt) {
687 viewsHideKnownCBActionPerformed(evt);
691 org.openide.awt.Mnemonics.setLocalizedText(jLabelHideSlackFiles,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelHideSlackFiles.text"));
693 org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.dataSourcesHideSlackCB.text"));
694 dataSourcesHideSlackCB.addActionListener(
new java.awt.event.ActionListener() {
695 public void actionPerformed(java.awt.event.ActionEvent evt) {
696 dataSourcesHideSlackCBActionPerformed(evt);
700 org.openide.awt.Mnemonics.setLocalizedText(viewsHideSlackCB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.viewsHideSlackCB.text"));
701 viewsHideSlackCB.addActionListener(
new java.awt.event.ActionListener() {
702 public void actionPerformed(java.awt.event.ActionEvent evt) {
703 viewsHideSlackCBActionPerformed(evt);
707 org.openide.awt.Mnemonics.setLocalizedText(jLabelTimeDisplay,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.jLabelTimeDisplay.text"));
709 displayTimesButtonGroup.add(useLocalTimeRB);
710 org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useLocalTimeRB.text"));
711 useLocalTimeRB.addActionListener(
new java.awt.event.ActionListener() {
712 public void actionPerformed(java.awt.event.ActionEvent evt) {
713 useLocalTimeRBActionPerformed(evt);
717 displayTimesButtonGroup.add(useGMTTimeRB);
718 org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.useGMTTimeRB.text"));
719 useGMTTimeRB.addActionListener(
new java.awt.event.ActionListener() {
720 public void actionPerformed(java.awt.event.ActionEvent evt) {
721 useGMTTimeRBActionPerformed(evt);
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()
731 .addGroup(viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
732 .addGroup(viewPanelLayout.createSequentialGroup()
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))))
757 viewPanelLayout.setVerticalGroup(
758 viewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
759 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewPanelLayout.createSequentialGroup()
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))
786 runtimePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.runtimePanel.border.title")));
788 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryLabel.text"));
790 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
792 org.openide.awt.Mnemonics.setLocalizedText(totalMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.totalMemoryLabel.text"));
794 systemMemoryTotal.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
796 restartNecessaryWarning.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/warning16.png")));
797 org.openide.awt.Mnemonics.setLocalizedText(restartNecessaryWarning,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.restartNecessaryWarning.text"));
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);
806 memFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
808 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel1,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
810 org.openide.awt.Mnemonics.setLocalizedText(maxLogFileCount,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxLogFileCount.text"));
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);
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"));
823 logNumAlert.setBorder(null);
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()
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)
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)
857 .addComponent(logNumAlert)))
860 runtimePanelLayout.setVerticalGroup(
861 runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
862 .addGroup(runtimePanelLayout.createSequentialGroup()
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))
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()
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)))
899 jPanel1Layout.setVerticalGroup(
900 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
901 .addGroup(jPanel1Layout.createSequentialGroup()
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)
911 jScrollPane1.setViewportView(jPanel1);
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)
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)
925 private void logFileCountKeyReleased(java.awt.event.KeyEvent evt) {
926 String count = logFileCount.getText();
927 if (count.equals(String.valueOf(UserPreferences.getDefaultLogFileCount()))) {
931 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
934 private void memFieldKeyReleased(java.awt.event.KeyEvent evt) {
935 String memText = memField.getText();
936 if (memText.equals(initialMemValue)) {
940 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
943 private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {
944 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
947 private void useLocalTimeRBActionPerformed(java.awt.event.ActionEvent evt) {
948 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
951 private void viewsHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {
952 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
955 private void dataSourcesHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {
956 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
959 private void viewsHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {
960 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
963 private void dataSourcesHideKnownCBActionPerformed(java.awt.event.ActionEvent evt) {
964 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
967 private void keepCurrentViewerRBActionPerformed(java.awt.event.ActionEvent evt) {
968 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
971 private void useBestViewerRBActionPerformed(java.awt.event.ActionEvent evt) {
972 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
975 private void specifyLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
976 agencyLogoPathField.setEnabled(
true);
977 browseLogosButton.setEnabled(
true);
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);
985 }
catch (IOException ex) {
986 LOGGER.log(Level.WARNING,
"Error loading image from previously saved agency logo path.", ex);
988 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
991 private void defaultLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
992 agencyLogoPathField.setEnabled(
false);
993 browseLogosButton.setEnabled(
false);
995 updateAgencyLogo(
"");
996 }
catch (IOException ex) {
998 LOGGER.log(Level.SEVERE,
"Unexpected error occurred while updating the agency logo.", ex);
1000 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1003 private void browseLogosButtonActionPerformed(java.awt.event.ActionEvent evt) {
1004 String oldLogoPath = agencyLogoPathField.getText();
1005 int returnState = fileChooser.showOpenDialog(
this);
1006 if (returnState == JFileChooser.APPROVE_OPTION) {
1007 String path = fileChooser.getSelectedFile().getPath();
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);
1018 updateAgencyLogo(oldLogoPath);
1019 }
catch (IOException ex1) {
1020 LOGGER.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex1);
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;
void insertUpdate(DocumentEvent e)
void removeUpdate(DocumentEvent e)
void changedUpdate(DocumentEvent e)