Class ClientProcessingTask
java.lang.Object
org.web3d.vrml.scripting.external.neteai.ClientProcessingTask
- All Implemented Interfaces:
Runnable
,FieldAndNodeRequestProcessor
ClientProcessingTask is the body of processing loop for
reading and writing data from the foreign browser.
Access to the input stream is controlled by mutual exclusion using
SuspendedTaskData instances and readLock.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Send addRoute request to the servervoid
addVrmlEventListener
(int fieldID, int fieldType, VrmlEventListener l) Add a listener to event changes for a field.void
createVrmlFromURL
(String[] url, int nodeID, String eventIn) void
disposeNode
(int nodeID) Notify server that node is no longer referenced.float
float
getEventIn
(int nodeID, String fieldName) * @see org.web3d.vrml.scripting.external.neteai.FieldAndNodeRequestProcessor#getEventIn(int, java.lang.String)getEventOut
(int nodeID, String fieldName) * @see org.web3d.vrml.scripting.external.neteai.FieldAndNodeRequestProcessor#getEventOut(int, java.lang.String)void
getFieldValue
(int fieldID, org.web3d.vrml.scripting.external.neteai.EventWrapper buffer) Transmit a getFieldValue request.int
getImageComponents
(int fieldID) Return the number of components in an SFImage fieldint
getImageHeight
(int fieldID) Return the height on an SFImage fieldint
getImageWidth
(int fieldID) Return the width of an SFImage fieldint
Transmit a getNode request to the server and wait for reply.getNodeType
(int nodeID) Returns the type name for a given node.int
getNumFieldValues
(int fieldID) Get the number of elements in this field's valuegetUserData
(int fieldID) Get the user data associated with a field.void
removeRoute
(int fromNodeID, String eventOut, int toNodeID, String eventIn) Remove a route from the scenevoid
removeVrmlEventListener
(int fieldID, VrmlEventListener l) Remove a listener from the listeners for a field.void
run()
void
setDescription
(String desc) void
setFieldValue
(int fieldID, org.web3d.vrml.scripting.external.neteai.EventWrapper buffer) Transmit a setFieldValue request.void
setUserData
(int fieldID, Object data) Set the user data associated with a field.void
Tell the server that everything should go away.
-
Method Details
-
addRoute
Send addRoute request to the server- Parameters:
fromNodeID
- Network ID of the originating nodeeventOut
- Name of originating eventtoNodeID
- Network ID of the destination ndoeeventIn
- Name of the destination event
-
addVrmlEventListener
Description copied from interface:FieldAndNodeRequestProcessor
Add a listener to event changes for a field. Turns on event notifications as needed. Need to pass the field type so that the broadcast system knows what to generate when updates arrive.- Specified by:
addVrmlEventListener
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network ID of the fieldfieldType
- The type of the fieldl
- The listener to add.
-
disposeNode
public void disposeNode(int nodeID) Notify server that node is no longer referenced. Does not check for remaining instances.- Specified by:
disposeNode
in interfaceFieldAndNodeRequestProcessor
- Parameters:
nodeID
- The node to dispose
-
getEventIn
* @see org.web3d.vrml.scripting.external.neteai.FieldAndNodeRequestProcessor#getEventIn(int, java.lang.String)- Specified by:
getEventIn
in interfaceFieldAndNodeRequestProcessor
- Parameters:
nodeID
- The network ID of the nodefieldName
- The name of the field- Returns:
- The eventIn object
-
getEventOut
* @see org.web3d.vrml.scripting.external.neteai.FieldAndNodeRequestProcessor#getEventOut(int, java.lang.String)- Specified by:
getEventOut
in interfaceFieldAndNodeRequestProcessor
- Parameters:
nodeID
- The network ID of the nodefieldName
- The name of the field- Returns:
- The eventOut object
-
getFieldValue
public void getFieldValue(int fieldID, org.web3d.vrml.scripting.external.neteai.EventWrapper buffer) Description copied from interface:FieldAndNodeRequestProcessor
Transmit a getFieldValue request. The buffer will receive the field value using readFieldValue.- Specified by:
getFieldValue
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field IDbuffer
- The buffer to receive the value- See Also:
-
getNode
Transmit a getNode request to the server and wait for reply.- Specified by:
getNode
in interfaceFieldAndNodeRequestProcessor
- Parameters:
nodeName
- The nodeName to request- Returns:
- The ID for the node if found.
-
getNodeType
Returns the type name for a given node.- Specified by:
getNodeType
in interfaceFieldAndNodeRequestProcessor
- Parameters:
nodeID
- The network ID of the node.- Returns:
- The type name of the node.
-
getNumFieldValues
public int getNumFieldValues(int fieldID) Description copied from interface:FieldAndNodeRequestProcessor
Get the number of elements in this field's value- Specified by:
getNumFieldValues
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network ID of this field- Returns:
- The number of elements in the field's value
- See Also:
-
getUserData
Description copied from interface:FieldAndNodeRequestProcessor
Get the user data associated with a field. This is implemented on the client side.- Specified by:
getUserData
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field ID- Returns:
- The user data object
- See Also:
-
removeRoute
-
removeVrmlEventListener
Description copied from interface:FieldAndNodeRequestProcessor
Remove a listener from the listeners for a field. Will turn off event notifications if this is the last listener for that field.- Specified by:
removeVrmlEventListener
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network ID of the field.l
- The listener to remove- See Also:
-
run
-
setFieldValue
public void setFieldValue(int fieldID, org.web3d.vrml.scripting.external.neteai.EventWrapper buffer) Description copied from interface:FieldAndNodeRequestProcessor
Transmit a setFieldValue request. The buffer holds the field value to transmit using writeFieldValue.- Specified by:
setFieldValue
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field IDbuffer
- The buffer holding the value
-
setUserData
Description copied from interface:FieldAndNodeRequestProcessor
Set the user data associated with a field. This is implemented on the client side.- Specified by:
setUserData
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field IDdata
- The user data object- See Also:
-
createVrmlFromURL
-
getServerName
- Returns:
- The identifier the server is using.
- See Also:
-
getServerVersion
- Returns:
- version information
- See Also:
-
getCurrentSpeed
public float getCurrentSpeed()- Returns:
- current network speed
- See Also:
-
getCurrentFrameRate
public float getCurrentFrameRate()- Returns:
- * @see vrml.eai.Browser#getCurrentFrameRate()
-
getWorldURL
- Returns:
- * @see vrml.eai.Browser#getWorldURL()
-
setDescription
- Parameters:
desc
- description- See Also:
-
shutdownBrowser
public void shutdownBrowser()Tell the server that everything should go away. -
getImageComponents
public int getImageComponents(int fieldID) Description copied from interface:FieldAndNodeRequestProcessor
Return the number of components in an SFImage field- Specified by:
getImageComponents
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field ID- Returns:
- The number of components in the image
- See Also:
-
getImageHeight
public int getImageHeight(int fieldID) Description copied from interface:FieldAndNodeRequestProcessor
Return the height on an SFImage field- Specified by:
getImageHeight
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field ID- Returns:
- The height of the image
- See Also:
-
getImageWidth
public int getImageWidth(int fieldID) Description copied from interface:FieldAndNodeRequestProcessor
Return the width of an SFImage field- Specified by:
getImageWidth
in interfaceFieldAndNodeRequestProcessor
- Parameters:
fieldID
- The network field ID- Returns:
- The width of the image
- See Also:
-