Closed JordanMartinez closed 8 years ago
I feel like my NonLinearChangeQueue's need to be more 'queue-like' instead of an object that distinguishes which queue with which a change is associated and that has a few methods from the UndoManagerImpl.
The principles I see are:
hasNext
and next
and hasPrev
and prev
are faster than my current approach of iterating through all the changes. My current approach will take longer the more queues and changes that are added at an exponential rate; thus, it needs to change.allUndos
and allRedos
using an ObservableList in DAG and FilteredList (by source) in Queue approach, an approach I've used in the past. However, this approach's issue is the inability to further filter the list in the Queue by those changes which are valid. Since the validity of these changes needs to be updated every time, and not just the ones that are added/removed, this implies the usage of the non-existent ReactFX method ObservableList#flatMap
allUndos
/allRedos
and add the valid change to the corresponding list, then unsuspend all the queue's lists. That works for the UnlimitedChangeQueue
s, but what about the FixedSizeChangeQueue
s?forgetHistory
somewhere in there.Closing since I believe my next PR's approach is the correct one to take.
This isn't ready to be merged, but gives you an idea on how I'm trying to implement this.
I still have a few things to figure out:
forgetHistory()
) and the second for tracking which undos/redos it can currently undo/redo. Every time a queue undos/redos/adds (and forgets?) a change, all other queue's 2nd list needs to be updated.NonLinearChangeQueue#equals
method be implemented? Currently, I'm using anint ID
that can be set by theNonLinearUndoManagerFactory
, but I am not sure if another approach would be better.