Package gda.images.camera
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected intX distance that circle moves from one frame to the next.protected intY distance that circle moves from one frame to the next.protected intCurrent X position of circle.protected intCurrent Y position of circle.protected intprotected Dimension -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImageListener(ImageListener<T> listener) Adds a listener to which captured frames will be passed.voidDisconnects from the video stream.voidDefault 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.voidConnects to the video stream and starts dispatching images to listeners.protected abstract voidCreates the initial image.Returns the video source's display name.voidremoveImageListener(ImageListener<T> listener) Removes a listener from the list of listeners to which captured frames will be passed.voidsetDesiredFrameRate(int desiredFrameRate) Sets the desired frame rate.voidsetDisplayName(String displayName) voidsetImageSize(Dimension imageSize) voidstart()Starts frame capture.voidstop()Stops frame capture.protected abstract TUpdates the image.Methods inherited from class gda.factory.ConfigurableBase
isConfigureAtStartup, isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.images.camera.VideoReceiver
getImage
-
Field Details
-
desiredFrameRate
protected int desiredFrameRate -
imageSize
-
circleX
protected int circleXCurrent X position of circle. -
circleY
protected int circleYCurrent Y position of circle. -
CIRCLE_SIZE
protected static final int CIRCLE_SIZE- See Also:
-
circleDeltaX
protected int circleDeltaXX distance that circle moves from one frame to the next. -
circleDeltaY
protected int circleDeltaYY 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
-
setDisplayName
-
getDisplayName
Description copied from interface:VideoReceiverReturns the video source's display name. This is a label used in the UI to distinguish between multiple video sources.- Specified by:
getDisplayNamein interfaceVideoReceiver<T>- Returns:
- display name
-
addImageListener
Description copied from interface:VideoReceiverAdds a listener to which captured frames will be passed.- Specified by:
addImageListenerin interfaceVideoReceiver<T>
-
removeImageListener
Description copied from interface:VideoReceiverRemoves a listener from the list of listeners to which captured frames will be passed.- Specified by:
removeImageListenerin interfaceVideoReceiver<T>
-
configure
Description copied from class:ConfigurableBaseDefault 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:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- 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:VideoReceiverConnects to the video stream and starts dispatching images to listeners.- Specified by:
createConnectionin interfaceVideoReceiver<T>
-
start
public void start()Description copied from interface:VideoReceiverStarts frame capture.- Specified by:
startin interfaceVideoReceiver<T>
-
stop
public void stop()Description copied from interface:VideoReceiverStops frame capture.- Specified by:
stopin interfaceVideoReceiver<T>
-
closeConnection
public void closeConnection()Description copied from interface:VideoReceiverDisconnects from the video stream.- Specified by:
closeConnectionin interfaceVideoReceiver<T>
-
createInitialImage
protected abstract void createInitialImage()Creates the initial image. -
updateImage
Updates the image. Called at regular intervals.
-