19 package org.sleuthkit.autopsy.coreutils;
21 import java.util.Deque;
22 import java.util.Objects;
23 import javafx.beans.property.Property;
24 import javafx.beans.property.ReadOnlyBooleanProperty;
25 import javafx.beans.property.ReadOnlyBooleanWrapper;
26 import javafx.beans.property.ReadOnlyObjectProperty;
27 import javafx.beans.property.ReadOnlyObjectWrapper;
28 import javafx.beans.property.SimpleListProperty;
29 import javafx.collections.FXCollections;
30 import javax.annotation.concurrent.GuardedBy;
31 import javax.annotation.concurrent.ThreadSafe;
48 private final ObservableStack<T>
historyStack = new ObservableStack<>();
52 private final ObservableStack<T>
forwardStack = new ObservableStack<>();
56 private final ReadOnlyObjectWrapper<T>
currentState = new ReadOnlyObjectWrapper<>();
60 private final ReadOnlyBooleanWrapper
canAdvance = new ReadOnlyBooleanWrapper();
64 private final ReadOnlyBooleanWrapper
canRetreat = new ReadOnlyBooleanWrapper();
100 synchronized public void reset(T newState) {
115 if (peek != null && peek.equals(
currentState.get()) ==
false) {
132 if (pop != null && pop.equals(
currentState.get()) ==
false) {
136 }
else if (pop != null && pop.equals(
currentState.get())) {
151 synchronized public void advance(T newState)
throws IllegalArgumentException {
152 if (newState != null && Objects.equals(
currentState.get(), newState) ==
false) {
181 super(FXCollections.<T>synchronizedObservableList(FXCollections.<T>observableArrayList()));
185 synchronized (
this) {
191 synchronized (
this) {
201 synchronized (
this) {
final ObservableStack< T > forwardStack
final ObservableStack< T > historyStack
synchronized boolean canRetreat()
synchronized void reset(T newState)
synchronized T getCurrentState()
synchronized boolean canAdvance()
synchronized ReadOnlyObjectProperty< T > currentState()
synchronized ReadOnlyBooleanProperty getCanRetreat()
synchronized void advance(T newState)
synchronized ReadOnlyBooleanProperty getCanAdvance()
synchronized void clear()