Skip to content

Commit

Permalink
update ImageAnalyzer to new API of ControlsFX 8.20.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillman committed Nov 12, 2014
1 parent f6be031 commit 7568bf8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
Expand Up @@ -23,14 +23,14 @@
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import org.controlsfx.control.action.AbstractAction;
import org.controlsfx.control.action.Action;
import org.sleuthkit.autopsy.imageanalyzer.ImageAnalyzerController;

/**
*
*
*/
//TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm
public class Back extends AbstractAction {
public class Back extends Action {

private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imageanalyzer/images/arrow-180.png", 16, 16, true, true, true);

Expand All @@ -42,10 +42,9 @@ public Back(ImageAnalyzerController controller) {
setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN));
this.controller = controller;
disabledProperty().bind(controller.getCanRetreat().not());
setEventHandler((ActionEvent ae) -> {
controller.retreat();
});
}

@Override
public void handle(ActionEvent ae) {
controller.retreat();
}
}
Expand Up @@ -23,14 +23,14 @@
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import org.controlsfx.control.action.AbstractAction;
import org.controlsfx.control.action.Action;
import org.sleuthkit.autopsy.imageanalyzer.ImageAnalyzerController;

/**
*
*/
//TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm
public class Forward extends AbstractAction {
public class Forward extends Action {

private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imageanalyzer/images/arrow.png", 16, 16, true, true, true);

Expand All @@ -42,10 +42,9 @@ public Forward(ImageAnalyzerController controller) {
setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN));
this.controller = controller;
disabledProperty().bind(controller.getCanAdvance().not());
}

@Override
public void handle(ActionEvent ae) {
controller.advance();
setEventHandler((ActionEvent t) -> {
controller.advance();
});
}
}
Expand Up @@ -21,14 +21,14 @@
import javafx.beans.Observable;
import javafx.event.ActionEvent;
import javafx.scene.image.ImageView;
import org.controlsfx.control.action.AbstractAction;
import org.controlsfx.control.action.Action;
import org.sleuthkit.autopsy.imageanalyzer.ImageAnalyzerController;
import org.sleuthkit.autopsy.imageanalyzer.grouping.GroupViewState;

/**
*
*/
public class NextUnseenGroup extends AbstractAction {
public class NextUnseenGroup extends Action {

private final ImageAnalyzerController controller;

Expand All @@ -40,15 +40,14 @@ public NextUnseenGroup(ImageAnalyzerController controller) {
controller.getGroupManager().getUnSeenGroups().addListener((Observable observable) -> {
disabledProperty().set(controller.getGroupManager().getUnSeenGroups().size() <= 1);
});
}

@Override
public void handle(ActionEvent event) {
if (controller.viewState() != null && controller.viewState().get() != null && controller.viewState().get().getGroup() != null) {
controller.getGroupManager().markGroupSeen(controller.viewState().get().getGroup());
}
if (controller.getGroupManager().getUnSeenGroups().size() > 0) {
controller.advance(GroupViewState.tile(controller.getGroupManager().getUnSeenGroups().get(0)));
}
setEventHandler((ActionEvent t) -> {
if (controller.viewState() != null && controller.viewState().get() != null && controller.viewState().get().getGroup() != null) {
controller.getGroupManager().markGroupSeen(controller.viewState().get().getGroup());
}
if (controller.getGroupManager().getUnSeenGroups().size() > 0) {
controller.advance(GroupViewState.tile(controller.getGroupManager().getUnSeenGroups().get(0)));
}
});
}
}

0 comments on commit 7568bf8

Please sign in to comment.