mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
move DrawableView and GroupPane to a new package
This commit is contained in:
parent
b8f22991a4
commit
05cefa388a
@ -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;
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
package org.sleuthkit.autopsy.imagegallery.gui;
|
||||
|
||||
|
||||
|
||||
public interface GroupView {
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
@ -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;
|
@ -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;
|
@ -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;
|
@ -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;
|
||||
|
@ -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();
|
@ -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() {
|
Loading…
x
Reference in New Issue
Block a user