Class 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)
    • 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..