mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +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.GroupViewState;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.DataSource;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
@ -232,19 +231,19 @@ public final class ImageGalleryController {
|
||||
dbTaskQueueSize.addListener(obs -> this.updateRegroupDisabled());
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Currently displayed group or null if nothing is being displayed
|
||||
*/
|
||||
public GroupViewState getViewState() {
|
||||
return historyManager.getCurrentState();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get observable property of the current group. The UI currently changes
|
||||
* based on this property changing, which happens when other actions and
|
||||
* based on this property changing, which happens when other actions and
|
||||
* threads call advance().
|
||||
*
|
||||
*
|
||||
* @return Currently displayed group (as a property that can be observed)
|
||||
*/
|
||||
public ReadOnlyObjectProperty<GroupViewState> viewStateProperty() {
|
||||
@ -253,7 +252,8 @@ public final class ImageGalleryController {
|
||||
|
||||
/**
|
||||
* Should the "forward" button on the history be enabled?
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ReadOnlyBooleanProperty getCanAdvance() {
|
||||
return historyManager.getCanAdvance();
|
||||
@ -261,19 +261,19 @@ public final class ImageGalleryController {
|
||||
|
||||
/**
|
||||
* Should the "Back" button on the history be enabled?
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ReadOnlyBooleanProperty getCanRetreat() {
|
||||
return historyManager.getCanRetreat();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the passed in group. Causes this group to
|
||||
* get recorded in the history queue and observers of the
|
||||
* current state will be notified and update their panels/widgets
|
||||
* appropriately.
|
||||
*
|
||||
* @param newState
|
||||
* Display the passed in group. Causes this group to get recorded in the
|
||||
* history queue and observers of the current state will be notified and
|
||||
* update their panels/widgets appropriately.
|
||||
*
|
||||
* @param newState
|
||||
*/
|
||||
@ThreadConfined(type = ThreadConfined.ThreadType.ANY)
|
||||
public void advance(GroupViewState newState) {
|
||||
@ -282,7 +282,8 @@ public final class ImageGalleryController {
|
||||
|
||||
/**
|
||||
* Display the next group in the "forward" history stack
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public GroupViewState advance() {
|
||||
return historyManager.advance();
|
||||
@ -290,7 +291,8 @@ public final class ImageGalleryController {
|
||||
|
||||
/**
|
||||
* Display the previous group in the "back" history stack
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public GroupViewState retreat() {
|
||||
return historyManager.retreat();
|
||||
@ -433,10 +435,6 @@ public final class ImageGalleryController {
|
||||
return drawableDB.getFileFromID(fileID);
|
||||
}
|
||||
|
||||
public ReadOnlyDoubleProperty regroupProgress() {
|
||||
return groupManager.regroupProgress();
|
||||
}
|
||||
|
||||
public HashSetManager getHashSetManager() {
|
||||
return hashSetManager;
|
||||
}
|
||||
@ -696,16 +694,17 @@ public final class ImageGalleryController {
|
||||
// Cycle through all of the files returned and call processFile on each
|
||||
//do in transaction
|
||||
drawableDbTransaction = taskDB.beginTransaction();
|
||||
|
||||
/* We are going to periodically commit the CaseDB transaction and sleep so
|
||||
* that the user can have Autopsy do other stuff while these bulk tasks are ongoing.
|
||||
|
||||
/* We are going to periodically commit the CaseDB transaction
|
||||
* and sleep so that the user can have Autopsy do other stuff
|
||||
* while these bulk tasks are ongoing.
|
||||
*/
|
||||
int caseDbCounter = 0;
|
||||
for (final AbstractFile f : files) {
|
||||
if (caseDbTransaction == null) {
|
||||
caseDbTransaction = tskCase.beginTransaction();
|
||||
}
|
||||
|
||||
|
||||
if (isCancelled() || Thread.interrupted()) {
|
||||
logger.log(Level.WARNING, "Task cancelled or interrupted: not all contents may be transfered to drawable database."); //NON-NLS
|
||||
taskCompletionStatus = false;
|
||||
@ -720,7 +719,7 @@ public final class ImageGalleryController {
|
||||
progressHandle.progress(f.getName(), workDone);
|
||||
updateProgress(workDone - 1 / (double) files.size());
|
||||
updateMessage(f.getName());
|
||||
|
||||
|
||||
// Periodically, commit the transaction (which frees the lock) and sleep
|
||||
// to allow other threads to get some work done in CaseDB
|
||||
if ((++caseDbCounter % 200) == 0) {
|
||||
@ -740,12 +739,12 @@ public final class ImageGalleryController {
|
||||
caseDbTransaction.commit();
|
||||
caseDbTransaction = null;
|
||||
}
|
||||
|
||||
|
||||
// pass true so that groupmanager is notified of the changes
|
||||
taskDB.commitTransaction(drawableDbTransaction, true);
|
||||
drawableDbTransaction = null;
|
||||
|
||||
} catch (TskCoreException | InterruptedException ex) {
|
||||
} catch (TskCoreException | InterruptedException ex) {
|
||||
progressHandle.progress(Bundle.BulkTask_stopCopy_status());
|
||||
logger.log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents", ex); //NON-NLS
|
||||
MessageNotifyUtil.Notify.warn(Bundle.BulkTask_errPopulating_errMsg(), ex.getMessage());
|
||||
|
@ -154,14 +154,14 @@ public class ImageGalleryModule {
|
||||
IngestManager.getInstance().removeIngestModuleEventListener(this);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* only process individual files in realtime on the node that is
|
||||
* running the ingest. on a remote node, image files are processed
|
||||
* enblock when ingest is complete */
|
||||
if (((AutopsyEvent) evt).getSourceType() != AutopsyEvent.SourceType.LOCAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Bail out if the case is closed
|
||||
try {
|
||||
if (controller == null || Case.getCurrentCaseThrows() == null) {
|
||||
@ -208,8 +208,8 @@ public class ImageGalleryModule {
|
||||
}
|
||||
}
|
||||
else if (IngestManager.IngestModuleEvent.valueOf(evt.getPropertyName()) == DATA_ADDED) {
|
||||
ModuleDataEvent mde = (ModuleDataEvent)evt.getOldValue();
|
||||
|
||||
ModuleDataEvent mde = (ModuleDataEvent) evt.getOldValue();
|
||||
|
||||
if (mde.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()) {
|
||||
DrawableDB drawableDB = controller.getDatabase();
|
||||
if (mde.getArtifacts() != null) {
|
||||
@ -288,13 +288,13 @@ public class ImageGalleryModule {
|
||||
break;
|
||||
case CONTENT_TAG_ADDED:
|
||||
final ContentTagAddedEvent tagAddedEvent = (ContentTagAddedEvent) evt;
|
||||
|
||||
|
||||
long objId = tagAddedEvent.getAddedTag().getContent().getId();
|
||||
|
||||
|
||||
// update the cache
|
||||
DrawableDB drawableDB = controller.getDatabase();
|
||||
drawableDB.addTagCache(objId);
|
||||
|
||||
|
||||
if (con.getDatabase().isInDB(objId)) {
|
||||
con.getTagsManager().fireTagAddedEvent(tagAddedEvent);
|
||||
}
|
||||
@ -336,21 +336,23 @@ public class ImageGalleryModule {
|
||||
try {
|
||||
ImageGalleryController con = getController();
|
||||
con.setStale(true);
|
||||
if (con.isListeningEnabled() && ImageGalleryTopComponent.isImageGalleryOpen()) {
|
||||
if (con.isListeningEnabled()) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
int showAnswer = JOptionPane.showConfirmDialog(ImageGalleryTopComponent.getTopComponent(),
|
||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_msg(),
|
||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_title(),
|
||||
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||
if (ImageGalleryTopComponent.isImageGalleryOpen()) {
|
||||
int showAnswer = JOptionPane.showConfirmDialog(ImageGalleryTopComponent.getTopComponent(),
|
||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_msg(),
|
||||
Bundle.ImageGalleryController_dataSourceAnalyzed_confDlg_title(),
|
||||
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||
|
||||
switch (showAnswer) {
|
||||
case JOptionPane.YES_OPTION:
|
||||
con.rebuildDB();
|
||||
break;
|
||||
case JOptionPane.NO_OPTION:
|
||||
case JOptionPane.CANCEL_OPTION:
|
||||
default:
|
||||
break; //do nothing
|
||||
switch (showAnswer) {
|
||||
case JOptionPane.YES_OPTION:
|
||||
con.rebuildDB();
|
||||
break;
|
||||
case JOptionPane.NO_OPTION:
|
||||
case JOptionPane.CANCEL_OPTION:
|
||||
default:
|
||||
break; //do nothing
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -68,13 +68,6 @@ public class DrawableGroup implements Comparable<DrawableGroup> {
|
||||
DrawableGroup(GroupKey<?> groupKey, Set<Long> filesInGroup, boolean seen) {
|
||||
this.groupKey = groupKey;
|
||||
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);
|
||||
}
|
||||
|
||||
@ -183,15 +176,21 @@ public class DrawableGroup implements Comparable<DrawableGroup> {
|
||||
if (fileIDs.contains(f) == false) {
|
||||
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) {
|
||||
fileIDs.removeIf(fileID -> newFileIds.contains(fileID) == false);
|
||||
invalidateProperties(false);
|
||||
newFileIds.stream().forEach(this::addFile);
|
||||
}
|
||||
|
||||
synchronized void removeFile(Long f) {
|
||||
fileIDs.removeAll(f);
|
||||
if (fileIDs.contains(f)) {
|
||||
fileIDs.removeAll(f);
|
||||
invalidateProperties(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void invalidateProperties(boolean seenChanged) {
|
||||
|
@ -50,6 +50,7 @@ import javafx.beans.property.ReadOnlyBooleanWrapper;
|
||||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectWrapper;
|
||||
import javafx.beans.property.ReadOnlyStringProperty;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Service;
|
||||
@ -278,10 +279,10 @@ public class GroupManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update unseenGroups list accordingly based on the current status
|
||||
* of 'group'. Removes it if it is seen or adds it if it is unseen.
|
||||
*
|
||||
* @param group
|
||||
* Update unseenGroups list accordingly based on the current status of
|
||||
* 'group'. Removes it if it is seen or adds it if it is unseen.
|
||||
*
|
||||
* @param group
|
||||
*/
|
||||
synchronized private void updateUnSeenGroups(DrawableGroup group) {
|
||||
if (group.isSeen()) {
|
||||
@ -505,6 +506,10 @@ public class GroupManager {
|
||||
return regrouper.progressProperty();
|
||||
}
|
||||
|
||||
public ReadOnlyStringProperty regroupMessage() {
|
||||
return regrouper.messageProperty();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
synchronized public void handleTagAdded(ContentTagAddedEvent evt) {
|
||||
GroupKey<?> newGroupKey = null;
|
||||
@ -619,7 +624,7 @@ public class GroupManager {
|
||||
* If the group is analyzed (or other criteria based on grouping) and should
|
||||
* be shown to the user, then add it to the appropriate data structures so
|
||||
* that it can be viewed.
|
||||
*
|
||||
*
|
||||
* @returns null if Group is not ready to be viewed
|
||||
*/
|
||||
synchronized private DrawableGroup popuplateIfAnalyzed(GroupKey<?> groupKey, ReGroupTask<?> task) {
|
||||
@ -730,12 +735,7 @@ public class GroupManager {
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@NbBundle.Messages({"# {0} - groupBy attribute Name",
|
||||
"# {1} - sortBy name",
|
||||
"# {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}"})
|
||||
"ReGroupTask.displayTitle=regrouping by {0}: " })
|
||||
class ReGroupTask<AttrValType extends Comparable<AttrValType>> extends LoggedTask<Void> {
|
||||
|
||||
private final DataSource dataSource;
|
||||
@ -743,16 +743,14 @@ public class GroupManager {
|
||||
private final GroupSortBy sortBy;
|
||||
private final SortOrder sortOrder;
|
||||
|
||||
private final ProgressHandle groupProgress;
|
||||
|
||||
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.groupBy = groupBy;
|
||||
this.sortBy = sortBy;
|
||||
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
|
||||
@ -761,7 +759,8 @@ public class GroupManager {
|
||||
if (isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
groupProgress.start();
|
||||
|
||||
updateProgress(-1, 1);
|
||||
|
||||
analyzedGroups.clear();
|
||||
unSeenGroups.clear();
|
||||
@ -769,7 +768,7 @@ public class GroupManager {
|
||||
// Get the list of group keys
|
||||
Multimap<DataSource, AttrValType> valsByDataSource = findValuesForAttribute();
|
||||
|
||||
groupProgress.switchToDeterminate(valsByDataSource.entries().size());
|
||||
updateProgress(0, valsByDataSource.entries().size());
|
||||
int p = 0;
|
||||
// For each key value, partially create the group and add it to the list.
|
||||
for (final Map.Entry<DataSource, AttrValType> valForDataSource : valsByDataSource.entries()) {
|
||||
@ -777,9 +776,8 @@ public class GroupManager {
|
||||
return null;
|
||||
}
|
||||
p++;
|
||||
updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), valForDataSource.getValue()));
|
||||
updateMessage(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString()) + valForDataSource.getValue());
|
||||
updateProgress(p, valsByDataSource.size());
|
||||
groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), valForDataSource), p);
|
||||
popuplateIfAnalyzed(new GroupKey<>(groupBy, valForDataSource.getValue(), valForDataSource.getKey()), this);
|
||||
}
|
||||
|
||||
@ -808,8 +806,8 @@ public class GroupManager {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
groupProgress.finish();
|
||||
updateProgress(1, 1);
|
||||
updateMessage("");
|
||||
}
|
||||
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.
|
||||
*
|
||||
* @param groupBy
|
||||
*
|
||||
* @return map of data source (or null if group by attribute ignores
|
||||
* data sources) to list of unique group values
|
||||
*/
|
||||
|
@ -10,12 +10,21 @@
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?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>
|
||||
<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>
|
||||
<HBox alignment="CENTER_RIGHT" prefHeight="-1.0" prefWidth="-1.0" spacing="5.0" BorderPane.alignment="CENTER_RIGHT">
|
||||
<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">
|
||||
<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" />
|
||||
@ -31,37 +40,27 @@
|
||||
<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>
|
||||
</StackPane>
|
||||
</children>
|
||||
<BorderPane.margin>
|
||||
<Insets left="10.0" />
|
||||
</BorderPane.margin>
|
||||
</HBox>
|
||||
</right>
|
||||
<left><Label fx:id="staleLabel" text="Some data may be out of date. Enable listening to ingest to update." BorderPane.alignment="CENTER">
|
||||
<graphic><ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@../images/information.png" />
|
||||
</image></ImageView>
|
||||
</graphic>
|
||||
<BorderPane.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="10.0" top="5.0" />
|
||||
</BorderPane.margin></Label>
|
||||
</left>
|
||||
<left>
|
||||
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="-1.0" prefWidth="-1.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<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" />
|
||||
<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">
|
||||
<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>
|
||||
</StackPane>
|
||||
</left>
|
||||
</BorderPane>
|
||||
</children>
|
||||
</fx:root>
|
||||
|
@ -28,28 +28,26 @@ import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class StatusBar extends AnchorPane {
|
||||
|
||||
private final ImageGalleryController controller;
|
||||
|
||||
@FXML
|
||||
private ProgressBar fileTaskProgresBar;
|
||||
|
||||
@FXML
|
||||
private Label fileUpdateTaskLabel;
|
||||
|
||||
@FXML
|
||||
private Label bgTaskLabel;
|
||||
|
||||
private Label regroupLabel;
|
||||
@FXML
|
||||
private Label staleLabel;
|
||||
|
||||
@FXML
|
||||
private ProgressBar bgTaskProgressBar;
|
||||
private ProgressBar regroupProgressBar;
|
||||
|
||||
private final ImageGalleryController controller;
|
||||
private final GroupManager groupManager;
|
||||
|
||||
@FXML
|
||||
@NbBundle.Messages({"StatusBar.fileUpdateTaskLabel.text= File Update Tasks",
|
||||
@ -58,23 +56,25 @@ public class StatusBar extends AnchorPane {
|
||||
void initialize() {
|
||||
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 bgTaskLabel != null : "fx:id=\"bgTaskLabel\" 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 regroupLabel != null : "fx:id=\"regroupLabel\" 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()));
|
||||
fileTaskProgresBar.progressProperty().bind(controller.getDBTasksQueueSizeProperty().negate());
|
||||
|
||||
controller.regroupProgress().addListener((ov, oldSize, newSize) -> {
|
||||
groupManager.regroupProgress().addListener((ov, oldSize, newSize) -> {
|
||||
Platform.runLater(() -> {
|
||||
if (controller.regroupProgress().lessThan(1.0).get()) {
|
||||
if (groupManager.regroupProgress().lessThan(1.0).get()) {
|
||||
// Regrouping in progress
|
||||
bgTaskProgressBar.progressProperty().setValue(-1.0);
|
||||
bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text());
|
||||
regroupProgressBar.progressProperty().setValue(groupManager.regroupProgress().doubleValue());
|
||||
regroupLabel.setText(groupManager.regroupMessage().get());
|
||||
|
||||
} else {
|
||||
// Clear the progress bar
|
||||
bgTaskProgressBar.progressProperty().setValue(0.0);
|
||||
bgTaskLabel.setText("");
|
||||
regroupProgressBar.progressProperty().setValue(0.0);
|
||||
regroupLabel.setText("");
|
||||
}
|
||||
regroupLabel.setTooltip(new Tooltip(regroupLabel.getText()));
|
||||
});
|
||||
});
|
||||
|
||||
@ -84,6 +84,7 @@ public class StatusBar extends AnchorPane {
|
||||
|
||||
public StatusBar(ImageGalleryController controller) {
|
||||
this.controller = controller;
|
||||
this.groupManager = controller.getGroupManager();
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS
|
||||
fxmlLoader.setRoot(this);
|
||||
fxmlLoader.setController(this);
|
||||
@ -93,6 +94,5 @@ public class StatusBar extends AnchorPane {
|
||||
} catch (IOException exception) {
|
||||
throw new RuntimeException(exception);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user