public class RewindableGraphSequence
extends java.lang.Object
Constructor and Description |
---|
RewindableGraphSequence() |
RewindableGraphSequence(int maxCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
addNewGraph(Graph graph,
DrawingFrame frame)
Add a new graph and drawing frame to the sequence.
|
void |
addSequenceChangeListener(java.util.function.Consumer<RewindableGraphSequence> listener) |
DrawingFrame |
getCurrentFrame()
Get the current drawing frame.
|
Graph |
getCurrentGraph()
Get the current graph.
|
boolean |
hasNext()
Whether this sequence has a next graph to forward to.
|
boolean |
hasPrevious()
Whether this sequence has a previous graph to rewind to.
|
boolean |
isEmpty()
Returns whether this sequence is empty.
|
void |
next()
Set to the next graph.
|
void |
previous()
Set to the previous graph.
|
void |
removeSequenceChangeListener(java.util.function.Consumer<RewindableGraphSequence> listener)
Add a listener to be notified about changes to the sequence's content and current position.
|
public RewindableGraphSequence(int maxCapacity)
public RewindableGraphSequence()
public boolean isEmpty()
public boolean hasNext()
public void next()
getCurrentFrame()
and getCurrentGraph()
functions.public boolean hasPrevious()
public void previous()
getCurrentFrame()
and getCurrentGraph()
functions.public void addNewGraph(Graph graph, DrawingFrame frame)
graph
- The new graph to add.frame
- The new drawing frame to add.public Graph getCurrentGraph()
isEmpty()
.public DrawingFrame getCurrentFrame()
isEmpty()
.public void addSequenceChangeListener(java.util.function.Consumer<RewindableGraphSequence> listener)
public void removeSequenceChangeListener(java.util.function.Consumer<RewindableGraphSequence> listener)
listener
- A listener which is notified when the sequence changes.