19 package org.sleuthkit.autopsy.timeline.ui;
21 import com.google.common.collect.ImmutableList;
22 import com.google.common.eventbus.Subscribe;
23 import java.util.concurrent.ExecutionException;
24 import java.util.logging.Level;
25 import javafx.application.Platform;
26 import javafx.beans.InvalidationListener;
27 import javafx.beans.Observable;
28 import javafx.beans.property.ReadOnlyBooleanProperty;
29 import javafx.beans.property.ReadOnlyBooleanWrapper;
30 import javafx.concurrent.Task;
31 import javafx.scene.Cursor;
32 import javafx.scene.Node;
33 import javafx.scene.layout.BorderPane;
34 import javafx.scene.layout.StackPane;
35 import org.controlsfx.control.MaskerPane;
36 import org.openide.util.NbBundle;
57 private final ReadOnlyBooleanWrapper
hasVisibleEvents =
new ReadOnlyBooleanWrapper(
true);
64 private final ReadOnlyBooleanWrapper
outOfDate =
new ReadOnlyBooleanWrapper(
false);
111 return outOfDate.get();
122 return outOfDate.getReadOnlyProperty();
142 if (updateTask != null) {
143 updateTask.cancel(
true);
147 updateTask.stateProperty().addListener((Observable observable) -> {
148 switch (updateTask.getState()) {
157 this.hasVisibleEvents.set(updateTask.get());
158 }
catch (InterruptedException | ExecutionException ex) {
159 LOGGER.log(Level.SEVERE,
"Unexpected exception updating view", ex);
219 final synchronized void dispose() {
221 if (updateTask != null) {
222 updateTask.cancel(
true);
228 updateListener = null;
240 boolean hasVisibleEvents() {
241 return hasVisibleEventsProperty().get();
251 ReadOnlyBooleanProperty hasVisibleEventsProperty() {
252 return hasVisibleEvents.getReadOnlyProperty();
259 void setOutOfDate() {
266 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
287 super(taskName, logStateChanges);
288 this.center = getCenter();
301 @NbBundle.Messages(value = {
"ViewRefreshTask.preparing=Analyzing zoom and filter settings"})
303 protected Boolean
call()
throws Exception {
304 updateProgress(-1, 1);
305 updateMessage(Bundle.ViewRefreshTask_preparing());
306 Platform.runLater(() -> {
307 MaskerPane maskerPane =
new MaskerPane();
308 maskerPane.textProperty().bind(messageProperty());
309 maskerPane.progressProperty().bind(progressProperty());
310 setCenter(
new StackPane(center, maskerPane));
311 setCursor(Cursor.WAIT);
324 outOfDate.set(
false);
354 setCursor(Cursor.DEFAULT);
363 protected abstract void setDateValues(AxisValuesType values);
372 protected
void resetView(AxisValuesType axisValues) {
373 Platform.runLater(() -> {
375 setDateValues(axisValues);
synchronized void registerForEvents(Object o)
TimeLineController getController()
final FilteredEventsModel filteredEvents
abstract ViewMode getViewMode()
FilteredEventsModel getEventsModel()
Task< Boolean > updateTask
abstract boolean hasCustomTimeNavigationControls()
static final Logger LOGGER
static ReadOnlyObjectProperty< TimeZone > getTimeZone()
AbstractTimeLineView(TimeLineController controller)
abstract Task< Boolean > getNewUpdateTask()
abstract ImmutableList< Node > getTimeNavigationControls()
FilteredEventsModel getEventsModel()
ReadOnlyBooleanProperty outOfDateProperty()
final synchronized void refresh()
synchronized ReadOnlyObjectProperty< ZoomParams > zoomParametersProperty()
abstract void clearData()
abstract ImmutableList< Node > getSettingsControls()
InvalidationListener updateListener
final ReadOnlyBooleanWrapper hasVisibleEvents
synchronized void unRegisterForEvents(Object o)
synchronized void monitorTask(final Task<?> task)
final TimeLineController controller
final ReadOnlyBooleanWrapper outOfDate
ViewRefreshTask(String taskName, boolean logStateChanges)
synchronized static Logger getLogger(String name)
synchronized void unRegisterForEvents(Object o)
void handleRefreshRequested(RefreshRequestedEvent event)