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;
66 "AutopsyOptionsPanel.invalidImageFile.msg=The selected file was not able to be used as an agency logo.",
67 "AutopsyOptionsPanel.invalidImageFile.title=Invalid Image File",
68 "AutopsyOptionsPanel.memFieldValidationLabel.not64BitInstall.text=JVM memory settings only enabled for 64 bit version",
69 "AutopsyOptionsPanel.memFieldValidationLabel.noValueEntered.text=No value entered",
70 "AutopsyOptionsPanel.memFieldValidationLabel.invalidCharacters.text=Invalid characters, value must be a positive integer",
71 "# {0} - minimumMemory",
72 "AutopsyOptionsPanel.memFieldValidationLabel.underMinMemory.text=Value must be at least {0}GB",
73 "# {0} - systemMemory",
74 "AutopsyOptionsPanel.memFieldValidationLabel.overMaxMemory.text=Value must be less than the total system memory of {0}GB",
75 "AutopsyOptionsPanel.memFieldValidationLabel.developerMode.text=Memory settings are not available while running in developer mode",
76 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidPath.text=Path is not valid.",
77 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.invalidImageSpecified.text=Invalid image file specified.",
78 "AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.pathNotSet.text=Agency logo path must be set.",
79 "AutopsyOptionsPanel.logNumAlert.invalidInput.text=A positive integer is required here."
81 @SuppressWarnings(
"PMD.SingularField")
82 final class AutopsyOptionsPanel extends javax.swing.JPanel {
84 private static final long serialVersionUID = 1L;
85 private static final String DEFAULT_HEAP_DUMP_FILE_FIELD =
"";
86 private JFileChooser logoFileChooser;
87 private JFileChooser tempDirChooser;
88 private static final String ETC_FOLDER_NAME =
"etc";
89 private static final String CONFIG_FILE_EXTENSION =
".conf";
90 private static final long ONE_BILLION = 1000000000L;
91 private static final int MEGA_IN_GIGA = 1024;
92 private static final int JVM_MEMORY_STEP_SIZE_MB = 512;
93 private static final int MIN_MEMORY_IN_GB = 2;
94 private static final Logger logger = Logger.getLogger(AutopsyOptionsPanel.class.getName());
95 private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
97 private final ReportBranding reportBranding;
98 private JFileChooser heapFileChooser;
100 private final JFileChooserFactory logoChooserHelper =
new JFileChooserFactory();
101 private final JFileChooserFactory heapChooserHelper =
new JFileChooserFactory();
102 private final JFileChooserFactory tempChooserHelper =
new JFileChooserFactory();
107 AutopsyOptionsPanel() {
109 if (!isJVMHeapSettingsCapable()) {
114 memField.setEnabled(
false);
115 heapDumpFileField.setEnabled(
false);
116 heapDumpBrowseButton.setEnabled(
false);
117 solrMaxHeapSpinner.setEnabled(
false);
119 systemMemoryTotal.setText(Long.toString(getSystemMemoryInGB()));
122 solrMaxHeapSpinner.setModel(
new javax.swing.SpinnerNumberModel(UserPreferences.getMaxSolrVMSize(),
123 JVM_MEMORY_STEP_SIZE_MB, ((int) getSystemMemoryInGB()) * MEGA_IN_GIGA, JVM_MEMORY_STEP_SIZE_MB));
125 agencyLogoPathField.getDocument().addDocumentListener(
new TextFieldListener(null));
126 heapDumpFileField.getDocument().addDocumentListener(
new TextFieldListener(this::isHeapPathValid));
127 tempCustomField.getDocument().addDocumentListener(
new TextFieldListener(this::evaluateTempDirState));
128 logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
130 reportBranding =
new ReportBranding();
137 private static boolean isJVMHeapSettingsCapable() {
138 return PlatformUtil.is64BitJVM() && Version.getBuildType() != Version.Type.DEVELOPMENT;
147 private long getSystemMemoryInGB() {
148 long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
149 .getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
150 return memorySize / ONE_BILLION;
160 private long getCurrentJvmMaxMemoryInGB(String confFileMemValue)
throws IOException {
163 if (confFileMemValue.length() > 1) {
164 units = confFileMemValue.charAt(confFileMemValue.length() - 1);
166 value = Long.parseLong(confFileMemValue.substring(0, confFileMemValue.length() - 1));
167 }
catch (NumberFormatException ex) {
168 throw new IOException(
"Unable to properly parse memory number.", ex);
171 throw new IOException(
"No memory setting found in String: " + confFileMemValue);
180 return value / MEGA_IN_GIGA;
182 throw new IOException(
"Units were not recognized as parsed: " + units);
195 private static File getInstallFolderConfFile() throws IOException {
196 String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
197 String installFolder = PlatformUtil.getInstallPath();
198 File installFolderEtc =
new File(installFolder, ETC_FOLDER_NAME);
199 File installFolderConfigFile =
new File(installFolderEtc, confFileName);
200 if (!installFolderConfigFile.exists()) {
201 throw new IOException(
"Conf file could not be found" + installFolderConfigFile.toString());
203 return installFolderConfigFile;
213 private static File getUserFolderConfFile() {
214 String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION;
215 File userFolder = PlatformUtil.getUserDirectory();
216 File userEtcFolder =
new File(userFolder, ETC_FOLDER_NAME);
217 if (!userEtcFolder.exists()) {
218 userEtcFolder.mkdir();
220 return new File(userEtcFolder, confFileName);
223 private static final String JVM_SETTINGS_REGEX_PARAM =
"options";
224 private static final String JVM_SETTINGS_REGEX_STR =
"^\\s*default_options\\s*=\\s*\"?(?<" + JVM_SETTINGS_REGEX_PARAM +
">.+?)\"?\\s*$";
225 private static final Pattern JVM_SETTINGS_REGEX = Pattern.compile(JVM_SETTINGS_REGEX_STR);
226 private static final String XMX_REGEX_PARAM =
"mem";
227 private static final String XMX_REGEX_STR =
"^\\s*\\-J\\-Xmx(?<" + XMX_REGEX_PARAM +
">.+?)\\s*$";
228 private static final Pattern XMX_REGEX = Pattern.compile(XMX_REGEX_STR);
229 private static final String HEAP_DUMP_REGEX_PARAM =
"path";
230 private static final String HEAP_DUMP_REGEX_STR =
"^\\s*\\-J\\-XX:HeapDumpPath=(\\\")?\\s*(?<" + HEAP_DUMP_REGEX_PARAM +
">.+?)\\s*(\\\")?$";
231 private static final Pattern HEAP_DUMP_REGEX = Pattern.compile(HEAP_DUMP_REGEX_STR);
244 private static String updateConfLine(String line, String memText, String heapText) {
245 Matcher match = JVM_SETTINGS_REGEX.matcher(line);
248 String[] parsedArgs = Commandline.translateCommandline(match.group(JVM_SETTINGS_REGEX_PARAM));
250 String memString =
"-J-Xmx" + memText.replaceAll(
"[^\\d]",
"") +
"g";
253 String heapString = null;
254 if (StringUtils.isNotBlank(heapText)) {
255 while (heapText.endsWith(
"\\") && heapText.length() > 0) {
256 heapText = heapText.substring(0, heapText.length() - 1);
259 heapString = String.format(
"-J-XX:HeapDumpPath=\"%s\"", heapText);
262 Stream<String> argsNoMemHeap = Stream.of(parsedArgs)
264 .filter(s -> !s.matches(XMX_REGEX_STR) && !s.matches(HEAP_DUMP_REGEX_STR));
266 String newArgs = Stream.concat(argsNoMemHeap, Stream.of(memString, heapString))
267 .filter(s -> s != null)
268 .collect(Collectors.joining(
" "));
270 return String.format(
"default_options=\"%s\"", newArgs);
285 private void writeEtcConfFile() throws IOException {
286 String fileText = readConfFile(getInstallFolderConfFile()).stream()
287 .map((line) -> updateConfLine(line, memField.getText(), heapDumpFileField.getText()))
288 .collect(Collectors.joining(
"\n"));
290 FileUtils.writeStringToFile(getUserFolderConfFile(), fileText,
"UTF-8");
306 ConfValues(String XmxVal, String heapDumpPath) {
307 this.XmxVal = XmxVal;
308 this.heapDumpPath = heapDumpPath;
323 String getHeapDumpPath() {
333 private ConfValues getEtcConfValues() throws IOException {
334 File userConfFile = getUserFolderConfFile();
335 String[] args = userConfFile.exists() ?
336 getDefaultsFromFileContents(readConfFile(userConfFile)) :
337 getDefaultsFromFileContents(readConfFile(getInstallFolderConfFile()));
339 String heapFile =
"";
342 for (String arg : args) {
343 Matcher memMatch = XMX_REGEX.matcher(arg);
344 if (memMatch.find()) {
345 memSize = memMatch.group(XMX_REGEX_PARAM);
349 Matcher heapFileMatch = HEAP_DUMP_REGEX.matcher(arg);
350 if (heapFileMatch.find()) {
351 heapFile = heapFileMatch.group(HEAP_DUMP_REGEX_PARAM);
356 return new ConfValues(memSize, heapFile);
366 "AutopsyOptionsPanel_isHeapPathValid_selectValidDirectory=Please select an existing directory.",
367 "AutopsyOptionsPanel_isHeapPathValid_developerMode=Cannot change heap dump path while in developer mode.",
368 "AutopsyOptionsPanel_isHeapPathValid_not64BitMachine=Changing heap dump path settings only enabled for 64 bit version.",
369 "AutopsyOPtionsPanel_isHeapPathValid_illegalCharacters=Please select a path with no quotes."
371 private boolean isHeapPathValid() {
372 if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
373 heapFieldValidationLabel.setVisible(
true);
374 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_developerMode());
378 if (!PlatformUtil.is64BitJVM()) {
379 heapFieldValidationLabel.setVisible(
true);
380 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_not64BitMachine());
385 if (StringUtils.isNotBlank(heapDumpFileField.getText())) {
386 String heapText = heapDumpFileField.getText().trim();
387 if (heapText.contains(
"\"") || heapText.contains(
"'")) {
388 heapFieldValidationLabel.setVisible(
true);
389 heapFieldValidationLabel.setText(Bundle.AutopsyOPtionsPanel_isHeapPathValid_illegalCharacters());
393 File curHeapFile =
new File(heapText);
394 if (!curHeapFile.exists() || !curHeapFile.isDirectory()) {
395 heapFieldValidationLabel.setVisible(
true);
396 heapFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_isHeapPathValid_selectValidDirectory());
401 heapFieldValidationLabel.setVisible(
false);
402 heapFieldValidationLabel.setText(
"");
415 private static List<String> readConfFile(File configFile) {
416 List<String> lines =
new ArrayList<>();
417 if (null != configFile) {
418 Path filePath = configFile.toPath();
419 Charset charset = Charset.forName(
"UTF-8");
421 lines = Files.readAllLines(filePath, charset);
422 }
catch (IOException e) {
423 logger.log(Level.SEVERE,
"Error reading config file contents. {}", configFile.getAbsolutePath());
440 private static String[] getDefaultsFromFileContents(List<String> list) {
441 Optional<String> defaultSettings = list.stream()
442 .filter(line -> line.matches(JVM_SETTINGS_REGEX_STR))
445 if (defaultSettings.isPresent()) {
446 Matcher match = JVM_SETTINGS_REGEX.matcher(defaultSettings.get());
448 return Commandline.translateCommandline(match.group(JVM_SETTINGS_REGEX_PARAM));
452 return new String[]{};
455 private void evaluateTempDirState() {
456 boolean caseOpen = Case.isCaseOpen();
457 boolean customSelected = tempCustomRadio.isSelected();
459 tempDirectoryBrowseButton.setEnabled(!caseOpen && customSelected);
460 tempCustomField.setEnabled(!caseOpen && customSelected);
462 tempOnCustomNoPath.setVisible(customSelected && StringUtils.isBlank(tempCustomField.getText()));
469 String path = reportBranding.getAgencyLogoPath();
470 boolean useDefault = (path == null || path.isEmpty());
471 defaultLogoRB.setSelected(useDefault);
472 specifyLogoRB.setSelected(!useDefault);
473 agencyLogoPathField.setEnabled(!useDefault);
474 browseLogosButton.setEnabled(!useDefault);
476 tempCustomField.setText(UserMachinePreferences.getCustomTempDirectory());
477 switch (UserMachinePreferences.getTempDirChoice()) {
479 tempCaseRadio.setSelected(
true);
482 tempCustomRadio.setSelected(
true);
486 tempLocalRadio.setSelected(
true);
490 evaluateTempDirState();
492 logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));
493 solrMaxHeapSpinner.setValue(UserPreferences.getMaxSolrVMSize());
495 updateAgencyLogo(path);
496 }
catch (IOException ex) {
497 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex);
500 boolean confLoaded =
false;
501 if (isJVMHeapSettingsCapable()) {
503 ConfValues confValues = getEtcConfValues();
504 heapDumpFileField.setText(confValues.getHeapDumpPath());
505 initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB(confValues.getXmxVal()));
507 }
catch (IOException ex) {
508 logger.log(Level.SEVERE,
"Can't read current Jvm max memory setting from file", ex);
509 memField.setEnabled(
false);
510 heapDumpFileField.setText(DEFAULT_HEAP_DUMP_FILE_FIELD);
512 memField.setText(initialMemValue);
515 heapDumpBrowseButton.setEnabled(confLoaded);
516 heapDumpFileField.setEnabled(confLoaded);
522 private void setTempDirEnabled() {
523 boolean enabled = !Case.isCaseOpen();
525 this.tempCaseRadio.setEnabled(enabled);
526 this.tempCustomRadio.setEnabled(enabled);
527 this.tempLocalRadio.setEnabled(enabled);
529 this.tempDirectoryWarningLabel.setVisible(!enabled);
530 evaluateTempDirState();
540 private void updateAgencyLogo(String path)
throws IOException {
541 agencyLogoPathField.setText(path);
542 ImageIcon agencyLogoIcon =
new ImageIcon();
543 agencyLogoPreview.setText(NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPreview.text"));
544 if (!agencyLogoPathField.getText().isEmpty()) {
545 File file =
new File(agencyLogoPathField.getText());
547 BufferedImage image = ImageIO.read(file);
549 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
551 agencyLogoIcon =
new ImageIcon(image.getScaledInstance(64, 64, 4));
552 agencyLogoPreview.setText(
"");
555 agencyLogoPreview.setIcon(agencyLogoIcon);
556 agencyLogoPreview.repaint();
560 "AutopsyOptionsPanel_storeTempDir_onError_title=Error Saving Temporary Directory",
562 "AutopsyOptionsPanel_storeTempDir_onError_description=There was an error creating the temporary directory on the filesystem at: {0}.",
563 "AutopsyOptionsPanel_storeTempDir_onChoiceError_title=Error Saving Temporary Directory Choice",
564 "AutopsyOptionsPanel_storeTempDir_onChoiceError_description=There was an error updating temporary directory choice selection.",})
565 private void storeTempDir() {
566 String tempDirectoryPath = tempCustomField.getText();
567 if (!UserMachinePreferences.getCustomTempDirectory().equals(tempDirectoryPath)) {
569 UserMachinePreferences.setCustomTempDirectory(tempDirectoryPath);
570 }
catch (UserMachinePreferencesException ex) {
571 logger.log(Level.WARNING,
"There was an error creating the temporary directory defined by the user: " + tempDirectoryPath, ex);
572 SwingUtilities.invokeLater(() -> {
573 JOptionPane.showMessageDialog(
this,
574 String.format(
"<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onError_description(tempDirectoryPath)),
575 Bundle.AutopsyOptionsPanel_storeTempDir_onError_title(),
576 JOptionPane.ERROR_MESSAGE);
581 TempDirChoice choice;
582 if (tempCaseRadio.isSelected()) {
583 choice = TempDirChoice.CASE;
584 }
else if (tempCustomRadio.isSelected()) {
585 choice = TempDirChoice.CUSTOM;
587 choice = TempDirChoice.SYSTEM;
590 if (!choice.equals(UserMachinePreferences.getTempDirChoice())) {
592 UserMachinePreferences.setTempDirChoice(choice);
593 }
catch (UserMachinePreferencesException ex) {
594 logger.log(Level.WARNING,
"There was an error updating choice to: " + choice.name(), ex);
595 SwingUtilities.invokeLater(() -> {
596 JOptionPane.showMessageDialog(
this,
597 String.format(
"<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_description()),
598 Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_title(),
599 JOptionPane.ERROR_MESSAGE);
609 UserPreferences.setLogFileCount(Integer.parseInt(logFileCount.getText()));
612 if (!agencyLogoPathField.getText().isEmpty()) {
613 File file =
new File(agencyLogoPathField.getText());
615 reportBranding.setAgencyLogoPath(agencyLogoPathField.getText());
618 reportBranding.setAgencyLogoPath(
"");
620 UserPreferences.setMaxSolrVMSize((
int) solrMaxHeapSpinner.getValue());
621 if (isJVMHeapSettingsCapable()) {
624 }
catch (IOException ex) {
625 logger.log(Level.WARNING,
"Unable to save config file to " + PlatformUtil.getUserDirectory() +
"\\" + ETC_FOLDER_NAME, ex);
636 boolean agencyValid = isAgencyLogoPathValid();
637 boolean memFieldValid = isMemFieldValid();
638 boolean logNumValid = isLogNumFieldValid();
639 boolean heapPathValid = isHeapPathValid();
641 return agencyValid && memFieldValid && logNumValid && heapPathValid;
650 boolean isAgencyLogoPathValid() {
651 boolean valid =
true;
653 if (defaultLogoRB.isSelected()) {
654 agencyLogoPathFieldValidationLabel.setText(
"");
656 String agencyLogoPath = agencyLogoPathField.getText();
657 if (agencyLogoPath.isEmpty()) {
658 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_pathNotSet_text());
661 File file =
new File(agencyLogoPathField.getText());
662 if (file.exists() && file.isFile()) {
665 image = ImageIO.read(file);
667 throw new IOException(
"Unable to read file as a BufferedImage for file " + file.toString());
669 agencyLogoPathFieldValidationLabel.setText(
"");
670 }
catch (IOException | IndexOutOfBoundsException ignored) {
671 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidImageSpecified_text());
675 agencyLogoPathFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_agencyLogoPathFieldValidationLabel_invalidPath_text());
689 private boolean isMemFieldValid() {
690 String memText = memField.getText();
691 memFieldValidationLabel.setText(
"");
692 if (!PlatformUtil.is64BitJVM()) {
693 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_not64BitInstall_text());
697 if (Version.getBuildType() == Version.Type.DEVELOPMENT) {
698 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_developerMode_text());
702 if (memText.length() == 0) {
703 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_noValueEntered_text());
706 if (memText.replaceAll(
"[^\\d]",
"").length() != memText.length()) {
707 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_invalidCharacters_text());
710 int parsedInt = Integer.parseInt(memText);
711 if (parsedInt < MIN_MEMORY_IN_GB) {
712 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_underMinMemory_text(MIN_MEMORY_IN_GB));
715 if (parsedInt > getSystemMemoryInGB()) {
716 memFieldValidationLabel.setText(Bundle.AutopsyOptionsPanel_memFieldValidationLabel_overMaxMemory_text(getSystemMemoryInGB()));
727 private boolean isLogNumFieldValid() {
728 String count = logFileCount.getText();
729 logNumAlert.setText(
"");
731 int count_num = Integer.parseInt(count);
733 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
736 }
catch (NumberFormatException e) {
737 logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());
756 this.onChange = onChange;
760 if (onChange != null) {
764 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
791 private void initComponents() {
792 java.awt.GridBagConstraints gridBagConstraints;
794 fileSelectionButtonGroup =
new javax.swing.ButtonGroup();
795 displayTimesButtonGroup =
new javax.swing.ButtonGroup();
796 logoSourceButtonGroup =
new javax.swing.ButtonGroup();
797 tempDirChoiceGroup =
new javax.swing.ButtonGroup();
798 jScrollPane1 =
new javax.swing.JScrollPane();
799 javax.swing.JPanel mainPanel =
new javax.swing.JPanel();
800 logoPanel =
new javax.swing.JPanel();
801 agencyLogoPathField =
new javax.swing.JTextField();
802 browseLogosButton =
new javax.swing.JButton();
803 agencyLogoPreview =
new javax.swing.JLabel();
804 defaultLogoRB =
new javax.swing.JRadioButton();
805 specifyLogoRB =
new javax.swing.JRadioButton();
806 agencyLogoPathFieldValidationLabel =
new javax.swing.JLabel();
807 runtimePanel =
new javax.swing.JPanel();
808 maxMemoryLabel =
new javax.swing.JLabel();
809 maxMemoryUnitsLabel =
new javax.swing.JLabel();
810 totalMemoryLabel =
new javax.swing.JLabel();
811 systemMemoryTotal =
new javax.swing.JLabel();
812 restartNecessaryWarning =
new javax.swing.JLabel();
813 memField =
new javax.swing.JTextField();
814 memFieldValidationLabel =
new javax.swing.JLabel();
815 maxMemoryUnitsLabel1 =
new javax.swing.JLabel();
816 maxLogFileCount =
new javax.swing.JLabel();
817 logFileCount =
new javax.swing.JTextField();
818 logNumAlert =
new javax.swing.JTextField();
819 maxSolrMemoryLabel =
new javax.swing.JLabel();
820 maxMemoryUnitsLabel2 =
new javax.swing.JLabel();
821 solrMaxHeapSpinner =
new javax.swing.JSpinner();
822 solrJVMHeapWarning =
new javax.swing.JLabel();
823 heapFileLabel =
new javax.swing.JLabel();
824 heapDumpFileField =
new javax.swing.JTextField();
825 heapDumpBrowseButton =
new javax.swing.JButton();
826 heapFieldValidationLabel =
new javax.swing.JLabel();
827 tempDirectoryPanel =
new javax.swing.JPanel();
828 tempCustomField =
new javax.swing.JTextField();
829 tempDirectoryBrowseButton =
new javax.swing.JButton();
830 tempDirectoryWarningLabel =
new javax.swing.JLabel();
831 tempLocalRadio =
new javax.swing.JRadioButton();
832 tempCaseRadio =
new javax.swing.JRadioButton();
833 tempCustomRadio =
new javax.swing.JRadioButton();
834 tempOnCustomNoPath =
new javax.swing.JLabel();
835 rdpPanel =
new javax.swing.JPanel();
836 javax.swing.JScrollPane sizingScrollPane =
new javax.swing.JScrollPane();
837 javax.swing.JTextPane sizingTextPane =
new javax.swing.JTextPane();
838 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));
839 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));
841 jScrollPane1.setBorder(null);
843 mainPanel.setMinimumSize(
new java.awt.Dimension(648, 382));
844 mainPanel.setLayout(
new java.awt.GridBagLayout());
846 logoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.logoPanel.border.title")));
848 agencyLogoPathField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPathField.text"));
850 org.openide.awt.Mnemonics.setLocalizedText(browseLogosButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.browseLogosButton.text"));
851 browseLogosButton.addActionListener(
new java.awt.event.ActionListener() {
852 public void actionPerformed(java.awt.event.ActionEvent evt) {
853 browseLogosButtonActionPerformed(evt);
857 agencyLogoPreview.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
858 org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPreview,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPreview.text"));
859 agencyLogoPreview.setBorder(javax.swing.BorderFactory.createEtchedBorder());
860 agencyLogoPreview.setMaximumSize(
new java.awt.Dimension(64, 64));
861 agencyLogoPreview.setMinimumSize(
new java.awt.Dimension(64, 64));
862 agencyLogoPreview.setPreferredSize(
new java.awt.Dimension(64, 64));
864 logoSourceButtonGroup.add(defaultLogoRB);
865 org.openide.awt.Mnemonics.setLocalizedText(defaultLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.defaultLogoRB.text"));
866 defaultLogoRB.addActionListener(
new java.awt.event.ActionListener() {
867 public void actionPerformed(java.awt.event.ActionEvent evt) {
868 defaultLogoRBActionPerformed(evt);
872 logoSourceButtonGroup.add(specifyLogoRB);
873 org.openide.awt.Mnemonics.setLocalizedText(specifyLogoRB,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.specifyLogoRB.text"));
874 specifyLogoRB.addActionListener(
new java.awt.event.ActionListener() {
875 public void actionPerformed(java.awt.event.ActionEvent evt) {
876 specifyLogoRBActionPerformed(evt);
880 agencyLogoPathFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
881 org.openide.awt.Mnemonics.setLocalizedText(agencyLogoPathFieldValidationLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.agencyLogoPathFieldValidationLabel.text"));
883 javax.swing.GroupLayout logoPanelLayout =
new javax.swing.GroupLayout(logoPanel);
884 logoPanel.setLayout(logoPanelLayout);
885 logoPanelLayout.setHorizontalGroup(
886 logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
887 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
889 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
890 .addComponent(specifyLogoRB)
891 .addComponent(defaultLogoRB))
892 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
893 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
894 .addComponent(agencyLogoPathFieldValidationLabel)
895 .addGroup(logoPanelLayout.createSequentialGroup()
896 .addComponent(agencyLogoPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
897 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
898 .addComponent(browseLogosButton)))
899 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
900 .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
901 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
903 logoPanelLayout.setVerticalGroup(
904 logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
905 .addGroup(logoPanelLayout.createSequentialGroup()
907 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
908 .addComponent(defaultLogoRB)
909 .addComponent(agencyLogoPathFieldValidationLabel))
910 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
911 .addGroup(logoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
912 .addComponent(specifyLogoRB)
913 .addComponent(agencyLogoPathField)
914 .addComponent(browseLogosButton)))
915 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, logoPanelLayout.createSequentialGroup()
916 .addComponent(agencyLogoPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
917 .addGap(0, 0, Short.MAX_VALUE))
920 gridBagConstraints =
new java.awt.GridBagConstraints();
921 gridBagConstraints.gridx = 0;
922 gridBagConstraints.gridy = 2;
923 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
924 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
925 mainPanel.add(logoPanel, gridBagConstraints);
927 runtimePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.runtimePanel.border.title")));
929 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryLabel.text"));
931 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
933 org.openide.awt.Mnemonics.setLocalizedText(totalMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.totalMemoryLabel.text"));
935 systemMemoryTotal.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
937 restartNecessaryWarning.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/warning16.png")));
938 org.openide.awt.Mnemonics.setLocalizedText(restartNecessaryWarning,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.restartNecessaryWarning.text"));
940 memField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
941 memField.addKeyListener(
new java.awt.event.KeyAdapter() {
942 public void keyReleased(java.awt.event.KeyEvent evt) {
943 memFieldKeyReleased(evt);
947 memFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
949 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel1,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel.text"));
951 org.openide.awt.Mnemonics.setLocalizedText(maxLogFileCount,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxLogFileCount.text"));
953 logFileCount.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
954 logFileCount.addKeyListener(
new java.awt.event.KeyAdapter() {
955 public void keyReleased(java.awt.event.KeyEvent evt) {
956 logFileCountKeyReleased(evt);
960 logNumAlert.setEditable(
false);
961 logNumAlert.setForeground(
new java.awt.Color(255, 0, 0));
962 logNumAlert.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.logNumAlert.text"));
963 logNumAlert.setBorder(null);
965 org.openide.awt.Mnemonics.setLocalizedText(maxSolrMemoryLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxSolrMemoryLabel.text"));
967 org.openide.awt.Mnemonics.setLocalizedText(maxMemoryUnitsLabel2,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.maxMemoryUnitsLabel2.text"));
969 solrMaxHeapSpinner.addChangeListener(
new javax.swing.event.ChangeListener() {
970 public void stateChanged(javax.swing.event.ChangeEvent evt) {
971 solrMaxHeapSpinnerStateChanged(evt);
975 org.openide.awt.Mnemonics.setLocalizedText(solrJVMHeapWarning,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.solrJVMHeapWarning.text"));
977 org.openide.awt.Mnemonics.setLocalizedText(heapFileLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapFileLabel.text"));
979 heapDumpFileField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapDumpFileField.text"));
981 org.openide.awt.Mnemonics.setLocalizedText(heapDumpBrowseButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapDumpBrowseButton.text"));
982 heapDumpBrowseButton.addActionListener(
new java.awt.event.ActionListener() {
983 public void actionPerformed(java.awt.event.ActionEvent evt) {
984 heapDumpBrowseButtonActionPerformed(evt);
988 heapFieldValidationLabel.setForeground(
new java.awt.Color(255, 0, 0));
989 org.openide.awt.Mnemonics.setLocalizedText(heapFieldValidationLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.heapFieldValidationLabel.text"));
991 javax.swing.GroupLayout runtimePanelLayout =
new javax.swing.GroupLayout(runtimePanel);
992 runtimePanel.setLayout(runtimePanelLayout);
993 runtimePanelLayout.setHorizontalGroup(
994 runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
995 .addGroup(runtimePanelLayout.createSequentialGroup()
997 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
998 .addGroup(runtimePanelLayout.createSequentialGroup()
999 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1000 .addComponent(totalMemoryLabel)
1001 .addComponent(maxSolrMemoryLabel)
1002 .addComponent(maxMemoryLabel)
1003 .addComponent(maxLogFileCount))
1005 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1006 .addComponent(logFileCount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
1007 .addComponent(solrMaxHeapSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1008 .addComponent(memField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
1009 .addComponent(systemMemoryTotal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
1011 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1012 .addComponent(maxMemoryUnitsLabel1)
1013 .addComponent(maxMemoryUnitsLabel)
1014 .addComponent(maxMemoryUnitsLabel2))
1015 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1016 .addGroup(runtimePanelLayout.createSequentialGroup()
1018 .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
1019 .addContainerGap(12, Short.MAX_VALUE))
1020 .addGroup(runtimePanelLayout.createSequentialGroup()
1022 .addComponent(solrJVMHeapWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
1024 .addComponent(logNumAlert)
1025 .addContainerGap())))
1026 .addGroup(runtimePanelLayout.createSequentialGroup()
1027 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1028 .addComponent(restartNecessaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
1029 .addGroup(runtimePanelLayout.createSequentialGroup()
1030 .addComponent(heapFileLabel)
1031 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1032 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1033 .addComponent(heapFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
1034 .addGroup(runtimePanelLayout.createSequentialGroup()
1035 .addComponent(heapDumpFileField, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)
1036 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1037 .addComponent(heapDumpBrowseButton)))))
1038 .addGap(0, 0, Short.MAX_VALUE))))
1041 runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {maxLogFileCount, maxMemoryLabel, totalMemoryLabel});
1043 runtimePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {logFileCount, memField});
1045 runtimePanelLayout.setVerticalGroup(
1046 runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1047 .addGroup(runtimePanelLayout.createSequentialGroup()
1049 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
1050 .addComponent(totalMemoryLabel)
1051 .addComponent(maxMemoryUnitsLabel1)
1052 .addComponent(systemMemoryTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1053 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1054 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1055 .addComponent(memFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
1056 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1057 .addComponent(maxMemoryLabel)
1058 .addComponent(memField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1059 .addComponent(maxMemoryUnitsLabel)))
1060 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1061 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1062 .addComponent(logNumAlert, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1063 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1064 .addComponent(maxSolrMemoryLabel)
1065 .addComponent(maxMemoryUnitsLabel2)
1066 .addComponent(solrMaxHeapSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1067 .addComponent(solrJVMHeapWarning)))
1068 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1069 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1070 .addComponent(maxLogFileCount)
1071 .addComponent(logFileCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
1072 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1073 .addGroup(runtimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1074 .addComponent(heapFileLabel)
1075 .addComponent(heapDumpFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1076 .addComponent(heapDumpBrowseButton))
1077 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1078 .addComponent(heapFieldValidationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
1079 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1080 .addComponent(restartNecessaryWarning)
1084 gridBagConstraints =
new java.awt.GridBagConstraints();
1085 gridBagConstraints.gridx = 0;
1086 gridBagConstraints.gridy = 0;
1087 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1088 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1089 mainPanel.add(runtimePanel, gridBagConstraints);
1091 tempDirectoryPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.border.title")));
1092 tempDirectoryPanel.setName(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.name"));
1094 tempCustomField.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCustomField.text"));
1096 org.openide.awt.Mnemonics.setLocalizedText(tempDirectoryBrowseButton,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryBrowseButton.text"));
1097 tempDirectoryBrowseButton.addActionListener(
new java.awt.event.ActionListener() {
1098 public void actionPerformed(java.awt.event.ActionEvent evt) {
1099 tempDirectoryBrowseButtonActionPerformed(evt);
1103 tempDirectoryWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/warning16.png")));
1104 org.openide.awt.Mnemonics.setLocalizedText(tempDirectoryWarningLabel,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryWarningLabel.text"));
1106 tempDirChoiceGroup.add(tempLocalRadio);
1107 org.openide.awt.Mnemonics.setLocalizedText(tempLocalRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempLocalRadio.text"));
1108 tempLocalRadio.addActionListener(
new java.awt.event.ActionListener() {
1109 public void actionPerformed(java.awt.event.ActionEvent evt) {
1110 tempLocalRadioActionPerformed(evt);
1114 tempDirChoiceGroup.add(tempCaseRadio);
1115 org.openide.awt.Mnemonics.setLocalizedText(tempCaseRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCaseRadio.text"));
1116 tempCaseRadio.addActionListener(
new java.awt.event.ActionListener() {
1117 public void actionPerformed(java.awt.event.ActionEvent evt) {
1118 tempCaseRadioActionPerformed(evt);
1122 tempDirChoiceGroup.add(tempCustomRadio);
1123 org.openide.awt.Mnemonics.setLocalizedText(tempCustomRadio,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempCustomRadio.text"));
1124 tempCustomRadio.addActionListener(
new java.awt.event.ActionListener() {
1125 public void actionPerformed(java.awt.event.ActionEvent evt) {
1126 tempCustomRadioActionPerformed(evt);
1130 tempOnCustomNoPath.setForeground(java.awt.Color.RED);
1131 org.openide.awt.Mnemonics.setLocalizedText(tempOnCustomNoPath,
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempOnCustomNoPath.text"));
1133 javax.swing.GroupLayout tempDirectoryPanelLayout =
new javax.swing.GroupLayout(tempDirectoryPanel);
1134 tempDirectoryPanel.setLayout(tempDirectoryPanelLayout);
1135 tempDirectoryPanelLayout.setHorizontalGroup(
1136 tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1137 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1139 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1140 .addComponent(tempLocalRadio)
1141 .addComponent(tempCaseRadio)
1142 .addComponent(tempDirectoryWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
1143 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1144 .addComponent(tempCustomRadio)
1145 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1146 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1147 .addComponent(tempOnCustomNoPath)
1148 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1149 .addComponent(tempCustomField, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)
1150 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1151 .addComponent(tempDirectoryBrowseButton)))))
1152 .addContainerGap(164, Short.MAX_VALUE))
1154 tempDirectoryPanelLayout.setVerticalGroup(
1155 tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1156 .addGroup(tempDirectoryPanelLayout.createSequentialGroup()
1158 .addComponent(tempLocalRadio)
1159 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1160 .addComponent(tempCaseRadio)
1161 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1162 .addGroup(tempDirectoryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1163 .addComponent(tempCustomRadio)
1164 .addComponent(tempCustomField)
1165 .addComponent(tempDirectoryBrowseButton))
1166 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1167 .addComponent(tempOnCustomNoPath)
1168 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1169 .addComponent(tempDirectoryWarningLabel)
1170 .addGap(14, 14, 14))
1173 gridBagConstraints =
new java.awt.GridBagConstraints();
1174 gridBagConstraints.gridx = 0;
1175 gridBagConstraints.gridy = 1;
1176 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1177 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1178 mainPanel.add(tempDirectoryPanel, gridBagConstraints);
1179 tempDirectoryPanel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.tempDirectoryPanel.AccessibleContext.accessibleName"));
1181 rdpPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.rdpPanel.border.title")));
1182 rdpPanel.setMinimumSize(
new java.awt.Dimension(33, 100));
1183 rdpPanel.setPreferredSize(
new java.awt.Dimension(100, 150));
1184 rdpPanel.setLayout(
new java.awt.GridBagLayout());
1186 sizingScrollPane.setBorder(null);
1188 sizingTextPane.setEditable(
false);
1189 sizingTextPane.setBorder(null);
1190 sizingTextPane.setText(
org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class,
"AutopsyOptionsPanel.sizingTextPane.text"));
1191 sizingTextPane.setOpaque(
false);
1192 sizingScrollPane.setViewportView(sizingTextPane);
1194 gridBagConstraints =
new java.awt.GridBagConstraints();
1195 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1196 gridBagConstraints.weightx = 1.0;
1197 gridBagConstraints.weighty = 1.0;
1198 rdpPanel.add(sizingScrollPane, gridBagConstraints);
1200 gridBagConstraints =
new java.awt.GridBagConstraints();
1201 gridBagConstraints.gridy = 3;
1202 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1203 mainPanel.add(rdpPanel, gridBagConstraints);
1204 gridBagConstraints =
new java.awt.GridBagConstraints();
1205 gridBagConstraints.gridx = 1;
1206 gridBagConstraints.gridy = 0;
1207 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1208 gridBagConstraints.weightx = 1.0;
1209 mainPanel.add(filler1, gridBagConstraints);
1210 gridBagConstraints =
new java.awt.GridBagConstraints();
1211 gridBagConstraints.gridx = 0;
1212 gridBagConstraints.gridy = 4;
1213 gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
1214 gridBagConstraints.weighty = 1.0;
1215 mainPanel.add(filler2, gridBagConstraints);
1217 jScrollPane1.setViewportView(mainPanel);
1219 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1220 this.setLayout(layout);
1221 layout.setHorizontalGroup(
1222 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1223 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 860, Short.MAX_VALUE)
1225 layout.setVerticalGroup(
1226 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1227 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 620, Short.MAX_VALUE)
1232 "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title=Path cannot be used",
1234 "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description=Unable to create temporary directory within specified path: {0}",})
1235 private void tempDirectoryBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {
1236 if(tempDirChooser == null) {
1237 tempDirChooser = tempChooserHelper.getChooser();
1238 tempDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
1239 tempDirChooser.setMultiSelectionEnabled(
false);
1241 int returnState = tempDirChooser.showOpenDialog(
this);
1242 if (returnState == JFileChooser.APPROVE_OPTION) {
1243 String specifiedPath = tempDirChooser.getSelectedFile().getPath();
1245 File f =
new File(specifiedPath);
1246 if (!f.exists() && !f.mkdirs()) {
1247 throw new InvalidPathException(specifiedPath,
"Unable to create parent directories leading to " + specifiedPath);
1249 tempCustomField.setText(specifiedPath);
1250 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1251 }
catch (InvalidPathException ex) {
1252 logger.log(Level.WARNING,
"Unable to create temporary directory in " + specifiedPath, ex);
1253 JOptionPane.showMessageDialog(
this,
1254 Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description(specifiedPath),
1255 Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title(),
1256 JOptionPane.ERROR_MESSAGE);
1261 private void solrMaxHeapSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {
1262 int value = (int) solrMaxHeapSpinner.getValue();
1263 if (value == UserPreferences.getMaxSolrVMSize()) {
1267 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1270 private void logFileCountKeyReleased(java.awt.event.KeyEvent evt) {
1271 String count = logFileCount.getText();
1272 if (count.equals(String.valueOf(UserPreferences.getDefaultLogFileCount()))) {
1276 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1279 private void memFieldKeyReleased(java.awt.event.KeyEvent evt) {
1280 String memText = memField.getText();
1281 if (memText.equals(initialMemValue)) {
1285 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1288 private void specifyLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
1289 agencyLogoPathField.setEnabled(
true);
1290 browseLogosButton.setEnabled(
true);
1292 if (agencyLogoPathField.getText().isEmpty()) {
1293 String path = reportBranding.getAgencyLogoPath();
1294 if (path != null && !path.isEmpty()) {
1295 updateAgencyLogo(path);
1298 }
catch (IOException ex) {
1299 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path.", ex);
1301 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1304 private void defaultLogoRBActionPerformed(java.awt.event.ActionEvent evt) {
1305 agencyLogoPathField.setEnabled(
false);
1306 browseLogosButton.setEnabled(
false);
1308 updateAgencyLogo(
"");
1309 }
catch (IOException ex) {
1311 logger.log(Level.SEVERE,
"Unexpected error occurred while updating the agency logo.", ex);
1313 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1316 private void browseLogosButtonActionPerformed(java.awt.event.ActionEvent evt) {
1317 if(logoFileChooser == null) {
1318 logoFileChooser = logoChooserHelper.getChooser();
1319 logoFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1320 logoFileChooser.setMultiSelectionEnabled(
false);
1321 logoFileChooser.setAcceptAllFileFilterUsed(
false);
1322 logoFileChooser.setFileFilter(
new GeneralFilter(GeneralFilter.GRAPHIC_IMAGE_EXTS, GeneralFilter.GRAPHIC_IMG_DECR));
1324 String oldLogoPath = agencyLogoPathField.getText();
1325 int returnState = logoFileChooser.showOpenDialog(
this);
1326 if (returnState == JFileChooser.APPROVE_OPTION) {
1327 String path = logoFileChooser.getSelectedFile().getPath();
1329 updateAgencyLogo(path);
1330 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1331 }
catch (IOException | IndexOutOfBoundsException ex) {
1332 JOptionPane.showMessageDialog(
this,
1333 NbBundle.getMessage(
this.getClass(),
1334 "AutopsyOptionsPanel.invalidImageFile.msg"),
1335 NbBundle.getMessage(
this.getClass(),
"AutopsyOptionsPanel.invalidImageFile.title"),
1336 JOptionPane.ERROR_MESSAGE);
1338 updateAgencyLogo(oldLogoPath);
1339 }
catch (IOException ex1) {
1340 logger.log(Level.WARNING,
"Error loading image from previously saved agency logo path", ex1);
1346 private void tempLocalRadioActionPerformed(java.awt.event.ActionEvent evt) {
1347 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1348 evaluateTempDirState();
1351 private void tempCaseRadioActionPerformed(java.awt.event.ActionEvent evt) {
1352 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1353 evaluateTempDirState();
1356 private void tempCustomRadioActionPerformed(java.awt.event.ActionEvent evt) {
1357 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1358 evaluateTempDirState();
1362 "AutopsyOptionsPanel_heapDumpBrowseButtonActionPerformed_fileAlreadyExistsTitle=File Already Exists",
1363 "AutopsyOptionsPanel_heapDumpBrowseButtonActionPerformed_fileAlreadyExistsMessage=File already exists. Please select a new location."
1365 private void heapDumpBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {
1366 if(heapFileChooser == null) {
1367 heapFileChooser = heapChooserHelper.getChooser();
1368 heapFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
1369 heapFileChooser.setMultiSelectionEnabled(
false);
1371 String oldHeapPath = heapDumpFileField.getText();
1372 if (!StringUtils.isBlank(oldHeapPath)) {
1373 heapFileChooser.setCurrentDirectory(
new File(oldHeapPath));
1376 int returnState = heapFileChooser.showOpenDialog(
this);
1377 if (returnState == JFileChooser.APPROVE_OPTION) {
1378 File selectedDirectory = heapFileChooser.getSelectedFile();
1379 heapDumpFileField.setText(selectedDirectory.getAbsolutePath());
1380 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1385 private javax.swing.JTextField agencyLogoPathField;
1386 private javax.swing.JLabel agencyLogoPathFieldValidationLabel;
1387 private javax.swing.JLabel agencyLogoPreview;
1388 private javax.swing.JButton browseLogosButton;
1389 private javax.swing.JRadioButton defaultLogoRB;
1390 private javax.swing.ButtonGroup displayTimesButtonGroup;
1391 private javax.swing.ButtonGroup fileSelectionButtonGroup;
1392 private javax.swing.JButton heapDumpBrowseButton;
1393 private javax.swing.JTextField heapDumpFileField;
1394 private javax.swing.JLabel heapFieldValidationLabel;
1395 private javax.swing.JLabel heapFileLabel;
1396 private javax.swing.JScrollPane jScrollPane1;
1397 private javax.swing.JTextField logFileCount;
1398 private javax.swing.JTextField logNumAlert;
1399 private javax.swing.JPanel logoPanel;
1400 private javax.swing.ButtonGroup logoSourceButtonGroup;
1401 private javax.swing.JLabel maxLogFileCount;
1402 private javax.swing.JLabel maxMemoryLabel;
1403 private javax.swing.JLabel maxMemoryUnitsLabel;
1404 private javax.swing.JLabel maxMemoryUnitsLabel1;
1405 private javax.swing.JLabel maxMemoryUnitsLabel2;
1406 private javax.swing.JLabel maxSolrMemoryLabel;
1407 private javax.swing.JTextField memField;
1408 private javax.swing.JLabel memFieldValidationLabel;
1409 private javax.swing.JPanel rdpPanel;
1410 private javax.swing.JLabel restartNecessaryWarning;
1411 private javax.swing.JPanel runtimePanel;
1412 private javax.swing.JLabel solrJVMHeapWarning;
1413 private javax.swing.JSpinner solrMaxHeapSpinner;
1414 private javax.swing.JRadioButton specifyLogoRB;
1415 private javax.swing.JLabel systemMemoryTotal;
1416 private javax.swing.JRadioButton tempCaseRadio;
1417 private javax.swing.JTextField tempCustomField;
1418 private javax.swing.JRadioButton tempCustomRadio;
1419 private javax.swing.ButtonGroup tempDirChoiceGroup;
1420 private javax.swing.JButton tempDirectoryBrowseButton;
1421 private javax.swing.JPanel tempDirectoryPanel;
1422 private javax.swing.JLabel tempDirectoryWarningLabel;
1423 private javax.swing.JRadioButton tempLocalRadio;
1424 private javax.swing.JLabel tempOnCustomNoPath;
1425 private javax.swing.JLabel totalMemoryLabel;
final String heapDumpPath
void insertUpdate(DocumentEvent e)
void removeUpdate(DocumentEvent e)
void changedUpdate(DocumentEvent e)