Class Source

    • Constructor Detail

      • Source

        protected Source​(ExceptionWitness.Factory exceptionWitnessFactory)
        Parameters:
        exceptionWitnessFactory - Factory to create the exceptionWitness.
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        This is used by the GUI to distinguish different sources. For example, ImageFileSource returns the filename of the image.
        Returns:
        The name of this source.
      • getOutputSockets

        public final com.google.common.collect.ImmutableList<OutputSocket> getOutputSockets()
        Get the sockets for this source.
        Returns:
        An array of OutputSockets for the outputs that the source produces.
      • createOutputSockets

        protected abstract java.util.List<OutputSocket> createOutputSockets()
      • updateOutputSockets

        protected abstract boolean updateOutputSockets()
        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.
        Returns:
        true if there are updates ready to be moved into the socket.
      • getProperties

        public abstract java.util.Properties getProperties()
        This is used for serialization/deserialization.
        Returns:
        A Properties containing data that can be used to re-create this source.
      • initialize

        public abstract void initialize()
                                 throws java.io.IOException
        Initializes the source. This should not try to handle initialization exceptions. Instead, the initializeSafely() should report the problem with initializing to the exception witness.
        Throws:
        java.io.IOException - if the source could not be initialized
      • initializeSafely

        public final void initializeSafely()
        Initializes the source in a safe way such that the exception caused by initializing will be reported to the ExceptionWitness. This method should be used by the deserializer to ensure that a source that is invalid can display this info to the UI and allow the user to modify the save file.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object