Class DataConverterHelper
- java.lang.Object
-
- ptolemy.actor.lib.jjs.HelperBase
-
- ptolemy.actor.lib.jjs.modules.dataConverter.DataConverterHelper
-
public class DataConverterHelper extends HelperBase
Helper for the dataConverter JavaScript module.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Hokeun Kim
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.actor.lib.jjs.HelperBase
HelperBase.DATA_TYPE
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.lib.jjs.HelperBase
_actor, _currentObj
-
-
Constructor Summary
Constructors Constructor Description DataConverterHelper(java.lang.Object actor, jdk.nashorn.api.scripting.ScriptObjectMirror currentObj)
Constructor for DataConverterHelper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
imageToJSArray(AWTImageToken imageToken)
Convert AWTImageToken to JavaScript array.AWTImageToken
jsArrayToImage(java.lang.Object object)
Convert JavaScript array to AWTImageToken.-
Methods inherited from class ptolemy.actor.lib.jjs.HelperBase
_appendNumericToBuffer, _appendToBuffer, _error, _error, _error, _error, _extractFromBuffer, _issueResponse, _removeDuplicates, _sizeOfType, _toJavaBytes, _toJSArray, getHelping
-
-
-
-
Constructor Detail
-
DataConverterHelper
public DataConverterHelper(java.lang.Object actor, jdk.nashorn.api.scripting.ScriptObjectMirror currentObj)
Constructor for DataConverterHelper.- Parameters:
actor
- The actor associated with this helper.currentObj
- The JavaScript object that this is helping.
-
-
Method Detail
-
imageToJSArray
public java.lang.Object imageToJSArray(AWTImageToken imageToken) throws IllegalActionException
Convert AWTImageToken to JavaScript array.- Parameters:
imageToken
- The image token (AWTImageToken) to be converted.- Returns:
- JavaScript array converted from the image token.
- Throws:
IllegalActionException
- If the conversion fails.
-
jsArrayToImage
public AWTImageToken jsArrayToImage(java.lang.Object object) throws IllegalActionException
Convert JavaScript array to AWTImageToken.- Parameters:
object
- The JavaScript array to be converted to a image token.- Returns:
- The image token converted from JavaScript array.
- Throws:
IllegalActionException
- If the conversion fails..
-
-