cleanup, comments

This commit is contained in:
jmillman 2016-02-17 15:47:24 -05:00
parent 8c13846938
commit 4bc7a5dd30
4 changed files with 33 additions and 26 deletions

View File

@ -23,10 +23,10 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
@ -35,7 +35,7 @@
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="enabledByDefaultBox" min="-2" max="-2" attributes="0"/>
<Component id="enabledForCaseBox" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="descriptionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="descriptionLabel" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
<Component id="infoIconLabel" min="-2" max="-2" attributes="0"/>
@ -45,10 +45,11 @@
</Group>
<Component id="groupCategorizationWarningBox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="46" max="32767" attributes="0"/>
<EmptySpace min="0" pref="36" max="32767" attributes="0"/>
</Group>
<Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
<Component id="jSeparator1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -70,9 +71,9 @@
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="groupCategorizationWarningBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-15 Basis Technology Corp.
* Copyright 2013-16 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -23,11 +23,12 @@ import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.ingest.IngestManager;
/** The Image/Video Gallery panel in the NetBeans provided Options Dialogs
/**
* The Image/Video Gallery panel in the NetBeans provided Options Dialogs
* accessed via Tools -> Options
*
* Uses {@link ImageGalleryPreferences} and {@link PerCaseProperties} to
* persist settings
* Uses {@link ImageGalleryPreferences} and {@link PerCaseProperties} to persist
* settings
*/
final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
@ -49,10 +50,10 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
});
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@ -127,15 +128,16 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(enabledByDefaultBox)
.addComponent(enabledForCaseBox)
.addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(descriptionLabel, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(infoIconLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(furtherDescriptionArea, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(groupCategorizationWarningBox))
.addContainerGap(46, Short.MAX_VALUE))
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)))
.addGap(0, 36, Short.MAX_VALUE))
.addComponent(jSeparator1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -154,9 +156,9 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
.addComponent(furtherDescriptionArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(groupCategorizationWarningBox)
.addContainerGap())
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@ -172,7 +174,6 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
// TODO add your handling code here:
}//GEN-LAST:event_groupCategorizationWarningBoxActionPerformed
/** {@inheritDoc} */
void load() {
enabledByDefaultBox.setSelected(ImageGalleryPreferences.isEnabledByDefault());
if (Case.isCaseOpen() && IngestManager.getInstance().isIngestRunning() == false) {
@ -185,7 +186,6 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
groupCategorizationWarningBox.setSelected(ImageGalleryPreferences.isGroupCategorizationWarningDisabled());
}
/** {@inheritDoc } */
void store() {
ImageGalleryPreferences.setEnabledByDefault(enabledByDefaultBox.isSelected());
ImageGalleryController.getDefault().setListeningEnabled(enabledForCaseBox.isSelected());
@ -195,9 +195,9 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel {
ImageGalleryPreferences.setGroupCategorizationWarningDisabled(groupCategorizationWarningBox.isSelected());
}
/** {@inheritDoc }
*
* @return true, since there is no way for this form to be invalid */
/**
* @return true, since there is no way for this form to be invalid
*/
boolean valid() {
// TODO check whether form is consistent and complete
return true;

View File

@ -54,6 +54,12 @@ public class ImageGalleryPreferences {
preferences.putBoolean(ENABLED_BY_DEFAULT, b);
}
/**
* Return whether the warning about overwriting categories when acting on an
* entire group is disabled.
*
* @return true if the warning is disabled.
*/
public static boolean isGroupCategorizationWarningDisabled() {
final boolean aBoolean = preferences.getBoolean(GROUP_CATEGORIZATION_WARNING_DISABLED, false);
return aBoolean;

View File

@ -53,7 +53,7 @@ public class CategorizeGroupAction extends CategorizeAction {
ObservableList<Long> fileIDs = controller.viewState().get().getGroup().getFileIDs();
if (ImageGalleryPreferences.isGroupCategorizationWarningDisabled()) {
//if they have preveiously disabled the wrning, just go ahead and apply categories.
//if they have preveiously disabled the warning, just go ahead and apply categories.
addCatToFiles(ImmutableSet.copyOf(fileIDs));
} else {
final Map<Category, Long> catCountMap = new HashMap<>();