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
needsRefresh =
new ReadOnlyBooleanWrapper(
false);
112 return needsRefresh.get();
123 return needsRefresh.getReadOnlyProperty();
143 if (updateTask != null) {
144 updateTask.cancel(
true);
148 updateTask.stateProperty().addListener((Observable observable) -> {
149 switch (updateTask.getState()) {
158 this.hasVisibleEvents.set(updateTask.get());
159 }
catch (InterruptedException | ExecutionException ex) {
160 logger.log(Level.SEVERE,
"Unexpected exception updating view", ex);
220 final synchronized void dispose() {
222 if (updateTask != null) {
223 updateTask.cancel(
true);
229 updateListener = null;
241 boolean hasVisibleEvents() {
242 return hasVisibleEventsProperty().get();
252 ReadOnlyBooleanProperty hasVisibleEventsProperty() {
253 return hasVisibleEvents.getReadOnlyProperty();
260 void setNeedsRefresh() {
261 needsRefresh.set(
true);
267 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
288 super(taskName, logStateChanges);
289 this.center = getCenter();
302 @NbBundle.Messages(value = {
"ViewRefreshTask.preparing=Analyzing zoom and filter settings"})
304 protected Boolean
call()
throws Exception {
305 updateProgress(-1, 1);
306 updateMessage(Bundle.ViewRefreshTask_preparing());
307 Platform.runLater(() -> {
308 MaskerPane maskerPane =
new MaskerPane();
309 maskerPane.textProperty().bind(messageProperty());
310 maskerPane.progressProperty().bind(progressProperty());
311 setCenter(
new StackPane(center, maskerPane));
312 setCursor(Cursor.WAIT);
325 needsRefresh.set(
false);
355 setCursor(Cursor.DEFAULT);
364 protected abstract void setDateValues(AxisValuesType values);
373 protected
void resetView(AxisValuesType axisValues) {
374 Platform.runLater(() -> {
376 setDateValues(axisValues);
TimeLineController getController()
abstract ViewMode getViewMode()
ReadOnlyBooleanProperty needsRefreshProperty()
Task< Boolean > updateTask
abstract boolean hasCustomTimeNavigationControls()
synchronized void unRegisterForEvents(Object subscriber)
AbstractTimeLineView(TimeLineController controller)
abstract Task< Boolean > getNewUpdateTask()
final EventsModel filteredEvents
abstract ImmutableList< Node > getTimeNavigationControls()
EventsModel getEventsModel()
final synchronized void refresh()
abstract void clearData()
static final Logger logger
abstract ImmutableList< Node > getSettingsControls()
InvalidationListener updateListener
final ReadOnlyBooleanWrapper hasVisibleEvents
synchronized void unRegisterForEvents(Object listener)
static ReadOnlyObjectProperty< TimeZone > timeZoneProperty()
final ReadOnlyObjectWrapper< EventsModelParams > modelParamsProperty
synchronized void monitorTask(final Task<?> task)
final TimeLineController controller
synchronized void registerForEvents(Object subscriber)
ViewRefreshTask(String taskName, boolean logStateChanges)
EventsModel getEventsModel()
synchronized static Logger getLogger(String name)
void handleRefreshRequested(RefreshRequestedEvent event)