Class DeviceAnnouncementAdapter
- java.lang.Object
-
- org.deepsymmetry.beatlink.DeviceAnnouncementAdapter
-
- All Implemented Interfaces:
DeviceAnnouncementListener
public abstract class DeviceAnnouncementAdapter extends Object implements DeviceAnnouncementListener
An abstract adapter class for receiving device announcements. The methods in this class are empty; it exists as a convenience for creating listener objects.
Extend this class to create a
DeviceAnnouncementListenerand override only the methods for events that you care about. If you plan to implement all the methods in the interface, you might as well implementDeviceAnnouncementListenerdirectly.Create a listener object using your extended class and then register it using
DeviceFinder.addDeviceAnnouncementListener(DeviceAnnouncementListener). Whenever a new device is found, or a device disappears from the network, the relevant method in the listener object is invoked, and theDeviceAnnouncementis passed to it.- Author:
- James Elliott
-
-
Constructor Summary
Constructors Constructor Description DeviceAnnouncementAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeviceFound(DeviceAnnouncement announcement)Invoked when a new DJ Link device is heard from on the network.voiddeviceLost(DeviceAnnouncement announcement)Invoked when a DJ Link device is no longer seen on the network.
-
-
-
Method Detail
-
deviceFound
public void deviceFound(DeviceAnnouncement announcement)
Description copied from interface:DeviceAnnouncementListenerInvoked when a new DJ Link device is heard from on the network.Device announcements are delivered to listeners on the Event Dispatch thread, so it is fine to interact with user interface objects in this method. Any code in this method must finish quickly, or unhandled events will back up and the user interface will be come unresponsive.
- Specified by:
deviceFoundin interfaceDeviceAnnouncementListener- Parameters:
announcement- the message which announced the device's presence
-
deviceLost
public void deviceLost(DeviceAnnouncement announcement)
Description copied from interface:DeviceAnnouncementListenerInvoked when a DJ Link device is no longer seen on the network.Device announcements are delivered to listeners on the Event Dispatch thread, so it is fine to interact with user interface objects in this method. Any code in this method must finish quickly, or unhandled events will back up and the user interface will be come unresponsive.
- Specified by:
deviceLostin interfaceDeviceAnnouncementListener- Parameters:
announcement- the last message which was sent by the device before it disappeared
-
-