mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge pull request #4267 from sleuthkit/release-4.9.0
Merge release 4.9.0 branch into develop branch
This commit is contained in:
commit
ca3c7469bf
@ -67,7 +67,6 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.HashSetManager;
|
|||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupManager;
|
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupManager;
|
||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState;
|
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
|
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.DataSource;
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
@ -253,6 +252,7 @@ public final class ImageGalleryController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Should the "forward" button on the history be enabled?
|
* Should the "forward" button on the history be enabled?
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ReadOnlyBooleanProperty getCanAdvance() {
|
public ReadOnlyBooleanProperty getCanAdvance() {
|
||||||
@ -261,6 +261,7 @@ public final class ImageGalleryController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Should the "Back" button on the history be enabled?
|
* Should the "Back" button on the history be enabled?
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ReadOnlyBooleanProperty getCanRetreat() {
|
public ReadOnlyBooleanProperty getCanRetreat() {
|
||||||
@ -268,10 +269,9 @@ public final class ImageGalleryController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the passed in group. Causes this group to
|
* Display the passed in group. Causes this group to get recorded in the
|
||||||
* get recorded in the history queue and observers of the
|
* history queue and observers of the current state will be notified and
|
||||||
* current state will be notified and update their panels/widgets
|
* update their panels/widgets appropriately.
|
||||||
* appropriately.
|
|
||||||
*
|
*
|
||||||
* @param newState
|
* @param newState
|
||||||
*/
|
*/
|
||||||
@ -282,6 +282,7 @@ public final class ImageGalleryController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the next group in the "forward" history stack
|
* Display the next group in the "forward" history stack
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public GroupViewState advance() {
|
public GroupViewState advance() {
|
||||||
@ -290,6 +291,7 @@ public final class ImageGalleryController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the previous group in the "back" history stack
|
* Display the previous group in the "back" history stack
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public GroupViewState retreat() {
|
public GroupViewState retreat() {
|
||||||
@ -433,10 +435,6 @@ public final class ImageGalleryController {
|
|||||||
return drawableDB.getFileFromID(fileID);
|
return drawableDB.getFileFromID(fileID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlyDoubleProperty regroupProgress() {
|
|
||||||
return groupManager.regroupProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashSetManager getHashSetManager() {
|
public HashSetManager getHashSetManager() {
|
||||||
return hashSetManager;
|
return hashSetManager;
|
||||||
}
|
}
|
||||||
@ -697,8 +695,9 @@ public final class ImageGalleryController {
|
|||||||
//do in transaction
|
//do in transaction
|
||||||
drawableDbTransaction = taskDB.beginTransaction();
|
drawableDbTransaction = taskDB.beginTransaction();
|
||||||
|
|
||||||
/* We are going to periodically commit the CaseDB transaction and sleep so
|
/* We are going to periodically commit the CaseDB transaction
|
||||||
* that the user can have Autopsy do other stuff while these bulk tasks are ongoing.
|
* and sleep so that the user can have Autopsy do other stuff
|
||||||
|
* while these bulk tasks are ongoing.
|
||||||
*/
|
*/
|
||||||
int caseDbCounter = 0;
|
int caseDbCounter = 0;
|
||||||
for (final AbstractFile f : files) {
|
for (final AbstractFile f : files) {
|
||||||
|
@ -336,8 +336,9 @@ public class ImageGalleryModule {
|
|||||||
try {
|
try {
|
||||||
ImageGalleryController con = getController();
|
ImageGalleryController con = getController();
|
||||||
con.setStale(true);
|
con.setStale(true);
|
||||||
if (con.isListeningEnabled() && ImageGalleryTopComponent.isImageGalleryOpen()) {
|
if (con.isListeningEnabled()) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
if (ImageGalleryTopComponent.isImageGalleryOpen()) {
|
||||||
int showAnswer = JOptionPane.showConfirmDialog(ImageGalleryTopComponent.getTopComponent(),
|
int showAnswer = JOptionPane.showConfirmDialog(ImageGalleryTopComponent.getTopComponent(),
|
||||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_msg(),
|
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_msg(),
|
||||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_title(),
|
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_title(),
|
||||||
@ -352,6 +353,7 @@ public class ImageGalleryModule {
|
|||||||
default:
|
default:
|
||||||
break; //do nothing
|
break; //do nothing
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
@ -68,13 +68,6 @@ public class DrawableGroup implements Comparable<DrawableGroup> {
|
|||||||
DrawableGroup(GroupKey<?> groupKey, Set<Long> filesInGroup, boolean seen) {
|
DrawableGroup(GroupKey<?> groupKey, Set<Long> filesInGroup, boolean seen) {
|
||||||
this.groupKey = groupKey;
|
this.groupKey = groupKey;
|
||||||
this.fileIDs.setAll(filesInGroup);
|
this.fileIDs.setAll(filesInGroup);
|
||||||
fileIDs.addListener((ListChangeListener.Change<? extends Long> listchange) -> {
|
|
||||||
boolean seenChanged = false;
|
|
||||||
while (false == seenChanged && listchange.next()) {
|
|
||||||
seenChanged |= listchange.wasAdded();
|
|
||||||
}
|
|
||||||
invalidateProperties(seenChanged);
|
|
||||||
});
|
|
||||||
this.seen.set(seen);
|
this.seen.set(seen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,15 +176,21 @@ public class DrawableGroup implements Comparable<DrawableGroup> {
|
|||||||
if (fileIDs.contains(f) == false) {
|
if (fileIDs.contains(f) == false) {
|
||||||
fileIDs.add(f);
|
fileIDs.add(f);
|
||||||
}
|
}
|
||||||
|
// invalidate no matter what because the file could have new hash hits, etc.
|
||||||
|
invalidateProperties(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void setFiles(Set<? extends Long> newFileIds) {
|
synchronized void setFiles(Set<? extends Long> newFileIds) {
|
||||||
fileIDs.removeIf(fileID -> newFileIds.contains(fileID) == false);
|
fileIDs.removeIf(fileID -> newFileIds.contains(fileID) == false);
|
||||||
|
invalidateProperties(false);
|
||||||
newFileIds.stream().forEach(this::addFile);
|
newFileIds.stream().forEach(this::addFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void removeFile(Long f) {
|
synchronized void removeFile(Long f) {
|
||||||
|
if (fileIDs.contains(f)) {
|
||||||
fileIDs.removeAll(f);
|
fileIDs.removeAll(f);
|
||||||
|
invalidateProperties(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void invalidateProperties(boolean seenChanged) {
|
private void invalidateProperties(boolean seenChanged) {
|
||||||
|
@ -50,6 +50,7 @@ import javafx.beans.property.ReadOnlyBooleanWrapper;
|
|||||||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||||
|
import javafx.beans.property.ReadOnlyStringProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.concurrent.Service;
|
import javafx.concurrent.Service;
|
||||||
@ -278,8 +279,8 @@ public class GroupManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update unseenGroups list accordingly based on the current status
|
* Update unseenGroups list accordingly based on the current status of
|
||||||
* of 'group'. Removes it if it is seen or adds it if it is unseen.
|
* 'group'. Removes it if it is seen or adds it if it is unseen.
|
||||||
*
|
*
|
||||||
* @param group
|
* @param group
|
||||||
*/
|
*/
|
||||||
@ -505,6 +506,10 @@ public class GroupManager {
|
|||||||
return regrouper.progressProperty();
|
return regrouper.progressProperty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ReadOnlyStringProperty regroupMessage() {
|
||||||
|
return regrouper.messageProperty();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
synchronized public void handleTagAdded(ContentTagAddedEvent evt) {
|
synchronized public void handleTagAdded(ContentTagAddedEvent evt) {
|
||||||
GroupKey<?> newGroupKey = null;
|
GroupKey<?> newGroupKey = null;
|
||||||
@ -730,12 +735,7 @@ public class GroupManager {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
@NbBundle.Messages({"# {0} - groupBy attribute Name",
|
@NbBundle.Messages({"# {0} - groupBy attribute Name",
|
||||||
"# {1} - sortBy name",
|
"ReGroupTask.displayTitle=regrouping by {0}: " })
|
||||||
"# {2} - sort Order",
|
|
||||||
"ReGroupTask.displayTitle=regrouping files by {0} sorted by {1} in {2} order",
|
|
||||||
"# {0} - groupBy attribute Name",
|
|
||||||
"# {1} - atribute value",
|
|
||||||
"ReGroupTask.progressUpdate=regrouping files by {0} : {1}"})
|
|
||||||
class ReGroupTask<AttrValType extends Comparable<AttrValType>> extends LoggedTask<Void> {
|
class ReGroupTask<AttrValType extends Comparable<AttrValType>> extends LoggedTask<Void> {
|
||||||
|
|
||||||
private final DataSource dataSource;
|
private final DataSource dataSource;
|
||||||
@ -743,16 +743,14 @@ public class GroupManager {
|
|||||||
private final GroupSortBy sortBy;
|
private final GroupSortBy sortBy;
|
||||||
private final SortOrder sortOrder;
|
private final SortOrder sortOrder;
|
||||||
|
|
||||||
private final ProgressHandle groupProgress;
|
|
||||||
|
|
||||||
ReGroupTask(DataSource dataSource, DrawableAttribute<AttrValType> groupBy, GroupSortBy sortBy, SortOrder sortOrder) {
|
ReGroupTask(DataSource dataSource, DrawableAttribute<AttrValType> groupBy, GroupSortBy sortBy, SortOrder sortOrder) {
|
||||||
super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.getDisplayName(), sortOrder.toString()), true);
|
super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString() ), true);
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
this.groupBy = groupBy;
|
this.groupBy = groupBy;
|
||||||
this.sortBy = sortBy;
|
this.sortBy = sortBy;
|
||||||
this.sortOrder = sortOrder;
|
this.sortOrder = sortOrder;
|
||||||
|
|
||||||
groupProgress = ProgressHandle.createHandle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.getDisplayName(), sortOrder.toString()), this);
|
updateTitle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -761,7 +759,8 @@ public class GroupManager {
|
|||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
groupProgress.start();
|
|
||||||
|
updateProgress(-1, 1);
|
||||||
|
|
||||||
analyzedGroups.clear();
|
analyzedGroups.clear();
|
||||||
unSeenGroups.clear();
|
unSeenGroups.clear();
|
||||||
@ -769,7 +768,7 @@ public class GroupManager {
|
|||||||
// Get the list of group keys
|
// Get the list of group keys
|
||||||
Multimap<DataSource, AttrValType> valsByDataSource = findValuesForAttribute();
|
Multimap<DataSource, AttrValType> valsByDataSource = findValuesForAttribute();
|
||||||
|
|
||||||
groupProgress.switchToDeterminate(valsByDataSource.entries().size());
|
updateProgress(0, valsByDataSource.entries().size());
|
||||||
int p = 0;
|
int p = 0;
|
||||||
// For each key value, partially create the group and add it to the list.
|
// For each key value, partially create the group and add it to the list.
|
||||||
for (final Map.Entry<DataSource, AttrValType> valForDataSource : valsByDataSource.entries()) {
|
for (final Map.Entry<DataSource, AttrValType> valForDataSource : valsByDataSource.entries()) {
|
||||||
@ -777,9 +776,8 @@ public class GroupManager {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), valForDataSource.getValue()));
|
updateMessage(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString()) + valForDataSource.getValue());
|
||||||
updateProgress(p, valsByDataSource.size());
|
updateProgress(p, valsByDataSource.size());
|
||||||
groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), valForDataSource), p);
|
|
||||||
popuplateIfAnalyzed(new GroupKey<>(groupBy, valForDataSource.getValue(), valForDataSource.getKey()), this);
|
popuplateIfAnalyzed(new GroupKey<>(groupBy, valForDataSource.getValue(), valForDataSource.getKey()), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,8 +806,8 @@ public class GroupManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
groupProgress.finish();
|
|
||||||
updateProgress(1, 1);
|
updateProgress(1, 1);
|
||||||
|
updateMessage("");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -827,12 +825,9 @@ public class GroupManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find the distinct values for the given column (DrawableAttribute)
|
* Find the distinct values for the given column (DrawableAttribute).
|
||||||
*
|
|
||||||
* These values represent the groups of files.
|
* These values represent the groups of files.
|
||||||
*
|
*
|
||||||
* @param groupBy
|
|
||||||
*
|
|
||||||
* @return map of data source (or null if group by attribute ignores
|
* @return map of data source (or null if group by attribute ignores
|
||||||
* data sources) to list of unique group values
|
* data sources) to list of unique group values
|
||||||
*/
|
*/
|
||||||
|
@ -10,12 +10,21 @@
|
|||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.StackPane?>
|
<?import javafx.scene.layout.StackPane?>
|
||||||
|
|
||||||
<fx:root id="AnchorPane" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" type="javafx.scene.layout.AnchorPane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
|
<fx:root id="AnchorPane" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" type="javafx.scene.layout.AnchorPane" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
<children>
|
<children>
|
||||||
<BorderPane minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<BorderPane minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<right>
|
<right>
|
||||||
<HBox alignment="CENTER_RIGHT" prefHeight="-1.0" prefWidth="-1.0" spacing="5.0" BorderPane.alignment="CENTER_RIGHT">
|
<HBox alignment="CENTER_RIGHT" prefHeight="-1.0" prefWidth="-1.0" spacing="5.0" BorderPane.alignment="CENTER_RIGHT">
|
||||||
<children>
|
<children>
|
||||||
|
<Label fx:id="staleLabel" text="Some data may be out of date. Enable listening to ingest to update.">
|
||||||
|
<graphic>
|
||||||
|
<ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/information.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</graphic>
|
||||||
|
</Label>
|
||||||
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="NEVER">
|
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ProgressBar id="progBar" fx:id="fileTaskProgresBar" focusTraversable="false" maxHeight="-1.0" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-1.0" prefHeight="24.0" prefWidth="-1.0" progress="0.0" visible="true" />
|
<ProgressBar id="progBar" fx:id="fileTaskProgresBar" focusTraversable="false" maxHeight="-1.0" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-1.0" prefHeight="24.0" prefWidth="-1.0" progress="0.0" visible="true" />
|
||||||
@ -29,21 +38,6 @@
|
|||||||
</children>
|
</children>
|
||||||
<HBox.margin>
|
<HBox.margin>
|
||||||
<Insets />
|
<Insets />
|
||||||
</HBox.margin>
|
|
||||||
</StackPane>
|
|
||||||
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="NEVER">
|
|
||||||
<children>
|
|
||||||
<ProgressBar fx:id="bgTaskProgressBar" maxHeight="-1.0" maxWidth="-1.0" minHeight="-Infinity" minWidth="-1.0" prefHeight="24.0" prefWidth="-1.0" progress="0.0" StackPane.alignment="CENTER" />
|
|
||||||
<Label fx:id="bgTaskLabel" alignment="CENTER" cache="false" contentDisplay="CENTER" disable="false" focusTraversable="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" text="" StackPane.alignment="CENTER">
|
|
||||||
<StackPane.margin>
|
|
||||||
<Insets left="3.0" right="3.0" />
|
|
||||||
</StackPane.margin>
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
|
||||||
</padding></Label>
|
|
||||||
</children>
|
|
||||||
<HBox.margin>
|
|
||||||
<Insets right="5.0" />
|
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</children>
|
</children>
|
||||||
@ -52,15 +46,20 @@
|
|||||||
</BorderPane.margin>
|
</BorderPane.margin>
|
||||||
</HBox>
|
</HBox>
|
||||||
</right>
|
</right>
|
||||||
<left><Label fx:id="staleLabel" text="Some data may be out of date. Enable listening to ingest to update." BorderPane.alignment="CENTER">
|
<left>
|
||||||
<graphic><ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
|
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" BorderPane.alignment="CENTER">
|
||||||
<image>
|
<children>
|
||||||
<Image url="@../images/information.png" />
|
<ProgressBar fx:id="regroupProgressBar" maxHeight="-1.0" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-1.0" prefHeight="24.0" prefWidth="500.0" progress="0.0" StackPane.alignment="CENTER_LEFT" />
|
||||||
</image></ImageView>
|
<Label fx:id="regroupLabel" cache="false" contentDisplay="CENTER" disable="false" focusTraversable="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="500.0" text="" textOverrun="CENTER_ELLIPSIS" StackPane.alignment="CENTER_LEFT">
|
||||||
</graphic>
|
<StackPane.margin>
|
||||||
<BorderPane.margin>
|
<Insets left="3.0" right="3.0" />
|
||||||
<Insets bottom="5.0" left="5.0" right="10.0" top="5.0" />
|
</StackPane.margin>
|
||||||
</BorderPane.margin></Label>
|
<padding>
|
||||||
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
|
</padding>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</StackPane>
|
||||||
</left>
|
</left>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
</children>
|
</children>
|
||||||
|
@ -28,28 +28,26 @@ import javafx.scene.control.Tooltip;
|
|||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
||||||
|
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class StatusBar extends AnchorPane {
|
public class StatusBar extends AnchorPane {
|
||||||
|
|
||||||
private final ImageGalleryController controller;
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private ProgressBar fileTaskProgresBar;
|
private ProgressBar fileTaskProgresBar;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Label fileUpdateTaskLabel;
|
private Label fileUpdateTaskLabel;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Label bgTaskLabel;
|
private Label regroupLabel;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Label staleLabel;
|
private Label staleLabel;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private ProgressBar bgTaskProgressBar;
|
private ProgressBar regroupProgressBar;
|
||||||
|
|
||||||
|
private final ImageGalleryController controller;
|
||||||
|
private final GroupManager groupManager;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@NbBundle.Messages({"StatusBar.fileUpdateTaskLabel.text= File Update Tasks",
|
@NbBundle.Messages({"StatusBar.fileUpdateTaskLabel.text= File Update Tasks",
|
||||||
@ -58,23 +56,25 @@ public class StatusBar extends AnchorPane {
|
|||||||
void initialize() {
|
void initialize() {
|
||||||
assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
||||||
assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
||||||
assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
assert regroupLabel != null : "fx:id=\"regroupLabel\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
||||||
assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
assert regroupProgressBar != null : "fx:id=\"regroupProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'.";
|
||||||
|
|
||||||
fileUpdateTaskLabel.textProperty().bind(controller.getDBTasksQueueSizeProperty().asString().concat(Bundle.StatusBar_fileUpdateTaskLabel_text()));
|
fileUpdateTaskLabel.textProperty().bind(controller.getDBTasksQueueSizeProperty().asString().concat(Bundle.StatusBar_fileUpdateTaskLabel_text()));
|
||||||
fileTaskProgresBar.progressProperty().bind(controller.getDBTasksQueueSizeProperty().negate());
|
fileTaskProgresBar.progressProperty().bind(controller.getDBTasksQueueSizeProperty().negate());
|
||||||
|
|
||||||
controller.regroupProgress().addListener((ov, oldSize, newSize) -> {
|
groupManager.regroupProgress().addListener((ov, oldSize, newSize) -> {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
if (controller.regroupProgress().lessThan(1.0).get()) {
|
if (groupManager.regroupProgress().lessThan(1.0).get()) {
|
||||||
// Regrouping in progress
|
// Regrouping in progress
|
||||||
bgTaskProgressBar.progressProperty().setValue(-1.0);
|
regroupProgressBar.progressProperty().setValue(groupManager.regroupProgress().doubleValue());
|
||||||
bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text());
|
regroupLabel.setText(groupManager.regroupMessage().get());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Clear the progress bar
|
// Clear the progress bar
|
||||||
bgTaskProgressBar.progressProperty().setValue(0.0);
|
regroupProgressBar.progressProperty().setValue(0.0);
|
||||||
bgTaskLabel.setText("");
|
regroupLabel.setText("");
|
||||||
}
|
}
|
||||||
|
regroupLabel.setTooltip(new Tooltip(regroupLabel.getText()));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -84,6 +84,7 @@ public class StatusBar extends AnchorPane {
|
|||||||
|
|
||||||
public StatusBar(ImageGalleryController controller) {
|
public StatusBar(ImageGalleryController controller) {
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
|
this.groupManager = controller.getGroupManager();
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS
|
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS
|
||||||
fxmlLoader.setRoot(this);
|
fxmlLoader.setRoot(this);
|
||||||
fxmlLoader.setController(this);
|
fxmlLoader.setController(this);
|
||||||
@ -93,6 +94,5 @@ public class StatusBar extends AnchorPane {
|
|||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
throw new RuntimeException(exception);
|
throw new RuntimeException(exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user