diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index 850230cb88..658e523be9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -35,8 +35,8 @@ import org.openide.windows.Mode; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.imagegallery.gui.GroupPane; -import org.sleuthkit.autopsy.imagegallery.gui.MetaDataPane; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.GroupPane; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.MetaDataPane; import org.sleuthkit.autopsy.imagegallery.gui.StatusBar; import org.sleuthkit.autopsy.imagegallery.gui.SummaryTablePane; import org.sleuthkit.autopsy.imagegallery.gui.Toolbar; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupView.java deleted file mode 100644 index 73d2f3373c..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupView.java +++ /dev/null @@ -1,8 +0,0 @@ - -package org.sleuthkit.autopsy.imagegallery.gui; - - - -public interface GroupView { - -} diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.fxml b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.fxml similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.fxml rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.fxml diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java similarity index 95% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index 86a0b2ddee..86eed0a814 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import java.util.Objects; import java.util.logging.Level; @@ -32,7 +32,8 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.coreutils.ThreadConfined.ThreadType; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; -import static org.sleuthkit.autopsy.imagegallery.gui.DrawableTileBase.globalSelectionModel; +import org.sleuthkit.autopsy.imagegallery.gui.Toolbar; +import static org.sleuthkit.autopsy.imagegallery.gui.drawableviews.DrawableTileBase.globalSelectionModel; import org.sleuthkit.datamodel.AbstractContent; /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java similarity index 99% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTileBase.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 428bd0b5f4..ed12891589 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import com.google.common.eventbus.Subscribe; import java.util.ArrayList; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java similarity index 97% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableUIBase.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index ec794eabae..0657385aff 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import java.util.Objects; import static java.util.Objects.nonNull; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java similarity index 98% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableView.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 709679173e..6b9a532e86 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -1,4 +1,4 @@ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import com.google.common.eventbus.Subscribe; import java.util.Collection; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.fxml b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.fxml similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.fxml rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.fxml diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java similarity index 99% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index 09042abaf4..266b578f46 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -16,8 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.SlideShowView; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.DrawableTile; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Arrays; @@ -116,6 +118,8 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; import org.sleuthkit.autopsy.imagegallery.grouping.DrawableGroup; import org.sleuthkit.autopsy.imagegallery.grouping.GroupViewMode; import org.sleuthkit.autopsy.imagegallery.grouping.GroupViewState; +import org.sleuthkit.autopsy.imagegallery.gui.GuiUtils; +import org.sleuthkit.autopsy.imagegallery.gui.Toolbar; import org.sleuthkit.datamodel.TagName; import org.sleuthkit.datamodel.TskCoreException; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/MetaDataPane.fxml b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.fxml similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/MetaDataPane.fxml rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.fxml diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java similarity index 98% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/MetaDataPane.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 780513d16a..4814357a68 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import com.google.common.eventbus.Subscribe; import java.io.IOException; @@ -76,6 +76,20 @@ public class MetaDataPane extends DrawableUIBase { @FXML private BorderPane imageBorder; + public MetaDataPane(ImageGalleryController controller) { + super(controller); + + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MetaDataPane.fxml")); + fxmlLoader.setRoot(this); + fxmlLoader.setController(this); + + try { + fxmlLoader.load(); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + } + @FXML @SuppressWarnings("unchecked") void initialize() { @@ -137,7 +151,7 @@ public class MetaDataPane extends DrawableUIBase { } @Override - synchronized protected void setFileHelper(Long newFileID) { + protected synchronized void setFileHelper(Long newFileID) { setFileIDOpt(Optional.ofNullable(newFileID)); if (newFileID == null) { Platform.runLater(() -> { @@ -151,20 +165,6 @@ public class MetaDataPane extends DrawableUIBase { } } - public MetaDataPane(ImageGalleryController controller) { - super(controller); - - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MetaDataPane.fxml")); - fxmlLoader.setRoot(this); - fxmlLoader.setController(this); - - try { - fxmlLoader.load(); - } catch (IOException exception) { - throw new RuntimeException(exception); - } - } - public void updateUI() { getFile().ifPresent(file -> { final Image icon = file.getThumbnail(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SlideShow.fxml b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShow.fxml similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SlideShow.fxml rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShow.fxml diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java similarity index 95% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SlideShowView.java rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index d7d0f684ed..2b29e57d39 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.imagegallery.gui; +package org.sleuthkit.autopsy.imagegallery.gui.drawableviews; import java.util.ArrayList; import java.util.function.Function; @@ -58,13 +58,16 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; import org.sleuthkit.autopsy.imagegallery.datamodel.ImageFile; import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; -import static org.sleuthkit.autopsy.imagegallery.gui.DrawableView.CAT_BORDER_WIDTH; +import org.sleuthkit.autopsy.imagegallery.gui.GuiUtils; +import org.sleuthkit.autopsy.imagegallery.gui.MediaControl; +import static org.sleuthkit.autopsy.imagegallery.gui.drawableviews.DrawableView.CAT_BORDER_WIDTH; import org.sleuthkit.datamodel.TagName; import org.sleuthkit.datamodel.TskCoreException; /** * Displays the files of a group one at a time. Designed to be embedded in a * GroupPane. TODO: Extract a subclass for video files in slideshow mode-jm + * * TODO: reduce coupling to GroupPane */ public class SlideShowView extends DrawableTileBase { @@ -73,40 +76,36 @@ public class SlideShowView extends DrawableTileBase { @FXML private ToggleButton cat0Toggle; - + @FXML + private ToggleButton cat1Toggle; @FXML private ToggleButton cat2Toggle; + @FXML + private ToggleButton cat3Toggle; + @FXML + private ToggleButton cat4Toggle; + @FXML + private ToggleButton cat5Toggle; @FXML private SplitMenuButton tagSplitButton; - @FXML - private ToggleButton cat3Toggle; - @FXML private Region spring; - @FXML private Button leftButton; - - @FXML - private ToggleButton cat4Toggle; - - @FXML - private ToggleButton cat5Toggle; - - @FXML - private ToggleButton cat1Toggle; - @FXML private Button rightButton; - @FXML private ToolBar toolBar; - @FXML private BorderPane footer; + SlideShowView(GroupPane gp) { + super(gp); + FXMLConstructor.construct(this, "SlideShow.fxml"); + } + @FXML @Override protected void initialize() { @@ -145,6 +144,8 @@ public class SlideShowView extends DrawableTileBase { tagSplitButton.getItems().setAll(selTagMenues); } }); + + //configure category toggles cat0Toggle.setBorder(new Border(new BorderStroke(Category.ZERO.getColor(), BorderStrokeStyle.SOLID, new CornerRadii(1), new BorderWidths(1)))); cat1Toggle.setBorder(new Border(new BorderStroke(Category.ONE.getColor(), BorderStrokeStyle.SOLID, new CornerRadii(1), new BorderWidths(1)))); cat2Toggle.setBorder(new Border(new BorderStroke(Category.TWO.getColor(), BorderStrokeStyle.SOLID, new CornerRadii(1), new BorderWidths(1)))); @@ -176,9 +177,7 @@ public class SlideShowView extends DrawableTileBase { //set up key listener equivalents of buttons addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent t) -> { - if (t.getEventType() == KeyEvent.KEY_PRESSED) { - switch (t.getCode()) { case LEFT: cycleSlideShowImage(-1); @@ -220,20 +219,14 @@ public class SlideShowView extends DrawableTileBase { } } - SlideShowView(GroupPane gp) { - super(gp); - - FXMLConstructor.construct(this, "SlideShow.fxml"); - - } - - @ThreadConfined(type = ThreadType.UI) + @ThreadConfined(type = ThreadType.JFX) public void stopVideo() { if (imageBorder.getCenter() instanceof MediaControl) { ((MediaControl) imageBorder.getCenter()).stopVideo(); } } + /** {@inheritDoc } */ @Override synchronized public void setFile(final Long fileID) { super.setFile(fileID); @@ -255,6 +248,7 @@ public class SlideShowView extends DrawableTileBase { imageBorder.setCenter(null); } + /** {@inheritDoc } */ @Override protected Runnable getContentUpdateRunnable() { @@ -281,11 +275,20 @@ public class SlideShowView extends DrawableTileBase { }); } + /** {@inheritDoc } */ @Override protected String getTextForLabel() { return getFile().map(file -> file.getName()).orElse("") + " " + getSupplementalText(); } + /** + * cycle the image displayed in thes SlideShowview, to the next/previous one + * in the group. + * + * @param direction the direction to cycle: + * -1 => left / back + * 1 => right / forward + */ @ThreadConfined(type = ThreadType.JFX) private void cycleSlideShowImage(int direction) { stopVideo(); @@ -296,7 +299,6 @@ public class SlideShowView extends DrawableTileBase { }).orElse(0); setFile(getGroupPane().getGrouping().fileIds().get(nextIndex) ); - } /** @@ -310,6 +312,7 @@ public class SlideShowView extends DrawableTileBase { } + /** {@inheritDoc } */ @Override @ThreadConfined(type = ThreadType.ANY) public Category updateCategory() {