From faac2fa98f8b7ca621387fb60815948968f9efec Mon Sep 17 00:00:00 2001 From: jmillman Date: Thu, 4 Sep 2014 14:40:54 -0400 Subject: [PATCH] fix slideshow image cycling --- .../autopsy/imageanalyzer/gui/GroupPane.java | 14 +++++++++++--- .../autopsy/imageanalyzer/gui/SlideShowView.java | 7 +------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java index 737f96cd3e..b07df2993e 100644 --- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java +++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java @@ -547,7 +547,7 @@ public class GroupPane extends BorderPane implements GroupView { }); //listen to tile selection and make sure it is visible in scroll area - //TODO: make sure we are testing complete visability not just bounsd intersection + //TODO: make sure we are testing complete visability not just bounds intersection globalSelectionModel.lastSelectedProperty().addListener((observable, oldFileID, newFileId) -> { if (groupViewMode.get() == GroupViewMode.SLIDE_SHOW) { slideShowPane.setFile(newFileId); @@ -688,25 +688,32 @@ public class GroupPane extends BorderPane implements GroupView { if (selectionAnchorIndex == null) { selectionAnchorIndex = grouping.get().fileIds().indexOf(globalSelectionModel.lastSelectedProperty().get()); } + t.consume(); break; case UP: case DOWN: case LEFT: case RIGHT: - handleArrows(t); + if (groupViewMode.get() == GroupViewMode.TILE) { + handleArrows(t); + t.consume(); + } break; case PAGE_DOWN: getScrollBar().ifPresent((scrollBar) -> { scrollBar.adjustValue(1); }); + t.consume(); break; case PAGE_UP: getScrollBar().ifPresent((scrollBar) -> { scrollBar.adjustValue(0); }); + t.consume(); break; case ENTER: nextGroupAction.handle(null); + t.consume(); break; case SPACE: if (groupViewMode.get() == GroupViewMode.TILE) { @@ -714,11 +721,13 @@ public class GroupPane extends BorderPane implements GroupView { } else { activateTileViewer(); } + t.consume(); break; } if (groupViewMode.get() == GroupViewMode.TILE && categoryKeyCodes.contains(t.getCode()) && t.isAltDown()) { selectAllFiles(); + t.consume(); } if (globalSelectionModel.getSelected().isEmpty() == false) { switch (t.getCode()) { @@ -750,7 +759,6 @@ public class GroupPane extends BorderPane implements GroupView { } } - t.consume(); } private void handleArrows(KeyEvent t) { diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/SlideShowView.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/SlideShowView.java index 1482a7077a..05541c010a 100644 --- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/SlideShowView.java +++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/SlideShowView.java @@ -184,10 +184,7 @@ public class SlideShowView extends SingleDrawableViewBase implements TagUtils.Ta cycleSlideShowImage(1); t.consume(); break; - -// } - } }); @@ -275,9 +272,7 @@ public class SlideShowView extends SingleDrawableViewBase implements TagUtils.Ta final int size = groupPane.getGrouping().fileIds().size(); index += d; if (index < 0) { - index = size - 1; - } else if (index > size) { - index = 0; + index += size; } setFile(groupPane.getGrouping().fileIds().get(index));