Class EventInMFVec2fWrapper
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInMFVec2f
org.web3d.vrml.scripting.external.neteai.EventInMFVec2fWrapper
- All Implemented Interfaces:
ExternalEvent
Client side implementation of EventInMFVec2f field.
EventIn objects double as buffers for data inbound to the event system.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEventInMFVec2fWrapper
(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue) EventInMFVec2fWrapper
(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue, float[][] newValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
doEvent()
The EventIn*Wrapper classes implement doEvent by posting their stored values to the underlying implementation.boolean
Two eventIn's are equal if they point to the same actual node and fieldint
The underlying field IDint
getType()
The type of the underlying field.Get the user data that is associated with this eventInint
hashCode()
In order to make the event queueing system easier, and since an equals method is required by the specification, compute the hashcode based on the field number and underlying node hashcode.boolean
Is the event conglomerating or non-conglomerating.void
loadFieldValue
(DataInputStream input) void
set1Value
(int index, float[] value) Set a particular vector value in the given eventIn array.void
setUserData
(Object data) Associate user data with this event.void
setValue
(float[][] value) Set the value of the array of 2D vectors.void
writeFieldValue
(DataOutputStream output)
-
Constructor Details
-
EventInMFVec2fWrapper
public EventInMFVec2fWrapper(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue) - Parameters:
fieldID
- The network field IDrequestProcessor
- Handler for field serviceseventQueue
- The queue to send events to
-
EventInMFVec2fWrapper
public EventInMFVec2fWrapper(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue, float[][] newValue) - Parameters:
fieldID
- The network field IDrequestProcessor
- Handler for field serviceseventQueue
- The queue to send events tonewValue
- The value to initialize the field with
-
-
Method Details
-
doEvent
public void doEvent()The EventIn*Wrapper classes implement doEvent by posting their stored values to the underlying implementation.- Specified by:
doEvent
in interfaceExternalEvent
- See Also:
-
equals
-
getFieldID
public int getFieldID()The underlying field ID- See Also:
-
hashCode
-
isConglomerating
public boolean isConglomerating()Description copied from interface:ExternalEvent
Is the event conglomerating or non-conglomerating. Conglomerating events such as the set1Value calls build up in the event buffer.- Specified by:
isConglomerating
in interfaceExternalEvent
- Returns:
- whether event is conglomerating or not
- See Also:
-
setValue
public void setValue(float[][] value) Description copied from class:EventInMFVec2f
Set the value of the array of 2D vectors. Input is an array of floats If value[i] does not contain at least two values it will generate an ArrayIndexOutOfBoundsException. If value[i] contains more than two items only the first two values will be used and the rest ignored.If one or more of the values for value[i] are null then the resulting event that is sent to the VRML scene graph is implementation dependent but no error indicator will be set here.
- Specified by:
setValue
in classEventInMFVec2f
- Parameters:
value
- The array of vec2f values where
value[i][0] = X
value[i][1] = Y- See Also:
-
set1Value
public void set1Value(int index, float[] value) Description copied from class:EventInMFVec2f
Set a particular vector value in the given eventIn array. To the VRML world this will generate a full MFVec2f event with the nominated index value changed.The value array must contain at least two elements. If the array contains more than 2 values only the first 2 values will be used and the rest ignored.
If the index is out of the bounds of the current array of data values or the array of values does not contain at least 2 elements an ArrayIndexOutOfBoundsException will be generated.
- Specified by:
set1Value
in classEventInMFVec2f
- Parameters:
index
- The position to set the vector valuevalue
- The array of vector values where
value[0] = X
value[1] = Y- See Also:
-
setUserData
Description copied from class:EventIn
Associate user data with this event. Whenever an event is generated on this eventIn. this data will be available with the Event through its getData method.- Specified by:
setUserData
in classEventIn
- Parameters:
data
- The data to associate with this eventIn instance- See Also:
-
getUserData
Description copied from class:EventIn
Get the user data that is associated with this eventIn- Specified by:
getUserData
in classEventIn
- Returns:
- * @see vrml.eai.field.EventIn#getUserData()
-
loadFieldValue
- Throws:
IOException
- * @see org.web3d.vrml.scripting.external.neteai.EventWrapper#loadFieldValue(java.io.DataInputStream)
-
writeFieldValue
- Throws:
IOException
- * @see org.web3d.vrml.scripting.external.neteai.EventWrapper#writeFieldValue(java.io.DataOutputStream)
-
getType
int getType()The type of the underlying field. Method name chosen to coincide with vrml.eai.field.BaseField.- Returns:
- the type of the underlying field
-