Class DummyVideoReceiverBase<T>

java.lang.Object
gda.factory.ConfigurableBase
gda.images.camera.DummyVideoReceiverBase<T>
All Implemented Interfaces:
Configurable, VideoReceiver<T>
Direct Known Subclasses:
DummyAwtVideoReceiver, DummyAwtVideoReceiverWithImage, DummySwtVideoReceiver, DummySwtVideoReceiverWithImage

public abstract class DummyVideoReceiverBase<T> extends ConfigurableBase implements VideoReceiver<T>
  • Field Details

    • desiredFrameRate

      protected int desiredFrameRate
    • imageSize

      protected Dimension imageSize
    • circleX

      protected int circleX
      Current X position of circle.
    • circleY

      protected int circleY
      Current Y position of circle.
    • CIRCLE_SIZE

      protected static final int CIRCLE_SIZE
      See Also:
    • circleDeltaX

      protected int circleDeltaX
      X distance that circle moves from one frame to the next.
    • circleDeltaY

      protected int circleDeltaY
      Y distance that circle moves from one frame to the next.
  • Constructor Details

    • DummyVideoReceiverBase

      public DummyVideoReceiverBase()
  • Method Details

    • setDesiredFrameRate

      public void setDesiredFrameRate(int desiredFrameRate)
      Sets the desired frame rate. (The default is 10fps.)
    • setImageSize

      public void setImageSize(Dimension imageSize)
    • setDisplayName

      public void setDisplayName(String displayName)
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: VideoReceiver
      Returns the video source's display name. This is a label used in the UI to distinguish between multiple video sources.
      Specified by:
      getDisplayName in interface VideoReceiver<T>
      Returns:
      display name
    • addImageListener

      public void addImageListener(ImageListener<T> listener)
      Description copied from interface: VideoReceiver
      Adds a listener to which captured frames will be passed.
      Specified by:
      addImageListener in interface VideoReceiver<T>
    • removeImageListener

      public void removeImageListener(ImageListener<T> listener)
      Description copied from interface: VideoReceiver
      Removes a listener from the list of listeners to which captured frames will be passed.
      Specified by:
      removeImageListener in interface VideoReceiver<T>
    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • createConnection

      public void createConnection()
      Description copied from interface: VideoReceiver
      Connects to the video stream and starts dispatching images to listeners.
      Specified by:
      createConnection in interface VideoReceiver<T>
    • start

      public void start()
      Description copied from interface: VideoReceiver
      Starts frame capture.
      Specified by:
      start in interface VideoReceiver<T>
    • stop

      public void stop()
      Description copied from interface: VideoReceiver
      Stops frame capture.
      Specified by:
      stop in interface VideoReceiver<T>
    • closeConnection

      public void closeConnection()
      Description copied from interface: VideoReceiver
      Disconnects from the video stream.
      Specified by:
      closeConnection in interface VideoReceiver<T>
    • createInitialImage

      protected abstract void createInitialImage()
      Creates the initial image.
    • updateImage

      protected abstract T updateImage()
      Updates the image. Called at regular intervals.