Class GenericFieldBroadcaster
java.lang.Object
org.web3d.vrml.scripting.external.neteai.GenericFieldBroadcaster
- All Implemented Interfaces:
FieldBroadcaster
Simple implementation of the FieldBroadcaster interface.
This broadcaster must use a separate broadcasting thread because
ClientProcessingTask's thread can't be used for processing user
requests (it ends up blocking and waiting for itself).
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addVrmlEventListener
(int fieldID, int fieldType, VrmlEventListener l) Add a listener for a given field ID.void
generateFieldBroadcast
(int fieldID, DataInputStream dis) Generate the broadcast of a field changed event for a given field ID.getUserData
(int fieldID) Get the user data associated with a fieldboolean
removeVrmlEventListener
(int fieldID, VrmlEventListener l) Remove a listener for a given field IDvoid
setUserData
(int fieldID, Object data) Set the user data associated with a field
-
Method Details
-
generateFieldBroadcast
Description copied from interface:FieldBroadcaster
Generate the broadcast of a field changed event for a given field ID. Reads the field value off the network and then adds the field to the work list.- Specified by:
generateFieldBroadcast
in interfaceFieldBroadcaster
- Parameters:
fieldID
- The network ID of the field which changeddis
- The input stream to read the field value from- Throws:
IOException
-
removeVrmlEventListener
Description copied from interface:FieldBroadcaster
Remove a listener for a given field ID- Specified by:
removeVrmlEventListener
in interfaceFieldBroadcaster
- Parameters:
fieldID
- The network field ID to remove a listener froml
- The listener for the field- Returns:
- Was that the last listener for this field ID?
- See Also:
-
addVrmlEventListener
Description copied from interface:FieldBroadcaster
Add a listener for a given field ID. Need to specify the field type so that the broadcast system knows what to generate.- Specified by:
addVrmlEventListener
in interfaceFieldBroadcaster
- Parameters:
fieldID
- The network field ID to add a listener forfieldType
- The type of the fieldl
- The listener for the field- Returns:
- Was that the first listener for this field ID?
-
getUserData
Description copied from interface:FieldBroadcaster
Get the user data associated with a field- Specified by:
getUserData
in interfaceFieldBroadcaster
- Parameters:
fieldID
- The network ID of the field- Returns:
- The user data associated with the field
- See Also:
-
setUserData
Description copied from interface:FieldBroadcaster
Set the user data associated with a field- Specified by:
setUserData
in interfaceFieldBroadcaster
- Parameters:
fieldID
- The network ID of the fielddata
- The user data associated the the field- See Also:
-