mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
add permanent refresh button enabled when tags are updated
This commit is contained in:
parent
dfce250309
commit
c98658f88e
@ -1,17 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import jfxtras.scene.control.*?>
|
||||
<?import org.controlsfx.control.*?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.MenuButton?>
|
||||
<?import javafx.scene.control.Separator?>
|
||||
<?import javafx.scene.control.ToggleButton?>
|
||||
<?import javafx.scene.control.ToolBar?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.Region?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import jfxtras.scene.control.LocalDateTimeTextField?>
|
||||
<?import org.controlsfx.control.SegmentedButton?>
|
||||
|
||||
<fx:root prefHeight="-1.0" prefWidth="-1.0" type="javafx.scene.layout.BorderPane" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<fx:root prefHeight="-1.0" prefWidth="-1.0" type="javafx.scene.layout.BorderPane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<top>
|
||||
<ToolBar fx:id="toolBar" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<HBox BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<ToolBar fx:id="toolBar" prefWidth="200.0" HBox.hgrow="ALWAYS">
|
||||
<items>
|
||||
<HBox alignment="CENTER" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
@ -61,6 +73,10 @@
|
||||
<Insets left="10.0" />
|
||||
</BorderPane.margin>
|
||||
</HBox>
|
||||
</items>
|
||||
</ToolBar>
|
||||
<ToolBar maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||
<items>
|
||||
<Separator orientation="VERTICAL" />
|
||||
<Button fx:id="snapShotButton" mnemonicParsing="false">
|
||||
<graphic>
|
||||
@ -71,9 +87,20 @@
|
||||
</ImageView>
|
||||
</graphic>
|
||||
</Button>
|
||||
<Separator orientation="VERTICAL" />
|
||||
<Separator halignment="LEFT" maxWidth="1.7976931348623157E308" orientation="VERTICAL" />
|
||||
<Button fx:id="refreshButton" alignment="CENTER_RIGHT" mnemonicParsing="false" text="Refresh">
|
||||
<graphic>
|
||||
<ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@../images/arrow-circle-double-135.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
</graphic>
|
||||
</Button>
|
||||
</items>
|
||||
</ToolBar>
|
||||
</children>
|
||||
</HBox>
|
||||
</top>
|
||||
<bottom>
|
||||
<VBox maxHeight="-Infinity">
|
||||
|
@ -29,6 +29,7 @@ import java.util.function.Supplier;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.property.ReadOnlyBooleanWrapper;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
@ -158,13 +159,15 @@ final public class VisualizationPanel extends BorderPane {
|
||||
@FXML
|
||||
private Button snapShotButton;
|
||||
@FXML
|
||||
private Button refreshButton;
|
||||
@FXML
|
||||
private Label visualizationModeLabel;
|
||||
|
||||
/**
|
||||
* wraps contained visualization so that we can show notifications over it.
|
||||
*/
|
||||
private final NotificationPane notificationPane = new NotificationPane();
|
||||
|
||||
private final ReadOnlyBooleanWrapper needsRefresh = new ReadOnlyBooleanWrapper(false);
|
||||
private final TimeLineController controller;
|
||||
private final FilteredEventsModel filteredEvents;
|
||||
|
||||
@ -190,7 +193,7 @@ final public class VisualizationPanel extends BorderPane {
|
||||
/**
|
||||
* hides the notification pane on any event
|
||||
*/
|
||||
private final InvalidationListener zoomListener = any -> notificationPane.hide();
|
||||
private final InvalidationListener zoomListener = any -> setNeedsRefresh(false);
|
||||
|
||||
/**
|
||||
* listen to change in end time picker and push to controller
|
||||
@ -279,6 +282,7 @@ final public class VisualizationPanel extends BorderPane {
|
||||
|
||||
//configure snapshor button / action
|
||||
ActionUtils.configureButton(new SaveSnapshotAsReport(controller, VisualizationPanel.this), snapShotButton);
|
||||
ActionUtils.configureButton(new Refresh(), refreshButton);
|
||||
|
||||
/////configure start and end pickers
|
||||
startLabel.setText(Bundle.VisualizationPanel_startLabel_text());
|
||||
@ -357,11 +361,11 @@ final public class VisualizationPanel extends BorderPane {
|
||||
detailsToggle.setSelected(true);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private synchronized void setVisualization(final AbstractVisualizationPane<?, ?, ?, ?> newViz) {
|
||||
Platform.runLater(() -> {
|
||||
synchronized (VisualizationPanel.this) {
|
||||
if (visualization != null) {
|
||||
toolBar.getItems().removeAll(visualization.getSettingsNodes());
|
||||
visualization.dispose();
|
||||
@ -394,23 +398,31 @@ final public class VisualizationPanel extends BorderPane {
|
||||
notificationPane.setContent(visualization);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
setNeedsRefresh(false);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@NbBundle.Messages("VisualizationPanel.tagsAddedOrDeleted=Tags have been created and/or deleted. The visualization may not be up to date.")
|
||||
public void handleTimeLineTagEvent(TagsUpdatedEvent event) {
|
||||
Platform.runLater(() -> {
|
||||
notificationPane.setCloseButtonVisible(false);
|
||||
notificationPane.getActions().setAll(new Refresh());
|
||||
notificationPane.show(Bundle.VisualizationPanel_tagsAddedOrDeleted(), new ImageView(INFORMATION));
|
||||
});
|
||||
setNeedsRefresh(true);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void handleRefreshRequestedEvent(RefreshRequestedEvent event) {
|
||||
Platform.runLater(notificationPane::hide);
|
||||
setNeedsRefresh(false);
|
||||
}
|
||||
|
||||
private void setNeedsRefresh(Boolean needsRefresh) {
|
||||
Platform.runLater(() -> {
|
||||
VisualizationPanel.this.needsRefresh.set(needsRefresh);
|
||||
if (needsRefresh) {
|
||||
notificationPane.show(Bundle.VisualizationPanel_tagsAddedOrDeleted(), new ImageView(INFORMATION));
|
||||
} else {
|
||||
notificationPane.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchronized private void refreshHistorgram() {
|
||||
@ -669,6 +681,7 @@ final public class VisualizationPanel extends BorderPane {
|
||||
|
||||
setGraphic(new ImageView(REFRESH));
|
||||
setEventHandler(actionEvent -> filteredEvents.refresh());
|
||||
disabledProperty().bind(needsRefresh.not());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user