Miscellaneous trival cleanup

This commit is contained in:
Peter J. Martel 2011-12-15 18:58:12 -05:00
parent c903011f7a
commit 53142025da
17 changed files with 25 additions and 33 deletions

View File

@ -60,7 +60,6 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
if (c instanceof JComponent) { // assume Swing components if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c; JComponent jc = (JComponent) c;
// Sets step number of a component // Sets step number of a component
// TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
// Sets steps names for a panel // Sets steps names for a panel
jc.putClientProperty("WizardPanel_contentData", steps); jc.putClientProperty("WizardPanel_contentData", steps);

View File

@ -54,7 +54,7 @@ import org.sleuthkit.datamodel.SleuthkitJNI.CaseDbHandle.AddImageProcess;
*/ */
public class Case { public class Case {
// change the CTL_MainWindow_Title in Bundle.properties as well if you change this value // change the CTL_MainWindow_Title in Bundle.properties as well if you change this value
private static final String autopsyVer = "3.0.0b2"; // current version of autopsy. Changed it when the version is changed private static final String autopsyVer = "3.0.0b2"; // current version of autopsy. Change it when the version is changed
private static final String appName = "Autopsy " + autopsyVer; private static final String appName = "Autopsy " + autopsyVer;
/** /**
@ -150,8 +150,7 @@ public class Case {
currentCase = newCase; currentCase = newCase;
pcs.firePropertyChange(CASE_CURRENT_CASE, null, currentCase); pcs.firePropertyChange(CASE_CURRENT_CASE, null, currentCase);
//TODO: This will fire off a bunch of stuff in CaseListener.propertyChange() // TODO: This will fire off a bunch of stuff in CaseListener.propertyChange() that should probably be migrated into here
// that should probably be migrated into here
pcs.firePropertyChange(CASE_NAME, "", currentCase.name); pcs.firePropertyChange(CASE_NAME, "", currentCase.name);
RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases

View File

@ -37,6 +37,7 @@ import org.sleuthkit.autopsy.logging.Log;
*/ */
@ServiceProvider(service = CaseOpenAction.class) @ServiceProvider(service = CaseOpenAction.class)
public final class CaseOpenAction implements ActionListener { public final class CaseOpenAction implements ActionListener {
private static final Logger logger = Logger.getLogger(CaseOpenAction.class.getName());
JFileChooser fc = new JFileChooser(); JFileChooser fc = new JFileChooser();
GeneralFilter autFilter = new GeneralFilter(new String[]{".aut"}, "AUTOPSY File (*.aut)", false); GeneralFilter autFilter = new GeneralFilter(new String[]{".aut"}, "AUTOPSY File (*.aut)", false);
@ -73,7 +74,7 @@ public final class CaseOpenAction implements ActionListener {
StartupWindow.getInstance().close(); StartupWindow.getInstance().close();
} catch (Exception ex) { } catch (Exception ex) {
// no need to show the error message to the user. // no need to show the error message to the user.
// TODO: But maybe put the error message in the log in the future. logger.log(Level.INFO, "Error closing startup window.", ex);
} }
try { try {
Case.open(path); // open the case Case.open(path); // open the case

View File

@ -119,7 +119,6 @@ public final class NewCaseWizardAction extends CallableSystemAction {
if (c instanceof JComponent) { // assume Swing components if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c; JComponent jc = (JComponent) c;
// Sets step number of a component // Sets step number of a component
// TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
// Sets steps names for a panel // Sets steps names for a panel
jc.putClientProperty("WizardPanel_contentData", steps); jc.putClientProperty("WizardPanel_contentData", steps);

View File

@ -191,7 +191,6 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cancelButtonActionPerformed }//GEN-LAST:event_cancelButtonActionPerformed

View File

@ -43,8 +43,7 @@ public interface DataContentViewer {
* instance returned by the Lookup as a factory for the instances that * instance returned by the Lookup as a factory for the instances that
* are actually used.) * are actually used.)
*/ */
// TODO: extract the factory method out into a seperate interface that // TODO: extract the factory method out into a seperate interface that is used for the Lookup.
// is used for the Lookup.
public DataContentViewer getInstance(); public DataContentViewer getInstance();
/** /**

View File

@ -274,7 +274,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont
@Override @Override
public void setNode(Node selectedNode) { public void setNode(Node selectedNode) {
if (selectedNode != null) { if (selectedNode != null) {
Content content = ((Node) selectedNode).getLookup().lookup(Content.class); Content content = (selectedNode).getLookup().lookup(Content.class);
if (content != null) { if (content != null) {
this.setDataView(content, 0, false); this.setDataView(content, 0, false);
return; return;

View File

@ -131,9 +131,7 @@ public class DataContentViewerPicture extends javax.swing.JPanel implements Data
} }
@Override @Override
public boolean isSupported(Node cNode) { public boolean isSupported(Node node) {
Node node = (Node) cNode;
if (node != null) { if (node != null) {
// Note: only supports JPG, GIF, and PNG for now // Note: only supports JPG, GIF, and PNG for now
return node.getDisplayName().toLowerCase().endsWith(".jpg") return node.getDisplayName().toLowerCase().endsWith(".jpg")

View File

@ -268,7 +268,7 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC
@Override @Override
public void setNode(Node selectedNode) { public void setNode(Node selectedNode) {
if (selectedNode != null) { if (selectedNode != null) {
Content content = ((Node) selectedNode).getLookup().lookup(Content.class); Content content = selectedNode.getLookup().lookup(Content.class);
if (content != null) { if (content != null) {
this.setDataView(content, 0, false); this.setDataView(content, 0, false);
return; return;

View File

@ -38,7 +38,6 @@ import org.openide.nodes.Node.PropertySet;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
// TODO We should not have anything specific to Image in here...
/** /**
* DataResult sortable table viewer * DataResult sortable table viewer
@ -145,13 +144,13 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
if (selectedNode != null) { if (selectedNode != null) {
hasChildren = ((Node) selectedNode).getChildren().getNodesCount() > 0; hasChildren = selectedNode.getChildren().getNodesCount() > 0;
} }
// if there's no selection node, do nothing // if there's no selection node, do nothing
if (hasChildren) { if (hasChildren) {
Node root = (Node) selectedNode; Node root = selectedNode;
if (!(root instanceof TableFilterNode)) { if (!(root instanceof TableFilterNode)) {
root = new TableFilterNode(root, true); root = new TableFilterNode(root, true);
@ -161,7 +160,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
OutlineView ov = ((OutlineView) this.tableScrollPanel); OutlineView ov = ((OutlineView) this.tableScrollPanel);
List<Node.Property> tempProps = new ArrayList<Node.Property>(Arrays.asList(getChildPropertyHeaders((Node) selectedNode))); List<Node.Property> tempProps = new ArrayList<Node.Property>(Arrays.asList(getChildPropertyHeaders(selectedNode)));
tempProps.remove(0); tempProps.remove(0);

View File

@ -170,7 +170,7 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
//ignore //ignore
} }
url = null; // TODO add your handling code here: url = null;
}//GEN-LAST:event_jLabel1MouseClicked }//GEN-LAST:event_jLabel1MouseClicked
private void activateVerboseLogging(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_activateVerboseLogging private void activateVerboseLogging(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_activateVerboseLogging

View File

@ -35,7 +35,7 @@ class ThumbnailViewChildren extends FilterNode.Children {
/** the constructor */ /** the constructor */
ThumbnailViewChildren(Node arg) { ThumbnailViewChildren(Node arg) {
super((Node) arg); super(arg);
this.totalChildren = 1; this.totalChildren = 1;
} }

View File

@ -34,12 +34,14 @@ import org.sleuthkit.autopsy.logging.Log;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskException; import org.sleuthkit.datamodel.TskException;
// TODO: clean up external viewer action
/** /**
* *
* @author jantonius * @author jantonius
*/ */
public class ExternalViewerAction extends AbstractAction { public class ExternalViewerAction extends AbstractAction {
private byte[] content; private byte[] content;
private Content contentObject; private Content contentObject;
private String fileName; private String fileName;

View File

@ -47,7 +47,7 @@ class NewWindowViewAction extends AbstractAction{
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Log.noteAction(this.getClass()); Log.noteAction(this.getClass());
String[] filePaths = ContentUtils.getDisplayPath(((Node) contentNode).getLookup().lookup(Content.class)); String[] filePaths = ContentUtils.getDisplayPath((contentNode).getLookup().lookup(Content.class));
String filePath = DataConversion.getformattedPath(filePaths, 0); String filePath = DataConversion.getformattedPath(filePaths, 0);
DataContentTopComponent dctc = DataContentTopComponent.createUndocked(filePath, this.contentNode); DataContentTopComponent dctc = DataContentTopComponent.createUndocked(filePath, this.contentNode);

View File

@ -84,8 +84,7 @@ class ShowDetailActionVisitor extends ContentVisitor.Default<List<? extends Acti
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// TODO: fix log action Log.noteAction(ShowDetailActionVisitor.class);
Log.noteAction(this.getClass());
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal
@ -146,9 +145,8 @@ class ShowDetailActionVisitor extends ContentVisitor.Default<List<? extends Acti
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// TODO: fix log action Log.noteAction(ShowDetailActionVisitor.class);
Log.noteAction(this.getClass());
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal
@ -237,9 +235,7 @@ class ShowDetailActionVisitor extends ContentVisitor.Default<List<? extends Acti
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Log.noteAction(ShowDetailActionVisitor.class);
// TODO: fix log action
Log.noteAction(this.getClass());
final JFrame frame = new JFrame(title); final JFrame frame = new JFrame(title);
final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window to be modal

View File

@ -82,7 +82,6 @@ class DateSearchPanel extends javax.swing.JPanel {
} }
} }
//TODO: calendar button stuff
/** This method is called from within the constructor to /** This method is called from within the constructor to
* initialize the form. * initialize the form.
* WARNING: Do NOT modify this code. The content of this method is * WARNING: Do NOT modify this code. The content of this method is

View File

@ -71,8 +71,10 @@ class FilterArea extends JPanel {
private void init() { private void init() {
// TODO: this icon (and its twin) should be used in the toggle button
// this.dateFiltersButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/filesearch/arrow_down.gif"))); // NOI18N
// Commmented-out code is for collapable filter areas
// this.dateFiltersButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/filesearch/arrow_down.gif"))); // NOI18N
// toggleButton = new JButton(); // toggleButton = new JButton();
// toggleButton.setAlignmentX(Component.CENTER_ALIGNMENT); // toggleButton.setAlignmentX(Component.CENTER_ALIGNMENT);