Package edu.wpi.grip.core.sources
Class MultiImageFileSource
- java.lang.Object
-
- edu.wpi.grip.core.Source
-
- edu.wpi.grip.core.sources.MultiImageFileSource
-
- All Implemented Interfaces:
PreviousNext
public final class MultiImageFileSource extends Source implements PreviousNext
A Source that supports multiple images. They can be toggled usingnext()
andprevious()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MultiImageFileSource.Factory
-
Nested classes/interfaces inherited from class edu.wpi.grip.core.Source
Source.SourceFactory, Source.SourceFactoryImpl
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<OutputSocket>
createOutputSockets()
java.lang.String
getName()
This is used by the GUI to distinguish different sources.java.util.Properties
getProperties()
This is used for serialization/deserialization.void
initialize()
Initializes the source.void
next()
Assigns the output socket to the next image.void
previous()
Assigns the output socket to the previous image.protected boolean
updateOutputSockets()
This method will check if there are any pending updates to output sockets.-
Methods inherited from class edu.wpi.grip.core.Source
getExceptionWitness, getOutputSockets, initializeSafely, toString
-
-
-
-
Method Detail
-
initialize
public void initialize() throws java.io.IOException
Description copied from class:Source
Initializes the source. This should not try to handle initialization exceptions. Instead, theSource.initializeSafely()
should report the problem with initializing to the exception witness.- Specified by:
initialize
in classSource
- Throws:
java.io.IOException
- if the source could not be initialized
-
getName
public java.lang.String getName()
Description copied from class:Source
This is used by the GUI to distinguish different sources. For example,ImageFileSource
returns the filename of the image.
-
createOutputSockets
protected java.util.List<OutputSocket> createOutputSockets()
- Specified by:
createOutputSockets
in classSource
-
updateOutputSockets
protected boolean updateOutputSockets()
Description copied from class:Source
This method will check if there are any pending updates to output sockets. If there are any, update the sockets and then return true. If there are no updates this function should return false.- Specified by:
updateOutputSockets
in classSource
- Returns:
- true if there are updates ready to be moved into the socket.
-
getProperties
public java.util.Properties getProperties()
Description copied from class:Source
This is used for serialization/deserialization.- Specified by:
getProperties
in classSource
- Returns:
- A
Properties
containing data that can be used to re-create this source.
-
next
public void next()
Assigns the output socket to the next image. (Wraps around)- Specified by:
next
in interfacePreviousNext
-
previous
public void previous()
Assigns the output socket to the previous image. (Wraps around)- Specified by:
previous
in interfacePreviousNext
-
-