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.InvalidPathException;
28 import java.nio.file.Path;
29 import java.util.ArrayList;
30 import java.util.List;
31 import java.util.Optional;
32 import java.util.logging.Level;
33 import java.util.regex.Matcher;
34 import java.util.regex.Pattern;
35 import java.util.stream.Collectors;
36 import java.util.stream.Stream;
37 import javax.imageio.ImageIO;
38 import javax.swing.ImageIcon;
39 import javax.swing.JFileChooser;
40 import javax.swing.JOptionPane;
41 import javax.swing.SwingUtilities;
42 import javax.swing.event.DocumentEvent;
43 import javax.swing.event.DocumentListener;
44 import org.apache.commons.io.FileUtils;
45 import org.apache.commons.lang3.StringUtils;
46 import org.apache.tools.ant.types.Commandline;
47 import org.netbeans.spi.options.OptionsPanelController;
48 import org.openide.util.NbBundle;
50 import org.openide.util.NbBundle.Messages;
65 "AutopsyOptionsPanel.invalidImageFile.msg=The selected file was not able to be used as an agency logo.",
66 "AutopsyOptionsPanel.invalidImageFile.title=Invalid Image File",
67 "AutopsyOptionsPanel.memFieldValidationLabel.not64BitInstall.text=JVM memory settings only enabled for 64 bit version",
68 "AutopsyOptionsPanel.memFieldValidationLabel.noValueEntered.text=No value entered",
69 "AutopsyOptionsPanel.memFieldValidationLabel.invalidCharacters.text=Invalid characters, value must be a positive integer",
70 "# {0} - minimumMemory",
71 "AutopsyOptionsPanel.memFieldValidationLabel.underMinMemory.text=Value must be at least {0}GB",
72 "# {0} - systemMemory",
73 "AutopsyOptionsPanel.memFieldValidationLabel.overMaxMemory.text=Value must be less than the total system memory of {0}GB",
74 "AutopsyOptionsPanel.memFieldValidationLabel.developerMode.text=Memory settings are not available while running in developer mode",
75 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidPath.text=Path is not valid.",
76 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidImageSpecified.text=Invalid image file specified.",
77 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.pathNotSet.text=Agency logo path must be set.",
78 "AutopsyOptionsPanel.logNumAlert.invalidInput.text=A positive integer is required here."
80 @SuppressWarnings(
"PMD.SingularField")
81 final class AutopsyOptionsPanel extends javax.swing.JPanel {
83 private static final long serialVersionUID = 1L;
84 private static final String DEFAULT_HEAP_DUMP_FILE_FIELD =
"";
85 private final JFileChooser logoFileChooser;
86 private final JFileChooser tempDirChooser;
87 private static final String ETC_FOLDER_NAME =
"etc";
88 private static final String CONFIG_FILE_EXTENSION =
".conf";
89 private static final long ONE_BILLION = 1000000000L;
90 private static final int MEGA_IN_GIGA = 1024;
91 private static final int JVM_MEMORY_STEP_SIZE_MB = 512;
92 private static final int MIN_MEMORY_IN_GB = 2;
93 private static final Logger logger = Logger.getLogger(AutopsyOptionsPanel.class.getName());
94 private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
96 private final ReportBranding reportBranding;
97 private final JFileChooser heapFileChooser;
102 AutopsyOptionsPanel() {
104 logoFileChooser =
new JFileChooser();
105 logoFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
106 logoFileChooser.setMultiSelectionEnabled(
false);
107 logoFileChooser.setAcceptAllFileFilterUsed(
false);
108 logoFileChooser.setFileFilter(
new GeneralFilter(GeneralFilter.GRAPHIC_IMAGE_EXTS, GeneralFilter.GRAPHIC_IMG_DECR));
110 tempDirChooser =
new JFileChooser();
111 tempDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
112 tempDirChooser.setMultiSelectionEnabled(
false);
114 heapFileChooser =
new JFileChooser();
115 heapFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
116 heapFileChooser.setMultiSelectionEnabled(
false);
118 if (!isJVMHeapSettingsCapable()) {
123 memField.setEnabled(
false);
124 heapDumpFileField.setEnabled(
false);
125 heapDumpBrowseButton.setEnabled(
false);
126 solrMaxHeapSpinner.setEnabled(
false);
128 systemMemoryTotal.setText(Long.toString(getSystemMemoryInGB()));
131 solrMaxHeapSpinner.setModel(
new javax.swing.SpinnerNumberModel(UserPreferences.getMaxSolrVMSize(),
132 JVM_MEMORY_STEP_SIZE_MB, ((int) getSystemMemoryInGB()) * MEGA_IN_GIGA, JVM_MEMORY_STEP_SIZE_MB));
134 agencyLogoPathField.getDocument().addDocumentListener(
new TextFieldListener(null));
135 heapDumpFileField.getDocument().addDocumentListener(
new TextFieldListener(this::isHeapPathValid));
136 tempCustomField.getDocument().addDocumentListener(
new TextFieldListener(this::evaluateTempDirState));
137 logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
139 reportBranding =
new ReportBranding();
146 private static boolean isJVMHeapSettingsCapable() {
147 return PlatformUtil.is64BitJVM() && Version.getBuildType() != Version.Type.DEVELOPMENT;
156 private long getSystemMemoryInGB() {
157 long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
158 .getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
159 return memorySize / ONE_BILLION;
169 private long getCurrentJvmMaxMemoryInGB(String confFileMemValue)
throws IOException {
172 if (confFileMemValue.length() > 1) {
173 units = confFileMemValue.charAt(confFileMemValue.length() - 1);
175 value = Long.parseLong(confFileMemValue.substring(0, confFileMemValue.length() - 1));
176 }
catch (NumberFormatException ex) {
177 throw new IOException(
"Unable to properly parse memory number.", ex);
180 throw new IOException(
"No memory setting found in String: " + confFileMemValue);
189 return value / MEGA_IN_GIGA;
191 throw new IOException(
"Units were not recognized as parsed: " + units);
204 private static File getInstallFolderConfFile() throws IOException {
205 String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
206 String installFolder = PlatformUtil.getInstallPath();
207 File installFolderEtc =
new File(installFolder, ETC_FOLDER_NAME);
208 File installFolderConfigFile =
new File(installFolderEtc, confFileName);
209 if (!installFolderConfigFile.exists()) {
210 throw new IOException(
"Conf file could not be found" + installFolderConfigFile.toString());
212 return installFolderConfigFile;
222 private static File getUserFolderConfFile() {
223 String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
224 File userFolder = PlatformUtil.getUserDirectory();
225 File userEtcFolder =
new File(userFolder, ETC_FOLDER_NAME);
226 if (!userEtcFolder.exists()) {
227 userEtcFolder.mkdir();
229 return new File(userEtcFolder, confFileName);
232 private static final String JVM_SETTINGS_REGEX_PARAM =
"options";
233 private static final String JVM_SETTINGS_REGEX_STR =
"^\\s*default_options\\s*=\\s*\"?(?<" + JVM_SETTINGS_REGEX_PARAM +
">.+?)\"?\\s*$";
234 private static final Pattern JVM_SETTINGS_REGEX = Pattern.compile(JVM_SETTINGS_REGEX_STR);
235 private static final String XMX_REGEX_PARAM =
"mem";
236 private static final String XMX_REGEX_STR =
"^\\s*\\-J\\-Xmx(?<" + XMX_REGEX_PARAM +
">.+?)\\s*$";
237 private static final Pattern XMX_REGEX = Pattern.compile(XMX_REGEX_STR);
238 private static final String HEAP_DUMP_REGEX_PARAM =
"path";
239 private static final String HEAP_DUMP_REGEX_STR =
"^\\s*\\-J\\-XX:HeapDumpPath=(\\\")?\\s*(?<" + HEAP_DUMP_REGEX_PARAM +
">.+?)\\s*(\\\")?$";
240 private static final Pattern HEAP_DUMP_REGEX = Pattern.compile(HEAP_DUMP_REGEX_STR);
253 private static String updateConfLine(String line, String memText, String heapText) {
254 Matcher match = JVM_SETTINGS_REGEX.matcher(line);
257 String[] parsedArgs = Commandline.translateCommandline(match.group(JVM_SETTINGS_REGEX_PARAM));
259 String memString =
"-J-Xmx" + memText.replaceAll(
"[^\\d]",
"") +
"g";
262 String heapString = null;
263 if (StringUtils.isNotBlank(heapText)) {
264 while (heapText.endsWith(
"\\") && heapText.length() > 0) {
265 heapText = heapText.substring(0, heapText.length() - 1);
268 heapString = String.format(
"-J-XX:HeapDumpPath=\"%s\"", heapText);
271 Stream<String> argsNoMemHeap = Stream.of(parsedArgs)
273 .filter(s -> !s.matches(XMX_REGEX_STR) && !s.matches(HEAP_DUMP_REGEX_STR));
275 String newArgs = Stream.concat(argsNoMemHeap, Stream.of(memString, heapString))
276 .filter(s -> s != null)
277 .collect(Collectors.joining(
" "));
279 return String.format(
"default_options=\"%s\"", newArgs);
294 private void writeEtcConfFile() throws IOException {
295 String fileText = readConfFile(getInstallFolderConfFile()).stream()
296 .map((line) -> updateConfLine(line, memField.getText(), heapDumpFileField.getText()))
297 .collect(Collectors.joining(
"\n"));
299 FileUtils.writeStringToFile(getUserFolderConfFile(), fileText,
"UTF-8");
315 ConfValues(String XmxVal, String heapDumpPath) {
316 this.XmxVal = XmxVal;
317 this.heapDumpPath = heapDumpPath;
332 String getHeapDumpPath() {
342 private ConfValues getEtcConfValues() throws IOException {
343 File userConfFile = getUserFolderConfFile();
344 String[] args = userConfFile.exists() ?
345 getDefaultsFromFileContents(readConfFile(userConfFile)) :
346 getDefaultsFromFileContents(readConfFile(getInstallFolderConfFile()));
348 String heapFile =
"";
351 for (String arg : args) {
352 Matcher memMatch = XMX_REGEX.matcher(arg);
353 if (memMatch.find()) {
354 memSize = memMatch.group(XMX_REGEX_PARAM);
358 Matcher heapFileMatch = HEAP_DUMP_REGEX.matcher(arg);
359 if (heapFileMatch.find()) {
360 heapFile = heapFileMatch.group(HEAP_DUMP_REGEX_PARAM);
365 return new ConfValues(memSize, heapFile);
375 "AutopsyOptionsPanel_isHeapPathValid_selectValidDirectory=Please select an existing directory.",
376 "AutopsyOptionsPanel_isHeapPathValid_developerMode=Cannot change heap dump path while in developer mode.",
377 "AutopsyOptionsPanel_isHeapPathValid_not64BitMachine=Changing heap dump path settings only enabled for 64 bit version.",
378 "AutopsyOPtionsPanel_isHeapPathValid_illegalCharacters=Please select a path with no quotes."
380 private boolean isHeapPathValid() {
381 if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
382 heapFieldValidationLabel.setVisible(
true);
383 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_developerMode());
387 if (!PlatformUtil.is64BitJVM()) {
388 heapFieldValidationLabel.setVisible(
true);
389 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_not64BitMachine());
394 if (StringUtils.isNotBlank(heapDumpFileField.getText())) {
395 String heapText = heapDumpFileField.getText().trim();
396 if (heapText.contains(
"\"") || heapText.contains(
"'")) {
397 heapFieldValidationLabel.setVisible(
true);
398 heapFieldValidationLabel.setText(Bundle.AutopsyOPtionsPanel_isHeapPathValid_illegalCharacters());
402 File curHeapFile =
new File(heapText);
403 if (!curHeapFile.exists() || !curHeapFile.isDirectory()) {
404 heapFieldValidationLabel.setVisible(
true);
405 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_selectValidDirectory());
410 heapFieldValidationLabel.setVisible(
false);
411 heapFieldValidationLabel.setText(
"");
424 private static List<String> readConfFile(File configFile) {
425 List<String> lines =
new ArrayList<>();
426 if (null != configFile) {
427 Path filePath = configFile.toPath();
428 Charset charset = Charset.forName(
"UTF-8");
430 lines = Files.readAllLines(filePath, charset);
431 }
catch (IOException e) {
432 logger.log(Level.SEVERE,
"Error reading config file contents. {}", configFile.getAbsolutePath());
449 private static String[] getDefaultsFromFileContents(List<String> list) {
450 Optional<String> defaultSettings = list.stream()
451 .filter(line -> line.matches(JVM_SETTINGS_REGEX_STR))
454 if (defaultSettings.isPresent()) {
455 Matcher match = JVM_SETTINGS_REGEX.matcher(defaultSettings.get());
457 return Commandline.translateCommandline(match.group(JVM_SETTINGS_REGEX_PARAM));
461 return new String[]{};
464 private void evaluateTempDirState() {
465 boolean caseOpen = Case.isCaseOpen();
466 boolean customSelected = tempCustomRadio.isSelected();
468 tempDirectoryBrowseButton.setEnabled(!caseOpen && customSelected);
469 tempCustomField.setEnabled(!caseOpen && customSelected);
471 tempOnCustomNoPath.setVisible(customSelected && StringUtils.isBlank(tempCustomField.getText()));
478 String path = reportBranding.getAgencyLogoPath();
479 boolean useDefault = (path == null || path.isEmpty());
480 defaultLogoRB.setSelected(useDefault);
481 specifyLogoRB.setSelected(!useDefault);
482 agencyLogoPathField.setEnabled(!useDefault);
483 browseLogosButton.setEnabled(!useDefault);
485 tempCustomField.setText(UserMachinePreferences.getCustomTempDirectory());
486 switch (UserMachinePreferences.getTempDirChoice()) {
488 tempCaseRadio.setSelected(
true);
491 tempCustomRadio.setSelected(
true);
495 tempLocalRadio.setSelected(
true);
499 evaluateTempDirState();
501 logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
502 solrMaxHeapSpinner.setValue(UserPreferences.getMaxSolrVMSize());
504 updateAgencyLogo(path);
505 }
catch (IOException ex) {
506 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex);
509 boolean confLoaded =
false;
510 if (isJVMHeapSettingsCapable()) {
512 ConfValues confValues = getEtcConfValues();
513 heapDumpFileField.setText(confValues.getHeapDumpPath());
514 initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB(confValues.getXmxVal()));
516 }
catch (IOException ex) {
517 logger.log(Level.SEVERE,
"Can't read current Jvm max memory setting from file", ex);
518 memField.setEnabled(
false);
519 heapDumpFileField.setText(DEFAULT_HEAP_DUMP_FILE_FIELD);
521 memField.setText(initialMemValue);
524 heapDumpBrowseButton.setEnabled(confLoaded);
525 heapDumpFileField.setEnabled(confLoaded);
531 private void setTempDirEnabled() {
532 boolean enabled = !Case.isCaseOpen();
534 this.tempCaseRadio.setEnabled(enabled);
535 this.tempCustomRadio.setEnabled(enabled);
536 this.tempLocalRadio.setEnabled(enabled);
538 this.tempDirectoryWarningLabel.setVisible(!enabled);
539 evaluateTempDirState();
549 private void updateAgencyLogo(String path)
throws IOException {
550 agencyLogoPathField.setText(path);
551 ImageIcon agencyLogoIcon =
new ImageIcon();
552 agencyLogoPreview.setText(NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPreview.text"));
553 if (!agencyLogoPathField.getText().isEmpty()) {
554 File file =
new File(agencyLogoPathField.getText());
556 BufferedImage image = ImageIO.read(file);
558 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
560 agencyLogoIcon =
new ImageIcon(image.getScaledInstance(64, 64, 4));
561 agencyLogoPreview.setText(
"");
564 agencyLogoPreview.setIcon(agencyLogoIcon);
565 agencyLogoPreview.repaint();
569 "AutopsyOptionsPanel_storeTempDir_onError_title=Error Saving Temporary Directory",
571 "AutopsyOptionsPanel_storeTempDir_onError_description=There was an error creating the temporary directory on the filesystem at: {0}.",
572 "AutopsyOptionsPanel_storeTempDir_onChoiceError_title=Error Saving Temporary Directory Choice",
573 "AutopsyOptionsPanel_storeTempDir_onChoiceError_description=There was an error updating temporary directory choice selection.",})
574 private void storeTempDir() {
575 String tempDirectoryPath = tempCustomField.getText();
576 if (!UserMachinePreferences.getCustomTempDirectory().equals(tempDirectoryPath)) {
578 UserMachinePreferences.setCustomTempDirectory(tempDirectoryPath);
579 }
catch (UserMachinePreferencesException ex) {
580 logger.log(Level.WARNING,
"There was an error creating the temporary directory defined by the user: " + tempDirectoryPath, ex);
581 SwingUtilities.invokeLater(() -> {
582 JOptionPane.showMessageDialog(
this,
583 String.format(
"<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onError_description(tempDirectoryPath)),
584 Bundle.AutopsyOptionsPanel_storeTempDir_onError_title(),
585 JOptionPane.ERROR_MESSAGE);
590 TempDirChoice choice;
591 if (tempCaseRadio.isSelected()) {
592 choice = TempDirChoice.CASE;
593 }
else if (tempCustomRadio.isSelected()) {
594 choice = TempDirChoice.CUSTOM;
596 choice = TempDirChoice.SYSTEM;
599 if (!choice.equals(UserMachinePreferences.getTempDirChoice())) {
601 UserMachinePreferences.setTempDirChoice(choice);
602 }
catch (UserMachinePreferencesException ex) {
603 logger.log(Level.WARNING,
"There was an error updating choice to: " + choice.name(), ex);
604 SwingUtilities.invokeLater(() -> {
605 JOptionPane.showMessageDialog(
this,
606 String.format(
"<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_description()),
607 Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_title(),
608 JOptionPane.ERROR_MESSAGE);
618 UserPreferences.setLogFileCount(Integer.parseInt(logFileCount.getText()));
621 if (!agencyLogoPathField.getText().isEmpty()) {
622 File file =
new File(agencyLogoPathField.getText());
624 reportBranding.setAgencyLogoPath(agencyLogoPathField.getText());
627 reportBranding.setAgencyLogoPath(
"");
629 UserPreferences.setMaxSolrVMSize((
int) solrMaxHeapSpinner.getValue());
630 if (isJVMHeapSettingsCapable()) {
633 }
catch (IOException ex) {
634 logger.log(Level.WARNING,
"Unable to save config file to " + PlatformUtil.getUserDirectory() +
"\\" + ETC_FOLDER_NAME, ex);
645 boolean agencyValid = isAgencyLogoPathValid();
646 boolean memFieldValid = isMemFieldValid();
647 boolean logNumValid = isLogNumFieldValid();
648 boolean heapPathValid = isHeapPathValid();
650 return agencyValid && memFieldValid && logNumValid && heapPathValid;
659 boolean isAgencyLogoPathValid() {
660 boolean valid =
true;
662 if (defaultLogoRB.isSelected()) {
663 agencyLogoPathFieldValidationLabel.setText(
"");
665 String agencyLogoPath = agencyLogoPathField.getText();
666 if (agencyLogoPath.isEmpty()) {
667 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_pathNotSet_text());
670 File file =
new File(agencyLogoPathField.getText());
671 if (file.exists() && file.isFile()) {
674 image = ImageIO.read(file);
676 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
678 agencyLogoPathFieldValidationLabel.setText(
"");
679 }
catch (IOException | IndexOutOfBoundsException ignored) {
680 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidImageSpecified_text());
684 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidPath_text());
698 private boolean isMemFieldValid() {
699 String memText = memField.getText();
700 memFieldValidationLabel.setText(
"");
701 if (!PlatformUtil.is64BitJVM()) {
702 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_not64BitInstall_text());
706 if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
707 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_developerMode_text());
711 if (memText.length() == 0) {
712 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_noValueEntered_text());
715 if (memText.replaceAll(
"[^\\d]",
"").length() != memText.length()) {
716 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_invalidCharacters_text());
719 int parsedInt = Integer.parseInt(memText);
720 if (parsedInt < MIN_MEMORY_IN_GB) {
721 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_underMinMemory_text(MIN_MEMORY_IN_GB));
724 if (parsedInt > getSystemMemoryInGB()) {
725 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_overMaxMemory_text(getSystemMemoryInGB()));
736 private boolean isLogNumFieldValid() {
737 String count = logFileCount.getText();
738 logNumAlert.setText(
"");
740 int count_num = Integer.parseInt(count);
742 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
745 }
catch (NumberFormatException e) {
746 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
765 this.onChange = onChange;
769 if (onChange != null) {
773 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
800 private void initComponents() {
801 java.awt.GridBagConstraints gridBagConstraints;
803 fileSelectionButtonGroup =
new javax.swing.ButtonGroup();
804 displayTimesButtonGroup =
new javax.swing.ButtonGroup();
805 logoSourceButtonGroup =
new javax.swing.ButtonGroup();
806 tempDirChoiceGroup =
new javax.swing.ButtonGroup();
807 jScrollPane1 =
new javax.swing.JScrollPane();
808 javax.swing.JPanel mainPanel =
new javax.swing.JPanel();
809 logoPanel =
new javax.swing.JPanel();
810 agencyLogoPathField =
new javax.swing.JTextField();
811 browseLogosButton =
new javax.swing.JButton();
812 agencyLogoPreview =
new javax.swing.JLabel();
813 defaultLogoRB =
new javax.swing.JRadioButton();
814 specifyLogoRB =
new javax.swing.JRadioButton();
815 agencyLogoPathFieldValidationLabel =
new javax.swing.JLabel();
816 runtimePanel =
new javax.swing.JPanel();
817 maxMemoryLabel =
new javax.swing.JLabel();
818 maxMemoryUnitsLabel =
new javax.swing.JLabel();
819 totalMemoryLabel =
new javax.swing.JLabel();
820 systemMemoryTotal =
new javax.swing.JLabel();
821 restartNecessaryWarning =
new javax.swing.JLabel();
822 memField =
new javax.swing.JTextField();
823 memFieldValidationLabel =
new javax.swing.JLabel();
824 maxMemoryUnitsLabel1 =
new javax.swing.JLabel();
825 maxLogFileCount =
new javax.swing.JLabel();
826 logFileCount =
new javax.swing.JTextField();
827 logNumAlert =
new javax.swing.JTextField();
828 maxSolrMemoryLabel =
new javax.swing.JLabel();
829 maxMemoryUnitsLabel2 =
new javax.swing.JLabel();
830 solrMaxHeapSpinner =
new javax.swing.JSpinner();
831 solrJVMHeapWarning =
new javax.swing.JLabel();
832 heapFileLabel =
new javax.swing.JLabel();
833 heapDumpFileField =
new javax.swing.JTextField();
834 heapDumpBrowseButton =
new javax.swing.JButton();
835 heapFieldValidationLabel =
new javax.swing.JLabel();
836 tempDirectoryPanel =
new javax.swing.JPanel();
837 tempCustomField =
new javax.swing.JTextField();
838 tempDirectoryBrowseButton =
new javax.swing.JButton();
839 tempDirectoryWarningLabel =
new javax.swing.JLabel();
840 tempLocalRadio =
new javax.swing.JRadioButton();
841 tempCaseRadio =
new javax.swing.JRadioButton();
842 tempCustomRadio =
new javax.swing.JRadioButton();
843 tempOnCustomNoPath =
new javax.swing.JLabel();
844 rdpPanel =
new javax.swing.JPanel();
845 javax.swing.JScrollPane sizingScrollPane =
new javax.swing.JScrollPane();
846 javax.swing.JTextPane sizingTextPane =
new javax.swing.JTextPane();
847 javax.swing.Box.Filler filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(32767, 0));
848 javax.swing.Box.Filler filler2 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 32767));
850 jScrollPane1.setBorder(null);
852 mainPanel.setMinimumSize(
new java.awt.Dimension(648, 382));
853 mainPanel.setLayout(
new java.awt.GridBagLayout());
855 logoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.logoPanel.border.title")));
857 agencyLogoPathField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPathField.text"));
859 org.openide.awt.Mnemonics.setLocalizedText(browseLogosButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.browseLogosButton.text"));
860 browseLogosButton.addActionListener(
new java.awt.event.ActionListener() {
861 public void actionPerformed(java.awt.event.ActionEvent evt) {
862 browseLogosButtonActionPerformed(evt);
866 agencyLogoPreview.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
867 org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPreview,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPreview.text"));
868 agencyLogoPreview.setBorder(javax.swing.BorderFactory.createEtchedBorder());
869 agencyLogoPreview.setMaximumSize(
new java.awt.Dimension(64, 64));
870 agencyLogoPreview.setMinimumSize(
new java.awt.Dimension(64, 64));
871 agencyLogoPreview.setPreferredSize(
new java.awt.Dimension(64, 64));
873 logoSourceButtonGroup.add(defaultLogoRB);
874 org.openide.awt.Mnemonics.setLocalizedText(defaultLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.defaultLogoRB.text"));
875 defaultLogoRB.addActionListener(
new java.awt.event.ActionListener() {
876 public void actionPerformed(java.awt.event.ActionEvent evt) {
877 defaultLogoRBActionPerformed(evt);
881 logoSourceButtonGroup.add(specifyLogoRB);
882 org.openide.awt.Mnemonics.setLocalizedText(specifyLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.specifyLogoRB.text"));
883 specifyLogoRB.addActionListener(
new java.awt.event.ActionListener() {
884 public void actionPerformed(java.awt.event.ActionEvent evt) {
885 specifyLogoRBActionPerformed(evt);
889 agencyLogoPathFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
890 org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPathFieldValidationLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.text"));
892 javax.swing.GroupLayout logoPanelLayout =
new javax.swing.GroupLayout(logoPanel);
893 logoPanel.setLayout(logoPanelLayout);
894 logoPanelLayout.setHorizontalGroup(
895 logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
896 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
898 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
899 .addComponent(specifyLogoRB)
900 .addComponent(defaultLogoRB))
901 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
902 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
903 .addComponent(agencyLogoPathFieldValidationLabel)
904 .addGroup(logoPanelLayout.createSequentialGroup()
905 .addComponent(agencyLogoPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
906 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
907 .addComponent(browseLogosButton)))
908 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
909 .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
910 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
912 logoPanelLayout.setVerticalGroup(
913 logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
914 .addGroup(logoPanelLayout.createSequentialGroup()
916 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
917 .addComponent(defaultLogoRB)
918 .addComponent(agencyLogoPathFieldValidationLabel))
919 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
920 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
921 .addComponent(specifyLogoRB)
922 .addComponent(agencyLogoPathField)
923 .addComponent(browseLogosButton)))
924 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
925 .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
926 .addGap(0, 0, Short.MAX_VALUE))
929 gridBagConstraints =
new java.awt.GridBagConstraints();
930 gridBagConstraints.gridx = 0;
931 gridBagConstraints.gridy = 2;
932 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
933 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
934 mainPanel.add(logoPanel, gridBagConstraints);
936 runtimePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.runtimePanel.border.title")));
938 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryLabel.text"));
940 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
942 org.openide.awt.Mnemonics.setLocalizedText(totalMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.totalMemoryLabel.text"));
944 systemMemoryTotal.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
946 restartNecessaryWarning.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/warning16.png")));
947 org.openide.awt.Mnemonics.setLocalizedText(restartNecessaryWarning,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.restartNecessaryWarning.text"));
949 memField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
950 memField.addKeyListener(
new java.awt.event.KeyAdapter() {
951 public void keyReleased(java.awt.event.KeyEvent evt) {
952 memFieldKeyReleased(evt);
956 memFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
958 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel1,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
960 org.openide.awt.Mnemonics.setLocalizedText(maxLogFileCount,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxLogFileCount.text"));
962 logFileCount.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
963 logFileCount.addKeyListener(
new java.awt.event.KeyAdapter() {
964 public void keyReleased(java.awt.event.KeyEvent evt) {
965 logFileCountKeyReleased(evt);
969 logNumAlert.setEditable(
false);
970 logNumAlert.setForeground(
new java.awt.Color(255, 0, 0));
971 logNumAlert.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.logNumAlert.text"));
972 logNumAlert.setBorder(null);
974 org.openide.awt.Mnemonics.setLocalizedText(maxSolrMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxSolrMemoryLabel.text"));
976 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel2,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel2.text"));
978 solrMaxHeapSpinner.addChangeListener(
new javax.swing.event.ChangeListener() {
979 public void stateChanged(javax.swing.event.ChangeEvent evt) {
980 solrMaxHeapSpinnerStateChanged(evt);
984 org.openide.awt.Mnemonics.setLocalizedText(solrJVMHeapWarning,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.solrJVMHeapWarning.text"));
986 org.openide.awt.Mnemonics.setLocalizedText(heapFileLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapFileLabel.text"));
988 heapDumpFileField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapDumpFileField.text"));
990 org.openide.awt.Mnemonics.setLocalizedText(heapDumpBrowseButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapDumpBrowseButton.text"));
991 heapDumpBrowseButton.addActionListener(
new java.awt.event.ActionListener() {
992 public void actionPerformed(java.awt.event.ActionEvent evt) {
993 heapDumpBrowseButtonActionPerformed(evt);
997 heapFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
998 org.openide.awt.Mnemonics.setLocalizedText(heapFieldValidationLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapFieldValidationLabel.text"));
1000 javax.swing.GroupLayout runtimePanelLayout =
new javax.swing.GroupLayout(runtimePanel);
1001 runtimePanel.setLayout(runtimePanelLayout);
1002 runtimePanelLayout.setHorizontalGroup(
1003 runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1004 .addGroup(runtimePanelLayout.createSequentialGroup()
1006 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1007 .addGroup(runtimePanelLayout.createSequentialGroup()
1008 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1009 .addComponent(totalMemoryLabel)
1010 .addComponent(maxSolrMemoryLabel)
1011 .addComponent(maxMemoryLabel)
1012 .addComponent(maxLogFileCount))
1014 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1015 .addComponent(logFileCount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
1016 .addComponent(solrMaxHeapSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1017 .addComponent(memField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
1018 .addComponent(systemMemoryTotal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
1020 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1021 .addComponent(maxMemoryUnitsLabel1)
1022 .addComponent(maxMemoryUnitsLabel)
1023 .addComponent(maxMemoryUnitsLabel2))
1024 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1025 .addGroup(runtimePanelLayout.createSequentialGroup()
1027 .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
1028 .addContainerGap(12, Short.MAX_VALUE))
1029 .addGroup(runtimePanelLayout.createSequentialGroup()
1031 .addComponent(solrJVMHeapWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
1033 .addComponent(logNumAlert)
1034 .addContainerGap())))
1035 .addGroup(runtimePanelLayout.createSequentialGroup()
1036 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1037 .addComponent(restartNecessaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
1038 .addGroup(runtimePanelLayout.createSequentialGroup()
1039 .addComponent(heapFileLabel)
1040 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1041 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1042 .addComponent(heapFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
1043 .addGroup(runtimePanelLayout.createSequentialGroup()
1044 .addComponent(heapDumpFileField, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)
1045 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1046 .addComponent(heapDumpBrowseButton)))))
1047 .addGap(0, 0, Short.MAX_VALUE))))
1050 runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {maxLogFileCount, maxMemoryLabel, totalMemoryLabel});
1052 runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {logFileCount, memField});
1054 runtimePanelLayout.setVerticalGroup(
1055 runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1056 .addGroup(runtimePanelLayout.createSequentialGroup()
1058 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
1059 .addComponent(totalMemoryLabel)
1060 .addComponent(maxMemoryUnitsLabel1)
1061 .addComponent(systemMemoryTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1062 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1063 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1064 .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
1065 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1066 .addComponent(maxMemoryLabel)
1067 .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1068 .addComponent(maxMemoryUnitsLabel)))
1069 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1070 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1071 .addComponent(logNumAlert, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1072 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1073 .addComponent(maxSolrMemoryLabel)
1074 .addComponent(maxMemoryUnitsLabel2)
1075 .addComponent(solrMaxHeapSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1076 .addComponent(solrJVMHeapWarning)))
1077 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1078 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1079 .addComponent(maxLogFileCount)
1080 .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1081 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1082 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1083 .addComponent(heapFileLabel)
1084 .addComponent(heapDumpFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1085 .addComponent(heapDumpBrowseButton))
1086 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1087 .addComponent(heapFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
1088 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1089 .addComponent(restartNecessaryWarning)
1093 gridBagConstraints =
new java.awt.GridBagConstraints();
1094 gridBagConstraints.gridx = 0;
1095 gridBagConstraints.gridy = 0;
1096 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1097 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1098 mainPanel.add(runtimePanel, gridBagConstraints);
1100 tempDirectoryPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.border.title")));
1101 tempDirectoryPanel.setName(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.name"));
1103 tempCustomField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCustomField.text"));
1105 org.openide.awt.Mnemonics.setLocalizedText(tempDirectoryBrowseButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryBrowseButton.text"));
1106 tempDirectoryBrowseButton.addActionListener(
new java.awt.event.ActionListener() {
1107 public void actionPerformed(java.awt.event.ActionEvent evt) {
1108 tempDirectoryBrowseButtonActionPerformed(evt);
1112 tempDirectoryWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/warning16.png")));
1113 org.openide.awt.Mnemonics.setLocalizedText(tempDirectoryWarningLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryWarningLabel.text"));
1115 tempDirChoiceGroup.add(tempLocalRadio);
1116 org.openide.awt.Mnemonics.setLocalizedText(tempLocalRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempLocalRadio.text"));
1117 tempLocalRadio.addActionListener(
new java.awt.event.ActionListener() {
1118 public void actionPerformed(java.awt.event.ActionEvent evt) {
1119 tempLocalRadioActionPerformed(evt);
1123 tempDirChoiceGroup.add(tempCaseRadio);
1124 org.openide.awt.Mnemonics.setLocalizedText(tempCaseRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCaseRadio.text"));
1125 tempCaseRadio.addActionListener(
new java.awt.event.ActionListener() {
1126 public void actionPerformed(java.awt.event.ActionEvent evt) {
1127 tempCaseRadioActionPerformed(evt);
1131 tempDirChoiceGroup.add(tempCustomRadio);
1132 org.openide.awt.Mnemonics.setLocalizedText(tempCustomRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCustomRadio.text"));
1133 tempCustomRadio.addActionListener(
new java.awt.event.ActionListener() {
1134 public void actionPerformed(java.awt.event.ActionEvent evt) {
1135 tempCustomRadioActionPerformed(evt);
1139 tempOnCustomNoPath.setForeground(java.awt.Color.RED);
1140 org.openide.awt.Mnemonics.setLocalizedText(tempOnCustomNoPath,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempOnCustomNoPath.text"));
1142 javax.swing.GroupLayout tempDirectoryPanelLayout =
new javax.swing.GroupLayout(tempDirectoryPanel);
1143 tempDirectoryPanel.setLayout(tempDirectoryPanelLayout);
1144 tempDirectoryPanelLayout.setHorizontalGroup(
1145 tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1146 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1148 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1149 .addComponent(tempLocalRadio)
1150 .addComponent(tempCaseRadio)
1151 .addComponent(tempDirectoryWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
1152 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1153 .addComponent(tempCustomRadio)
1154 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1155 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1156 .addComponent(tempOnCustomNoPath)
1157 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1158 .addComponent(tempCustomField, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)
1159 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1160 .addComponent(tempDirectoryBrowseButton)))))
1161 .addContainerGap(164, Short.MAX_VALUE))
1163 tempDirectoryPanelLayout.setVerticalGroup(
1164 tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1165 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1167 .addComponent(tempLocalRadio)
1168 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1169 .addComponent(tempCaseRadio)
1170 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1171 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1172 .addComponent(tempCustomRadio)
1173 .addComponent(tempCustomField)
1174 .addComponent(tempDirectoryBrowseButton))
1175 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1176 .addComponent(tempOnCustomNoPath)
1177 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1178 .addComponent(tempDirectoryWarningLabel)
1179 .addGap(14, 14, 14))
1182 gridBagConstraints =
new java.awt.GridBagConstraints();
1183 gridBagConstraints.gridx = 0;
1184 gridBagConstraints.gridy = 1;
1185 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1186 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1187 mainPanel.add(tempDirectoryPanel, gridBagConstraints);
1188 tempDirectoryPanel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.AccessibleContext.accessibleName"));
1190 rdpPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.rdpPanel.border.title")));
1191 rdpPanel.setMinimumSize(
new java.awt.Dimension(33, 100));
1192 rdpPanel.setPreferredSize(
new java.awt.Dimension(100, 150));
1193 rdpPanel.setLayout(
new java.awt.GridBagLayout());
1195 sizingScrollPane.setBorder(null);
1197 sizingTextPane.setEditable(
false);
1198 sizingTextPane.setBorder(null);
1199 sizingTextPane.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.sizingTextPane.text"));
1200 sizingTextPane.setOpaque(
false);
1201 sizingScrollPane.setViewportView(sizingTextPane);
1203 gridBagConstraints =
new java.awt.GridBagConstraints();
1204 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1205 gridBagConstraints.weightx = 1.0;
1206 gridBagConstraints.weighty = 1.0;
1207 rdpPanel.add(sizingScrollPane, gridBagConstraints);
1209 gridBagConstraints =
new java.awt.GridBagConstraints();
1210 gridBagConstraints.gridy = 3;
1211 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1212 mainPanel.add(rdpPanel, gridBagConstraints);
1213 gridBagConstraints =
new java.awt.GridBagConstraints();
1214 gridBagConstraints.gridx = 1;
1215 gridBagConstraints.gridy = 0;
1216 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1217 gridBagConstraints.weightx = 1.0;
1218 mainPanel.add(filler1, gridBagConstraints);
1219 gridBagConstraints =
new java.awt.GridBagConstraints();
1220 gridBagConstraints.gridx = 0;
1221 gridBagConstraints.gridy = 4;
1222 gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
1223 gridBagConstraints.weighty = 1.0;
1224 mainPanel.add(filler2, gridBagConstraints);
1226 jScrollPane1.setViewportView(mainPanel);
1228 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1229 this.setLayout(layout);
1230 layout.setHorizontalGroup(
1231 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1232 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 860, Short.MAX_VALUE)
1234 layout.setVerticalGroup(
1235 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1236 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 620, Short.MAX_VALUE)
1241 "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title=Path cannot be used",
1243 "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description=Unable to create temporary directory within specified path: {0}",})
1244 private void tempDirectoryBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {
1245 int returnState = tempDirChooser.showOpenDialog(
this);
1246 if (returnState == JFileChooser.APPROVE_OPTION) {
1247 String specifiedPath = tempDirChooser.getSelectedFile().getPath();
1249 File f =
new File(specifiedPath);
1250 if (!f.exists() && !f.mkdirs()) {
1251 throw new InvalidPathException(specifiedPath,
"Unable to create parent directories leading to " + specifiedPath);
1253 tempCustomField.setText(specifiedPath);
1254 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1255 }
catch (InvalidPathException ex) {
1256 logger.log(Level.WARNING,
"Unable to create temporary directory in " + specifiedPath, ex);
1257 JOptionPane.showMessageDialog(
this,
1258 Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description(specifiedPath),
1259 Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title(),
1260 JOptionPane.ERROR_MESSAGE);
1265 private void solrMaxHeapSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {
1266 int value = (int) solrMaxHeapSpinner.getValue();
1267 if (value == UserPreferences.getMaxSolrVMSize()) {
1271 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1274 private void logFileCountKeyReleased(java.awt.event.KeyEvent evt) {
1275 String count = logFileCount.getText();
1276 if (count.equals(String.valueOf(UserPreferences.getDefaultLogFileCount()))) {
1280 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1283 private void memFieldKeyReleased(java.awt.event.KeyEvent evt) {
1284 String memText = memField.getText();
1285 if (memText.equals(initialMemValue)) {
1289 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1292 private void specifyLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
1293 agencyLogoPathField.setEnabled(
true);
1294 browseLogosButton.setEnabled(
true);
1296 if (agencyLogoPathField.getText().isEmpty()) {
1297 String path = reportBranding.getAgencyLogoPath();
1298 if (path != null && !path.isEmpty()) {
1299 updateAgencyLogo(path);
1302 }
catch (IOException ex) {
1303 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path.", ex);
1305 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1308 private void defaultLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
1309 agencyLogoPathField.setEnabled(
false);
1310 browseLogosButton.setEnabled(
false);
1312 updateAgencyLogo(
"");
1313 }
catch (IOException ex) {
1315 logger.log(Level.SEVERE,
"Unexpected error occurred while updating the agency logo.", ex);
1317 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1320 private void browseLogosButtonActionPerformed(java.awt.event.ActionEvent evt) {
1321 String oldLogoPath = agencyLogoPathField.getText();
1322 int returnState = logoFileChooser.showOpenDialog(
this);
1323 if (returnState == JFileChooser.APPROVE_OPTION) {
1324 String path = logoFileChooser.getSelectedFile().getPath();
1326 updateAgencyLogo(path);
1327 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1328 }
catch (IOException | IndexOutOfBoundsException ex) {
1329 JOptionPane.showMessageDialog(
this,
1330 NbBundle.getMessage(
this.getClass(),
1331 "AutopsyOptionsPanel.invalidImageFile.msg"),
1332 NbBundle.getMessage(
this.getClass(),
"AutopsyOptionsPanel.invalidImageFile.title"),
1333 JOptionPane.ERROR_MESSAGE);
1335 updateAgencyLogo(oldLogoPath);
1336 }
catch (IOException ex1) {
1337 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex1);
1343 private void tempLocalRadioActionPerformed(java.awt.event.ActionEvent evt) {
1344 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1345 evaluateTempDirState();
1348 private void tempCaseRadioActionPerformed(java.awt.event.ActionEvent evt) {
1349 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1350 evaluateTempDirState();
1353 private void tempCustomRadioActionPerformed(java.awt.event.ActionEvent evt) {
1354 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1355 evaluateTempDirState();
1359 "AutopsyOptionsPanel_heapDumpBrowseButtonActionPerformed_fileAlreadyExistsTitle=File Already Exists",
1360 "AutopsyOptionsPanel_heapDumpBrowseButtonActionPerformed_fileAlreadyExistsMessage=File already exists. Please select a new location."
1362 private void heapDumpBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {
1363 String oldHeapPath = heapDumpFileField.getText();
1364 if (!StringUtils.isBlank(oldHeapPath)) {
1365 heapFileChooser.setCurrentDirectory(
new File(oldHeapPath));
1368 int returnState = heapFileChooser.showOpenDialog(
this);
1369 if (returnState == JFileChooser.APPROVE_OPTION) {
1370 File selectedDirectory = heapFileChooser.getSelectedFile();
1371 heapDumpFileField.setText(selectedDirectory.getAbsolutePath());
1372 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1377 private javax.swing.JTextField agencyLogoPathField;
1378 private javax.swing.JLabel agencyLogoPathFieldValidationLabel;
1379 private javax.swing.JLabel agencyLogoPreview;
1380 private javax.swing.JButton browseLogosButton;
1381 private javax.swing.JRadioButton defaultLogoRB;
1382 private javax.swing.ButtonGroup displayTimesButtonGroup;
1383 private javax.swing.ButtonGroup fileSelectionButtonGroup;
1384 private javax.swing.JButton heapDumpBrowseButton;
1385 private javax.swing.JTextField heapDumpFileField;
1386 private javax.swing.JLabel heapFieldValidationLabel;
1387 private javax.swing.JLabel heapFileLabel;
1388 private javax.swing.JScrollPane jScrollPane1;
1389 private javax.swing.JTextField logFileCount;
1390 private javax.swing.JTextField logNumAlert;
1391 private javax.swing.JPanel logoPanel;
1392 private javax.swing.ButtonGroup logoSourceButtonGroup;
1393 private javax.swing.JLabel maxLogFileCount;
1394 private javax.swing.JLabel maxMemoryLabel;
1395 private javax.swing.JLabel maxMemoryUnitsLabel;
1396 private javax.swing.JLabel maxMemoryUnitsLabel1;
1397 private javax.swing.JLabel maxMemoryUnitsLabel2;
1398 private javax.swing.JLabel maxSolrMemoryLabel;
1399 private javax.swing.JTextField memField;
1400 private javax.swing.JLabel memFieldValidationLabel;
1401 private javax.swing.JPanel rdpPanel;
1402 private javax.swing.JLabel restartNecessaryWarning;
1403 private javax.swing.JPanel runtimePanel;
1404 private javax.swing.JLabel solrJVMHeapWarning;
1405 private javax.swing.JSpinner solrMaxHeapSpinner;
1406 private javax.swing.JRadioButton specifyLogoRB;
1407 private javax.swing.JLabel systemMemoryTotal;
1408 private javax.swing.JRadioButton tempCaseRadio;
1409 private javax.swing.JTextField tempCustomField;
1410 private javax.swing.JRadioButton tempCustomRadio;
1411 private javax.swing.ButtonGroup tempDirChoiceGroup;
1412 private javax.swing.JButton tempDirectoryBrowseButton;
1413 private javax.swing.JPanel tempDirectoryPanel;
1414 private javax.swing.JLabel tempDirectoryWarningLabel;
1415 private javax.swing.JRadioButton tempLocalRadio;
1416 private javax.swing.JLabel tempOnCustomNoPath;
1417 private javax.swing.JLabel totalMemoryLabel;
final String heapDumpPath
void insertUpdate(DocumentEvent e)
void removeUpdate(DocumentEvent e)
void changedUpdate(DocumentEvent e)