From f7d9b321380aecf6cb94e9de72e1b84a070b84bf Mon Sep 17 00:00:00 2001 From: APriestman Date: Mon, 20 Apr 2015 17:24:22 -0400 Subject: [PATCH] Fixed date format in ImageGallery details pane. Added exception handling for an error coming up when Autopsy was closed. --- .../imagegallery/datamodel/DrawableAttribute.java | 9 +++++---- .../sleuthkit/autopsy/imagegallery/gui/DrawableTile.java | 7 ++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index 1ff8639f2e..70667a7f83 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,6 +27,7 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; +import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; /** @@ -61,11 +62,11 @@ public class DrawableAttribute> { public final static DrawableAttribute PATH = new DrawableAttribute<>(AttributeName.PATH, "Path", true, "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); - public final static DrawableAttribute CREATED_TIME - = new DrawableAttribute<>( AttributeName.CREATED_TIME, "Created Time", true, "clock--plus.png", f -> Collections.singleton(f.getCrtime())); + public final static DrawableAttribute CREATED_TIME + = new DrawableAttribute<>( AttributeName.CREATED_TIME, "Created Time", true, "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); - public final static DrawableAttribute MODIFIED_TIME - = new DrawableAttribute<>( AttributeName.MODIFIED_TIME, "Modified Time", true, "clock--pencil.png", f -> Collections.singleton(f.getMtime())); + public final static DrawableAttribute MODIFIED_TIME + = new DrawableAttribute<>( AttributeName.MODIFIED_TIME, "Modified Time", true, "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = new DrawableAttribute<>( AttributeName.MAKE, "Camera Make", true, "camera.png", f -> Collections.singleton(f.getMake())); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java index 5eb44576f9..003cc676af 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.imagegallery.gui; import java.net.URL; import java.util.Objects; import java.util.ResourceBundle; +import java.util.logging.Level; import javafx.fxml.FXML; import javafx.scene.CacheHint; import javafx.scene.control.Control; @@ -88,7 +89,11 @@ public class DrawableTile extends SingleDrawableViewBase implements Category.Cat imageView.fitWidthProperty().bind(Toolbar.getDefault().sizeSliderValue()); globalSelectionModel.lastSelectedProperty().addListener((observable, oldValue, newValue) -> { - setEffect(Objects.equals(newValue, fileID) ? LAST_SELECTED_EFFECT : null); + try{ + setEffect(Objects.equals(newValue, fileID) ? LAST_SELECTED_EFFECT : null); + } catch (java.lang.IllegalStateException ex){ + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); + } }); }