001package Torello.Browser.BrowserAPI;
002
003import java.util.*;
004import javax.json.*;
005import javax.json.stream.*;
006import java.io.*;
007
008import java.lang.reflect.Method;
009import java.lang.reflect.Parameter;
010import java.util.function.Function;
011
012import Torello.Browser.BrowserEvent;
013import Torello.Browser.JavaScriptAPI.*;
014import Torello.Browser.helper.*;
015
016import Torello.Java.Additional.*;
017import Torello.Java.JSON.*;
018
019import static Torello.Java.JSON.JFlag.*;
020
021import Torello.Java.StrCmpr;
022import Torello.JavaDoc.StaticFunctional;
023import Torello.JavaDoc.JDHeaderBackgroundImg;
024import Torello.JavaDoc.Excuse;
025
026/**
027 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
028 * 
029 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE>
030 */
031@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION})
032@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE")
033public class Animation
034{
035    // ********************************************************************************************
036    // ********************************************************************************************
037    // Class Header Stuff
038    // ********************************************************************************************
039    // ********************************************************************************************
040
041
042    // No Pubic Constructors
043    private Animation () { }
044
045    // These two Vector's are used by all the "Methods" exported by this class.  java.lang.reflect
046    // is used to generate the JSON String's.  It saves thousands of lines of Auto-Generated Code.
047    private static final Map<String, Vector<String>>    parameterNames = new HashMap<>();
048    private static final Map<String, Vector<Class<?>>>  parameterTypes = new HashMap<>();
049
050    // Some Methods do not take any parameters - for instance all the "enable()" and "disable()"
051    // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now,
052    // offically, two empty-vectors.  One for String's, and the other for Classes.
053
054    private static final Vector<String>     EMPTY_VEC_STR = new Vector<>();
055    private static final Vector<Class<?>>   EMPTY_VEC_CLASS = new Vector<>();
056
057    static
058    {
059        for (Method m : Animation.class.getMethods())
060        {
061            // This doesn't work!  The parameter names are all "arg0" ... "argN"
062            // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter!
063            //
064            // Vector<String> parameterNamesList = new Vector<>(); -- NOPE!
065
066            Vector<Class<?>> parameterTypesList = new Vector<>();
067        
068            for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType());
069
070            parameterTypes.put(
071                m.getName(),
072                (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS
073            );
074        }
075    }
076
077    static
078    {
079        Vector<String> v = null;
080
081        parameterNames.put("disable", EMPTY_VEC_STR);
082
083        parameterNames.put("enable", EMPTY_VEC_STR);
084
085        v = new Vector<String>(1);
086        parameterNames.put("getCurrentTime", v);
087        Collections.addAll(v, new String[]
088        { "id", });
089
090        parameterNames.put("getPlaybackRate", EMPTY_VEC_STR);
091
092        v = new Vector<String>(1);
093        parameterNames.put("releaseAnimations", v);
094        Collections.addAll(v, new String[]
095        { "animations", });
096
097        v = new Vector<String>(1);
098        parameterNames.put("resolveAnimation", v);
099        Collections.addAll(v, new String[]
100        { "animationId", });
101
102        v = new Vector<String>(2);
103        parameterNames.put("seekAnimations", v);
104        Collections.addAll(v, new String[]
105        { "animations", "currentTime", });
106
107        v = new Vector<String>(2);
108        parameterNames.put("setPaused", v);
109        Collections.addAll(v, new String[]
110        { "animations", "paused", });
111
112        v = new Vector<String>(1);
113        parameterNames.put("setPlaybackRate", v);
114        Collections.addAll(v, new String[]
115        { "playbackRate", });
116
117        v = new Vector<String>(3);
118        parameterNames.put("setTiming", v);
119        Collections.addAll(v, new String[]
120        { "animationId", "duration", "delay", });
121    }
122
123
124    // ********************************************************************************************
125    // ********************************************************************************************
126    // Types - Static Inner Classes
127    // ********************************************************************************************
128    // ********************************************************************************************
129
130    /** Animation instance. */
131    public static class _Animation
132        extends BaseType
133        implements java.io.Serializable
134    {
135        /** For Object Serialization.  java.io.Serializable */
136        protected static final long serialVersionUID = 1;
137        
138        public boolean[] optionals()
139        { return new boolean[] { false, false, false, false, false, false, false, false, true, true, true, }; }
140        
141        /** {@code Animation}'s id. */
142        public final String id;
143        
144        /** {@code Animation}'s name. */
145        public final String name;
146        
147        /** {@code Animation}'s internal paused state. */
148        public final boolean pausedState;
149        
150        /** {@code Animation}'s play state. */
151        public final String playState;
152        
153        /** {@code Animation}'s playback rate. */
154        public final Number playbackRate;
155        
156        /**
157         * {@code Animation}'s start time.
158         * Milliseconds for time based animations and
159         * percentage [0 - 100] for scroll driven animations
160         * (i.e. when viewOrScrollTimeline exists).
161         */
162        public final Number startTime;
163        
164        /** {@code Animation}'s current time. */
165        public final Number currentTime;
166        
167        /** Animation type of {@code Animation}. */
168        public final String type;
169        
170        /**
171         * {@code Animation}'s source animation node.
172         * <BR /><B CLASS=Opt>OPTIONAL</B>
173         */
174        public final Animation.AnimationEffect source;
175        
176        /**
177         * A unique ID for {@code Animation} representing the sources that triggered this CSS
178         * animation/transition.
179         * <BR /><B CLASS=Opt>OPTIONAL</B>
180         */
181        public final String cssId;
182        
183        /**
184         * View or scroll timeline
185         * <BR /><B CLASS=Opt>OPTIONAL</B>
186         */
187        public final Animation.ViewOrScrollTimeline viewOrScrollTimeline;
188        
189        /**
190         * Constructor
191         *
192         * @param id {@code Animation}'s id.
193         * 
194         * @param name {@code Animation}'s name.
195         * 
196         * @param pausedState {@code Animation}'s internal paused state.
197         * 
198         * @param playState {@code Animation}'s play state.
199         * 
200         * @param playbackRate {@code Animation}'s playback rate.
201         * 
202         * @param startTime 
203         * {@code Animation}'s start time.
204         * Milliseconds for time based animations and
205         * percentage [0 - 100] for scroll driven animations
206         * (i.e. when viewOrScrollTimeline exists).
207         * 
208         * @param currentTime {@code Animation}'s current time.
209         * 
210         * @param type Animation type of {@code Animation}.
211         * <BR />Acceptable Values: ["CSSTransition", "CSSAnimation", "WebAnimation"]
212         * 
213         * @param source {@code Animation}'s source animation node.
214         * <BR /><B CLASS=Opt>OPTIONAL</B>
215         * 
216         * @param cssId 
217         * A unique ID for {@code Animation} representing the sources that triggered this CSS
218         * animation/transition.
219         * <BR /><B CLASS=Opt>OPTIONAL</B>
220         * 
221         * @param viewOrScrollTimeline View or scroll timeline
222         * <BR /><B CLASS=Opt>OPTIONAL</B>
223         */
224        public _Animation(
225                String id, String name, boolean pausedState, String playState, Number playbackRate, 
226                Number startTime, Number currentTime, String type, Animation.AnimationEffect source, 
227                String cssId, Animation.ViewOrScrollTimeline viewOrScrollTimeline
228            )
229        {
230            // Exception-Check(s) to ensure that if any parameters which are not declared as
231            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
232            
233            if (id == null)           THROWS.throwNPE("id");
234            if (name == null)         THROWS.throwNPE("name");
235            if (playState == null)    THROWS.throwNPE("playState");
236            if (playbackRate == null) THROWS.throwNPE("playbackRate");
237            if (startTime == null)    THROWS.throwNPE("startTime");
238            if (currentTime == null)  THROWS.throwNPE("currentTime");
239            if (type == null)         THROWS.throwNPE("type");
240            
241            // Exception-Check(s) to ensure that if any parameters which must adhere to a
242            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
243            
244            THROWS.checkIAE(
245                "type", type,
246                "CSSTransition", "CSSAnimation", "WebAnimation"
247            );
248            
249            this.id                    = id;
250            this.name                  = name;
251            this.pausedState           = pausedState;
252            this.playState             = playState;
253            this.playbackRate          = playbackRate;
254            this.startTime             = startTime;
255            this.currentTime           = currentTime;
256            this.type                  = type;
257            this.source                = source;
258            this.cssId                 = cssId;
259            this.viewOrScrollTimeline  = viewOrScrollTimeline;
260        }
261        
262        /**
263         * JSON Object Constructor
264         * @param jo A Json-Object having data about an instance of {@code 'Animation'}.
265         */
266        public _Animation (JsonObject jo)
267        {
268            this.id                    = ReadJSON.getString(jo, "id", false, true);
269            this.name                  = ReadJSON.getString(jo, "name", false, true);
270            this.pausedState           = ReadPrimJSON.getBoolean(jo, "pausedState");
271            this.playState             = ReadJSON.getString(jo, "playState", false, true);
272            this.playbackRate          = ReadNumberJSON.get(jo, "playbackRate", false, true);
273            this.startTime             = ReadNumberJSON.get(jo, "startTime", false, true);
274            this.currentTime           = ReadNumberJSON.get(jo, "currentTime", false, true);
275            this.type                  = ReadJSON.getString(jo, "type", false, true);
276            this.source                = ReadJSON.getObject(jo, "source", Animation.AnimationEffect.class, true, false);
277            this.cssId                 = ReadJSON.getString(jo, "cssId", true, false);
278            this.viewOrScrollTimeline  = ReadJSON.getObject(jo, "viewOrScrollTimeline", Animation.ViewOrScrollTimeline.class, true, false);
279        }
280        
281        
282        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
283        public boolean equals(Object other)
284        {
285            if (this == other)                       return true;
286            if (other == null)                       return false;
287            if (other.getClass() != this.getClass()) return false;
288        
289            _Animation o = (_Animation) other;
290        
291            return
292                    Objects.equals(this.id, o.id)
293                &&  Objects.equals(this.name, o.name)
294                &&  (this.pausedState == o.pausedState)
295                &&  Objects.equals(this.playState, o.playState)
296                &&  Objects.equals(this.playbackRate, o.playbackRate)
297                &&  Objects.equals(this.startTime, o.startTime)
298                &&  Objects.equals(this.currentTime, o.currentTime)
299                &&  Objects.equals(this.type, o.type)
300                &&  Objects.equals(this.source, o.source)
301                &&  Objects.equals(this.cssId, o.cssId)
302                &&  Objects.equals(this.viewOrScrollTimeline, o.viewOrScrollTimeline);
303        }
304        
305        /** Generates a Hash-Code for {@code 'this'} instance */
306        public int hashCode()
307        {
308            return
309                    Objects.hashCode(this.id)
310                +   Objects.hashCode(this.name)
311                +   (this.pausedState ? 1 : 0)
312                +   Objects.hashCode(this.playState)
313                +   Objects.hashCode(this.playbackRate)
314                +   Objects.hashCode(this.startTime)
315                +   Objects.hashCode(this.currentTime)
316                +   Objects.hashCode(this.type)
317                +   this.source.hashCode()
318                +   Objects.hashCode(this.cssId)
319                +   this.viewOrScrollTimeline.hashCode();
320        }
321    }
322    
323    /** Timeline instance */
324    public static class ViewOrScrollTimeline
325        extends BaseType
326        implements java.io.Serializable
327    {
328        /** For Object Serialization.  java.io.Serializable */
329        protected static final long serialVersionUID = 1;
330        
331        public boolean[] optionals()
332        { return new boolean[] { true, true, true, true, false, }; }
333        
334        /**
335         * Scroll container node
336         * <BR /><B CLASS=Opt>OPTIONAL</B>
337         */
338        public final Integer sourceNodeId;
339        
340        /**
341         * Represents the starting scroll position of the timeline
342         * as a length offset in pixels from scroll origin.
343         * <BR /><B CLASS=Opt>OPTIONAL</B>
344         */
345        public final Number startOffset;
346        
347        /**
348         * Represents the ending scroll position of the timeline
349         * as a length offset in pixels from scroll origin.
350         * <BR /><B CLASS=Opt>OPTIONAL</B>
351         */
352        public final Number endOffset;
353        
354        /**
355         * The element whose principal box's visibility in the
356         * scrollport defined the progress of the timeline.
357         * Does not exist for animations with ScrollTimeline
358         * <BR /><B CLASS=Opt>OPTIONAL</B>
359         */
360        public final Integer subjectNodeId;
361        
362        /** Orientation of the scroll */
363        public final String axis;
364        
365        /**
366         * Constructor
367         *
368         * @param sourceNodeId Scroll container node
369         * <BR /><B CLASS=Opt>OPTIONAL</B>
370         * 
371         * @param startOffset 
372         * Represents the starting scroll position of the timeline
373         * as a length offset in pixels from scroll origin.
374         * <BR /><B CLASS=Opt>OPTIONAL</B>
375         * 
376         * @param endOffset 
377         * Represents the ending scroll position of the timeline
378         * as a length offset in pixels from scroll origin.
379         * <BR /><B CLASS=Opt>OPTIONAL</B>
380         * 
381         * @param subjectNodeId 
382         * The element whose principal box's visibility in the
383         * scrollport defined the progress of the timeline.
384         * Does not exist for animations with ScrollTimeline
385         * <BR /><B CLASS=Opt>OPTIONAL</B>
386         * 
387         * @param axis Orientation of the scroll
388         */
389        public ViewOrScrollTimeline(
390                Integer sourceNodeId, Number startOffset, Number endOffset, Integer subjectNodeId, 
391                String axis
392            )
393        {
394            // Exception-Check(s) to ensure that if any parameters which are not declared as
395            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
396            
397            if (axis == null) THROWS.throwNPE("axis");
398            
399            // Exception-Check(s) to ensure that if any parameters which must adhere to a
400            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
401            
402            THROWS.checkIAE("axis", axis, "DOM.ScrollOrientation", DOM.ScrollOrientation);
403            
404            this.sourceNodeId   = sourceNodeId;
405            this.startOffset    = startOffset;
406            this.endOffset      = endOffset;
407            this.subjectNodeId  = subjectNodeId;
408            this.axis           = axis;
409        }
410        
411        /**
412         * JSON Object Constructor
413         * @param jo A Json-Object having data about an instance of {@code 'ViewOrScrollTimeline'}.
414         */
415        public ViewOrScrollTimeline (JsonObject jo)
416        {
417            this.sourceNodeId   = ReadBoxedJSON.getInteger(jo, "sourceNodeId", true);
418            this.startOffset    = ReadNumberJSON.get(jo, "startOffset", true, false);
419            this.endOffset      = ReadNumberJSON.get(jo, "endOffset", true, false);
420            this.subjectNodeId  = ReadBoxedJSON.getInteger(jo, "subjectNodeId", true);
421            this.axis           = ReadJSON.getString(jo, "axis", false, true);
422        }
423        
424        
425        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
426        public boolean equals(Object other)
427        {
428            if (this == other)                       return true;
429            if (other == null)                       return false;
430            if (other.getClass() != this.getClass()) return false;
431        
432            ViewOrScrollTimeline o = (ViewOrScrollTimeline) other;
433        
434            return
435                    Objects.equals(this.sourceNodeId, o.sourceNodeId)
436                &&  Objects.equals(this.startOffset, o.startOffset)
437                &&  Objects.equals(this.endOffset, o.endOffset)
438                &&  Objects.equals(this.subjectNodeId, o.subjectNodeId)
439                &&  Objects.equals(this.axis, o.axis);
440        }
441        
442        /** Generates a Hash-Code for {@code 'this'} instance */
443        public int hashCode()
444        {
445            return
446                    Objects.hashCode(this.sourceNodeId)
447                +   Objects.hashCode(this.startOffset)
448                +   Objects.hashCode(this.endOffset)
449                +   Objects.hashCode(this.subjectNodeId)
450                +   Objects.hashCode(this.axis);
451        }
452    }
453    
454    /** AnimationEffect instance */
455    public static class AnimationEffect
456        extends BaseType
457        implements java.io.Serializable
458    {
459        /** For Object Serialization.  java.io.Serializable */
460        protected static final long serialVersionUID = 1;
461        
462        public boolean[] optionals()
463        { return new boolean[] { false, false, false, false, false, false, false, true, true, false, }; }
464        
465        /** {@code AnimationEffect}'s delay. */
466        public final Number delay;
467        
468        /** {@code AnimationEffect}'s end delay. */
469        public final Number endDelay;
470        
471        /** {@code AnimationEffect}'s iteration start. */
472        public final Number iterationStart;
473        
474        /** {@code AnimationEffect}'s iterations. */
475        public final Number iterations;
476        
477        /**
478         * {@code AnimationEffect}'s iteration duration.
479         * Milliseconds for time based animations and
480         * percentage [0 - 100] for scroll driven animations
481         * (i.e. when viewOrScrollTimeline exists).
482         */
483        public final Number duration;
484        
485        /** {@code AnimationEffect}'s playback direction. */
486        public final String direction;
487        
488        /** {@code AnimationEffect}'s fill mode. */
489        public final String fill;
490        
491        /**
492         * {@code AnimationEffect}'s target node.
493         * <BR /><B CLASS=Opt>OPTIONAL</B>
494         */
495        public final Integer backendNodeId;
496        
497        /**
498         * {@code AnimationEffect}'s keyframes.
499         * <BR /><B CLASS=Opt>OPTIONAL</B>
500         */
501        public final Animation.KeyframesRule keyframesRule;
502        
503        /** {@code AnimationEffect}'s timing function. */
504        public final String easing;
505        
506        /**
507         * Constructor
508         *
509         * @param delay {@code AnimationEffect}'s delay.
510         * 
511         * @param endDelay {@code AnimationEffect}'s end delay.
512         * 
513         * @param iterationStart {@code AnimationEffect}'s iteration start.
514         * 
515         * @param iterations {@code AnimationEffect}'s iterations.
516         * 
517         * @param duration 
518         * {@code AnimationEffect}'s iteration duration.
519         * Milliseconds for time based animations and
520         * percentage [0 - 100] for scroll driven animations
521         * (i.e. when viewOrScrollTimeline exists).
522         * 
523         * @param direction {@code AnimationEffect}'s playback direction.
524         * 
525         * @param fill {@code AnimationEffect}'s fill mode.
526         * 
527         * @param backendNodeId {@code AnimationEffect}'s target node.
528         * <BR /><B CLASS=Opt>OPTIONAL</B>
529         * 
530         * @param keyframesRule {@code AnimationEffect}'s keyframes.
531         * <BR /><B CLASS=Opt>OPTIONAL</B>
532         * 
533         * @param easing {@code AnimationEffect}'s timing function.
534         */
535        public AnimationEffect(
536                Number delay, Number endDelay, Number iterationStart, Number iterations, 
537                Number duration, String direction, String fill, Integer backendNodeId, 
538                Animation.KeyframesRule keyframesRule, String easing
539            )
540        {
541            // Exception-Check(s) to ensure that if any parameters which are not declared as
542            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
543            
544            if (delay == null)          THROWS.throwNPE("delay");
545            if (endDelay == null)       THROWS.throwNPE("endDelay");
546            if (iterationStart == null) THROWS.throwNPE("iterationStart");
547            if (iterations == null)     THROWS.throwNPE("iterations");
548            if (duration == null)       THROWS.throwNPE("duration");
549            if (direction == null)      THROWS.throwNPE("direction");
550            if (fill == null)           THROWS.throwNPE("fill");
551            if (easing == null)         THROWS.throwNPE("easing");
552            
553            this.delay           = delay;
554            this.endDelay        = endDelay;
555            this.iterationStart  = iterationStart;
556            this.iterations      = iterations;
557            this.duration        = duration;
558            this.direction       = direction;
559            this.fill            = fill;
560            this.backendNodeId   = backendNodeId;
561            this.keyframesRule   = keyframesRule;
562            this.easing          = easing;
563        }
564        
565        /**
566         * JSON Object Constructor
567         * @param jo A Json-Object having data about an instance of {@code 'AnimationEffect'}.
568         */
569        public AnimationEffect (JsonObject jo)
570        {
571            this.delay           = ReadNumberJSON.get(jo, "delay", false, true);
572            this.endDelay        = ReadNumberJSON.get(jo, "endDelay", false, true);
573            this.iterationStart  = ReadNumberJSON.get(jo, "iterationStart", false, true);
574            this.iterations      = ReadNumberJSON.get(jo, "iterations", false, true);
575            this.duration        = ReadNumberJSON.get(jo, "duration", false, true);
576            this.direction       = ReadJSON.getString(jo, "direction", false, true);
577            this.fill            = ReadJSON.getString(jo, "fill", false, true);
578            this.backendNodeId   = ReadBoxedJSON.getInteger(jo, "backendNodeId", true);
579            this.keyframesRule   = ReadJSON.getObject(jo, "keyframesRule", Animation.KeyframesRule.class, true, false);
580            this.easing          = ReadJSON.getString(jo, "easing", false, true);
581        }
582        
583        
584        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
585        public boolean equals(Object other)
586        {
587            if (this == other)                       return true;
588            if (other == null)                       return false;
589            if (other.getClass() != this.getClass()) return false;
590        
591            AnimationEffect o = (AnimationEffect) other;
592        
593            return
594                    Objects.equals(this.delay, o.delay)
595                &&  Objects.equals(this.endDelay, o.endDelay)
596                &&  Objects.equals(this.iterationStart, o.iterationStart)
597                &&  Objects.equals(this.iterations, o.iterations)
598                &&  Objects.equals(this.duration, o.duration)
599                &&  Objects.equals(this.direction, o.direction)
600                &&  Objects.equals(this.fill, o.fill)
601                &&  Objects.equals(this.backendNodeId, o.backendNodeId)
602                &&  Objects.equals(this.keyframesRule, o.keyframesRule)
603                &&  Objects.equals(this.easing, o.easing);
604        }
605        
606        /** Generates a Hash-Code for {@code 'this'} instance */
607        public int hashCode()
608        {
609            return
610                    Objects.hashCode(this.delay)
611                +   Objects.hashCode(this.endDelay)
612                +   Objects.hashCode(this.iterationStart)
613                +   Objects.hashCode(this.iterations)
614                +   Objects.hashCode(this.duration)
615                +   Objects.hashCode(this.direction)
616                +   Objects.hashCode(this.fill)
617                +   Objects.hashCode(this.backendNodeId)
618                +   this.keyframesRule.hashCode()
619                +   Objects.hashCode(this.easing);
620        }
621    }
622    
623    /** Keyframes Rule */
624    public static class KeyframesRule
625        extends BaseType
626        implements java.io.Serializable
627    {
628        /** For Object Serialization.  java.io.Serializable */
629        protected static final long serialVersionUID = 1;
630        
631        public boolean[] optionals()
632        { return new boolean[] { true, false, }; }
633        
634        /**
635         * CSS keyframed animation's name.
636         * <BR /><B CLASS=Opt>OPTIONAL</B>
637         */
638        public final String name;
639        
640        /** List of animation keyframes. */
641        public final Animation.KeyframeStyle[] keyframes;
642        
643        /**
644         * Constructor
645         *
646         * @param name CSS keyframed animation's name.
647         * <BR /><B CLASS=Opt>OPTIONAL</B>
648         * 
649         * @param keyframes List of animation keyframes.
650         */
651        public KeyframesRule(String name, Animation.KeyframeStyle[] keyframes)
652        {
653            // Exception-Check(s) to ensure that if any parameters which are not declared as
654            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
655            
656            if (keyframes == null) THROWS.throwNPE("keyframes");
657            
658            this.name       = name;
659            this.keyframes  = keyframes;
660        }
661        
662        /**
663         * JSON Object Constructor
664         * @param jo A Json-Object having data about an instance of {@code 'KeyframesRule'}.
665         */
666        public KeyframesRule (JsonObject jo)
667        {
668            this.name       = ReadJSON.getString(jo, "name", true, false);
669            this.keyframes = (jo.getJsonArray("keyframes") == null)
670                ? null
671                : RJArrIntoStream.objArr(jo.getJsonArray("keyframes"), null, 0, Animation.KeyframeStyle.class).toArray(Animation.KeyframeStyle[]::new);
672        
673        }
674        
675        
676        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
677        public boolean equals(Object other)
678        {
679            if (this == other)                       return true;
680            if (other == null)                       return false;
681            if (other.getClass() != this.getClass()) return false;
682        
683            KeyframesRule o = (KeyframesRule) other;
684        
685            return
686                    Objects.equals(this.name, o.name)
687                &&  Arrays.deepEquals(this.keyframes, o.keyframes);
688        }
689        
690        /** Generates a Hash-Code for {@code 'this'} instance */
691        public int hashCode()
692        {
693            return
694                    Objects.hashCode(this.name)
695                +   Arrays.deepHashCode(this.keyframes);
696        }
697    }
698    
699    /** Keyframe Style */
700    public static class KeyframeStyle
701        extends BaseType
702        implements java.io.Serializable
703    {
704        /** For Object Serialization.  java.io.Serializable */
705        protected static final long serialVersionUID = 1;
706        
707        public boolean[] optionals()
708        { return new boolean[] { false, false, }; }
709        
710        /** Keyframe's time offset. */
711        public final String offset;
712        
713        /** {@code AnimationEffect}'s timing function. */
714        public final String easing;
715        
716        /**
717         * Constructor
718         *
719         * @param offset Keyframe's time offset.
720         * 
721         * @param easing {@code AnimationEffect}'s timing function.
722         */
723        public KeyframeStyle(String offset, String easing)
724        {
725            // Exception-Check(s) to ensure that if any parameters which are not declared as
726            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
727            
728            if (offset == null) THROWS.throwNPE("offset");
729            if (easing == null) THROWS.throwNPE("easing");
730            
731            this.offset  = offset;
732            this.easing  = easing;
733        }
734        
735        /**
736         * JSON Object Constructor
737         * @param jo A Json-Object having data about an instance of {@code 'KeyframeStyle'}.
738         */
739        public KeyframeStyle (JsonObject jo)
740        {
741            this.offset  = ReadJSON.getString(jo, "offset", false, true);
742            this.easing  = ReadJSON.getString(jo, "easing", false, true);
743        }
744        
745        
746        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
747        public boolean equals(Object other)
748        {
749            if (this == other)                       return true;
750            if (other == null)                       return false;
751            if (other.getClass() != this.getClass()) return false;
752        
753            KeyframeStyle o = (KeyframeStyle) other;
754        
755            return
756                    Objects.equals(this.offset, o.offset)
757                &&  Objects.equals(this.easing, o.easing);
758        }
759        
760        /** Generates a Hash-Code for {@code 'this'} instance */
761        public int hashCode()
762        {
763            return
764                    Objects.hashCode(this.offset)
765                +   Objects.hashCode(this.easing);
766        }
767    }
768    
769    /** Event for when an animation has been cancelled. */
770    public static class animationCanceled
771        extends BrowserEvent
772        implements java.io.Serializable
773    {
774        /** For Object Serialization.  java.io.Serializable */
775        protected static final long serialVersionUID = 1;
776        
777        public boolean[] optionals()
778        { return new boolean[] { false, }; }
779        
780        /** Id of the animation that was cancelled. */
781        public final String id;
782        
783        /**
784         * Constructor
785         *
786         * @param id Id of the animation that was cancelled.
787         */
788        public animationCanceled(String id)
789        {
790            super("Animation", "animationCanceled", 1);
791            
792            // Exception-Check(s) to ensure that if any parameters which are not declared as
793            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
794            
795            if (id == null) THROWS.throwNPE("id");
796            
797            this.id  = id;
798        }
799        
800        /**
801         * JSON Object Constructor
802         * @param jo A Json-Object having data about an instance of {@code 'animationCanceled'}.
803         */
804        public animationCanceled (JsonObject jo)
805        {
806            super("Animation", "animationCanceled", 1);
807        
808            this.id  = ReadJSON.getString(jo, "id", false, true);
809        }
810        
811        
812        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
813        public boolean equals(Object other)
814        {
815            if (this == other)                       return true;
816            if (other == null)                       return false;
817            if (other.getClass() != this.getClass()) return false;
818        
819            animationCanceled o = (animationCanceled) other;
820        
821            return
822                    Objects.equals(this.id, o.id);
823        }
824        
825        /** Generates a Hash-Code for {@code 'this'} instance */
826        public int hashCode()
827        {
828            return
829                    Objects.hashCode(this.id);
830        }
831    }
832    
833    /** Event for each animation that has been created. */
834    public static class animationCreated
835        extends BrowserEvent
836        implements java.io.Serializable
837    {
838        /** For Object Serialization.  java.io.Serializable */
839        protected static final long serialVersionUID = 1;
840        
841        public boolean[] optionals()
842        { return new boolean[] { false, }; }
843        
844        /** Id of the animation that was created. */
845        public final String id;
846        
847        /**
848         * Constructor
849         *
850         * @param id Id of the animation that was created.
851         */
852        public animationCreated(String id)
853        {
854            super("Animation", "animationCreated", 1);
855            
856            // Exception-Check(s) to ensure that if any parameters which are not declared as
857            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
858            
859            if (id == null) THROWS.throwNPE("id");
860            
861            this.id  = id;
862        }
863        
864        /**
865         * JSON Object Constructor
866         * @param jo A Json-Object having data about an instance of {@code 'animationCreated'}.
867         */
868        public animationCreated (JsonObject jo)
869        {
870            super("Animation", "animationCreated", 1);
871        
872            this.id  = ReadJSON.getString(jo, "id", false, true);
873        }
874        
875        
876        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
877        public boolean equals(Object other)
878        {
879            if (this == other)                       return true;
880            if (other == null)                       return false;
881            if (other.getClass() != this.getClass()) return false;
882        
883            animationCreated o = (animationCreated) other;
884        
885            return
886                    Objects.equals(this.id, o.id);
887        }
888        
889        /** Generates a Hash-Code for {@code 'this'} instance */
890        public int hashCode()
891        {
892            return
893                    Objects.hashCode(this.id);
894        }
895    }
896    
897    /** Event for animation that has been started. */
898    public static class animationStarted
899        extends BrowserEvent
900        implements java.io.Serializable
901    {
902        /** For Object Serialization.  java.io.Serializable */
903        protected static final long serialVersionUID = 1;
904        
905        public boolean[] optionals()
906        { return new boolean[] { false, }; }
907        
908        /** Animation that was started. */
909        public final Animation._Animation animation;
910        
911        /**
912         * Constructor
913         *
914         * @param animation Animation that was started.
915         */
916        public animationStarted(Animation._Animation animation)
917        {
918            super("Animation", "animationStarted", 1);
919            
920            // Exception-Check(s) to ensure that if any parameters which are not declared as
921            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
922            
923            if (animation == null) THROWS.throwNPE("animation");
924            
925            this.animation  = animation;
926        }
927        
928        /**
929         * JSON Object Constructor
930         * @param jo A Json-Object having data about an instance of {@code 'animationStarted'}.
931         */
932        public animationStarted (JsonObject jo)
933        {
934            super("Animation", "animationStarted", 1);
935        
936            this.animation  = ReadJSON.getObject(jo, "animation", Animation._Animation.class, false, true);
937        }
938        
939        
940        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
941        public boolean equals(Object other)
942        {
943            if (this == other)                       return true;
944            if (other == null)                       return false;
945            if (other.getClass() != this.getClass()) return false;
946        
947            animationStarted o = (animationStarted) other;
948        
949            return
950                    Objects.equals(this.animation, o.animation);
951        }
952        
953        /** Generates a Hash-Code for {@code 'this'} instance */
954        public int hashCode()
955        {
956            return
957                    this.animation.hashCode();
958        }
959    }
960    
961    /** Event for animation that has been updated. */
962    public static class animationUpdated
963        extends BrowserEvent
964        implements java.io.Serializable
965    {
966        /** For Object Serialization.  java.io.Serializable */
967        protected static final long serialVersionUID = 1;
968        
969        public boolean[] optionals()
970        { return new boolean[] { false, }; }
971        
972        /** Animation that was updated. */
973        public final Animation._Animation animation;
974        
975        /**
976         * Constructor
977         *
978         * @param animation Animation that was updated.
979         */
980        public animationUpdated(Animation._Animation animation)
981        {
982            super("Animation", "animationUpdated", 1);
983            
984            // Exception-Check(s) to ensure that if any parameters which are not declared as
985            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
986            
987            if (animation == null) THROWS.throwNPE("animation");
988            
989            this.animation  = animation;
990        }
991        
992        /**
993         * JSON Object Constructor
994         * @param jo A Json-Object having data about an instance of {@code 'animationUpdated'}.
995         */
996        public animationUpdated (JsonObject jo)
997        {
998            super("Animation", "animationUpdated", 1);
999        
1000            this.animation  = ReadJSON.getObject(jo, "animation", Animation._Animation.class, false, true);
1001        }
1002        
1003        
1004        /** Checks whether {@code 'this'} equals an input Java-{@code Object} */
1005        public boolean equals(Object other)
1006        {
1007            if (this == other)                       return true;
1008            if (other == null)                       return false;
1009            if (other.getClass() != this.getClass()) return false;
1010        
1011            animationUpdated o = (animationUpdated) other;
1012        
1013            return
1014                    Objects.equals(this.animation, o.animation);
1015        }
1016        
1017        /** Generates a Hash-Code for {@code 'this'} instance */
1018        public int hashCode()
1019        {
1020            return
1021                    this.animation.hashCode();
1022        }
1023    }
1024    
1025    
1026    // Counter for keeping the WebSocket Request ID's distinct.
1027    private static int counter = 1;
1028    
1029    /**
1030     * Disables animation domain notifications.
1031     * 
1032     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1033     * {@link Ret0}&gt;</CODE>
1034     *
1035     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1036     * browser receives the invocation-request.
1037     *
1038     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1039     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1040     * {@code >} to ensure the Browser Function has run to completion.
1041     */
1042    public static Script<String, JsonObject, Ret0> disable()
1043    {
1044        final int          webSocketID = 8000000 + counter++;
1045        final boolean[]    optionals   = new boolean[0];
1046        
1047        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1048        String requestJSON = WriteJSON.get(
1049            parameterTypes.get("disable"),
1050            parameterNames.get("disable"),
1051            optionals, webSocketID,
1052            "Animation.disable"
1053        );
1054        
1055        // This Remote Command does not have a Return-Value.
1056        return new Script<>
1057            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1058    }
1059    
1060    /**
1061     * Enables animation domain notifications.
1062     * 
1063     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1064     * {@link Ret0}&gt;</CODE>
1065     *
1066     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1067     * browser receives the invocation-request.
1068     *
1069     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1070     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1071     * {@code >} to ensure the Browser Function has run to completion.
1072     */
1073    public static Script<String, JsonObject, Ret0> enable()
1074    {
1075        final int          webSocketID = 8001000 + counter++;
1076        final boolean[]    optionals   = new boolean[0];
1077        
1078        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1079        String requestJSON = WriteJSON.get(
1080            parameterTypes.get("enable"),
1081            parameterNames.get("enable"),
1082            optionals, webSocketID,
1083            "Animation.enable"
1084        );
1085        
1086        // This Remote Command does not have a Return-Value.
1087        return new Script<>
1088            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1089    }
1090    
1091    /**
1092     * Returns the current time of the an animation.
1093     * 
1094     * @param id Id of animation.
1095     * 
1096     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1097     * Number&gt;</CODE>
1098     * 
1099     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1100     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1101     * Number&gt;</CODE> will be returned.
1102     *
1103     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1104     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1105      * may be retrieved.</I>
1106     *
1107     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1108     * <BR /><BR /><UL CLASS=JDUL>
1109     * <LI><CODE>Number (<B>currentTime</B></CODE>)
1110     *     <BR />Current time of the page.
1111     * </LI>
1112     * </UL> */
1113    public static Script<String, JsonObject, Number> getCurrentTime(String id)
1114    {
1115        // Exception-Check(s) to ensure that if any parameters which are not declared as
1116        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1117        
1118        if (id == null) THROWS.throwNPE("id");
1119        
1120        final int       webSocketID = 8002000 + counter++;
1121        final boolean[] optionals   = { false, };
1122        
1123        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1124        String requestJSON = WriteJSON.get(
1125            parameterTypes.get("getCurrentTime"),
1126            parameterNames.get("getCurrentTime"),
1127            optionals, webSocketID,
1128            "Animation.getCurrentTime",
1129            id
1130        );
1131        
1132        // 'JSON Binding' ... Converts Browser Response-JSON to 'Number'
1133        Function<JsonObject, Number> responseProcessor = (JsonObject jo) ->
1134            ReadNumberJSON.get(jo, "currentTime", false, true);
1135        
1136        return new Script<>(webSocketID, requestJSON, responseProcessor);
1137    }
1138    
1139    /**
1140     * Gets the playback rate of the document timeline.
1141     * 
1142     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1143     * Number&gt;</CODE>
1144     * 
1145     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1146     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1147     * Number&gt;</CODE> will be returned.
1148     *
1149     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1150     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1151      * may be retrieved.</I>
1152     *
1153     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1154     * <BR /><BR /><UL CLASS=JDUL>
1155     * <LI><CODE>Number (<B>playbackRate</B></CODE>)
1156     *     <BR />Playback rate for animations on page.
1157     * </LI>
1158     * </UL> */
1159    public static Script<String, JsonObject, Number> getPlaybackRate()
1160    {
1161        final int          webSocketID = 8003000 + counter++;
1162        final boolean[]    optionals   = new boolean[0];
1163        
1164        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1165        String requestJSON = WriteJSON.get(
1166            parameterTypes.get("getPlaybackRate"),
1167            parameterNames.get("getPlaybackRate"),
1168            optionals, webSocketID,
1169            "Animation.getPlaybackRate"
1170        );
1171        
1172        // 'JSON Binding' ... Converts Browser Response-JSON to 'Number'
1173        Function<JsonObject, Number> responseProcessor = (JsonObject jo) ->
1174            ReadNumberJSON.get(jo, "playbackRate", false, true);
1175        
1176        return new Script<>(webSocketID, requestJSON, responseProcessor);
1177    }
1178    
1179    /**
1180     * Releases a set of animations to no longer be manipulated.
1181     * 
1182     * @param animations List of animation ids to seek.
1183     * 
1184     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1185     * {@link Ret0}&gt;</CODE>
1186     *
1187     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1188     * browser receives the invocation-request.
1189     *
1190     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1191     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1192     * {@code >} to ensure the Browser Function has run to completion.
1193     */
1194    public static Script<String, JsonObject, Ret0> releaseAnimations(String[] animations)
1195    {
1196        // Exception-Check(s) to ensure that if any parameters which are not declared as
1197        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1198        
1199        if (animations == null) THROWS.throwNPE("animations");
1200        
1201        final int       webSocketID = 8004000 + counter++;
1202        final boolean[] optionals   = { false, };
1203        
1204        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1205        String requestJSON = WriteJSON.get(
1206            parameterTypes.get("releaseAnimations"),
1207            parameterNames.get("releaseAnimations"),
1208            optionals, webSocketID,
1209            "Animation.releaseAnimations",
1210            (Object) animations
1211        );
1212        
1213        // This Remote Command does not have a Return-Value.
1214        return new Script<>
1215            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1216    }
1217    
1218    /**
1219     * Gets the remote object of the Animation.
1220     * 
1221     * @param animationId Animation id.
1222     * 
1223     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1224     * {@link RunTime.RemoteObject}&gt;</CODE>
1225     * 
1226     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1227     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1228     * {@link RunTime.RemoteObject}&gt;</CODE> will be returned.
1229     *
1230     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1231     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1232      * may be retrieved.</I>
1233     *
1234     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1235     * <BR /><BR /><UL CLASS=JDUL>
1236     * <LI><CODE>{@link RunTime.RemoteObject} (<B>remoteObject</B></CODE>)
1237     *     <BR />Corresponding remote object.
1238     * </LI>
1239     * </UL> */
1240    public static Script<String, JsonObject, RunTime.RemoteObject> resolveAnimation
1241        (String animationId)
1242    {
1243        // Exception-Check(s) to ensure that if any parameters which are not declared as
1244        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1245        
1246        if (animationId == null) THROWS.throwNPE("animationId");
1247        
1248        final int       webSocketID = 8005000 + counter++;
1249        final boolean[] optionals   = { false, };
1250        
1251        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1252        String requestJSON = WriteJSON.get(
1253            parameterTypes.get("resolveAnimation"),
1254            parameterNames.get("resolveAnimation"),
1255            optionals, webSocketID,
1256            "Animation.resolveAnimation",
1257            animationId
1258        );
1259        
1260        // 'JSON Binding' ... Converts Browser Response-JSON to 'RunTime.RemoteObject'
1261        Function<JsonObject, RunTime.RemoteObject> responseProcessor = (JsonObject jo) ->
1262            ReadJSON.getObject(jo, "remoteObject", RunTime.RemoteObject.class, false, true);
1263        
1264        return new Script<>(webSocketID, requestJSON, responseProcessor);
1265    }
1266    
1267    /**
1268     * Seek a set of animations to a particular time within each animation.
1269     * 
1270     * @param animations List of animation ids to seek.
1271     * 
1272     * @param currentTime Set the current time of each animation.
1273     * 
1274     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1275     * {@link Ret0}&gt;</CODE>
1276     *
1277     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1278     * browser receives the invocation-request.
1279     *
1280     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1281     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1282     * {@code >} to ensure the Browser Function has run to completion.
1283     */
1284    public static Script<String, JsonObject, Ret0> seekAnimations
1285        (String[] animations, Number currentTime)
1286    {
1287        // Exception-Check(s) to ensure that if any parameters which are not declared as
1288        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1289        
1290        if (animations == null)  THROWS.throwNPE("animations");
1291        if (currentTime == null) THROWS.throwNPE("currentTime");
1292        
1293        final int       webSocketID = 8006000 + counter++;
1294        final boolean[] optionals   = { false, false, };
1295        
1296        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1297        String requestJSON = WriteJSON.get(
1298            parameterTypes.get("seekAnimations"),
1299            parameterNames.get("seekAnimations"),
1300            optionals, webSocketID,
1301            "Animation.seekAnimations",
1302            animations, currentTime
1303        );
1304        
1305        // This Remote Command does not have a Return-Value.
1306        return new Script<>
1307            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1308    }
1309    
1310    /**
1311     * Sets the paused state of a set of animations.
1312     * 
1313     * @param animations Animations to set the pause state of.
1314     * 
1315     * @param paused Paused state to set to.
1316     * 
1317     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1318     * {@link Ret0}&gt;</CODE>
1319     *
1320     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1321     * browser receives the invocation-request.
1322     *
1323     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1324     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1325     * {@code >} to ensure the Browser Function has run to completion.
1326     */
1327    public static Script<String, JsonObject, Ret0> setPaused
1328        (String[] animations, boolean paused)
1329    {
1330        // Exception-Check(s) to ensure that if any parameters which are not declared as
1331        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1332        
1333        if (animations == null) THROWS.throwNPE("animations");
1334        
1335        final int       webSocketID = 8007000 + counter++;
1336        final boolean[] optionals   = { false, false, };
1337        
1338        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1339        String requestJSON = WriteJSON.get(
1340            parameterTypes.get("setPaused"),
1341            parameterNames.get("setPaused"),
1342            optionals, webSocketID,
1343            "Animation.setPaused",
1344            animations, paused
1345        );
1346        
1347        // This Remote Command does not have a Return-Value.
1348        return new Script<>
1349            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1350    }
1351    
1352    /**
1353     * Sets the playback rate of the document timeline.
1354     * 
1355     * @param playbackRate Playback rate for animations on page
1356     * 
1357     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1358     * {@link Ret0}&gt;</CODE>
1359     *
1360     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1361     * browser receives the invocation-request.
1362     *
1363     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1364     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1365     * {@code >} to ensure the Browser Function has run to completion.
1366     */
1367    public static Script<String, JsonObject, Ret0> setPlaybackRate(Number playbackRate)
1368    {
1369        // Exception-Check(s) to ensure that if any parameters which are not declared as
1370        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1371        
1372        if (playbackRate == null) THROWS.throwNPE("playbackRate");
1373        
1374        final int       webSocketID = 8008000 + counter++;
1375        final boolean[] optionals   = { false, };
1376        
1377        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1378        String requestJSON = WriteJSON.get(
1379            parameterTypes.get("setPlaybackRate"),
1380            parameterNames.get("setPlaybackRate"),
1381            optionals, webSocketID,
1382            "Animation.setPlaybackRate",
1383            playbackRate
1384        );
1385        
1386        // This Remote Command does not have a Return-Value.
1387        return new Script<>
1388            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1389    }
1390    
1391    /**
1392     * Sets the timing of an animation node.
1393     * 
1394     * @param animationId Animation id.
1395     * 
1396     * @param duration Duration of the animation.
1397     * 
1398     * @param delay Delay of the animation.
1399     * 
1400     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1401     * {@link Ret0}&gt;</CODE>
1402     *
1403     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1404     * browser receives the invocation-request.
1405     *
1406     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1407     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1408     * {@code >} to ensure the Browser Function has run to completion.
1409     */
1410    public static Script<String, JsonObject, Ret0> setTiming
1411        (String animationId, Number duration, Number delay)
1412    {
1413        // Exception-Check(s) to ensure that if any parameters which are not declared as
1414        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1415        
1416        if (animationId == null) THROWS.throwNPE("animationId");
1417        if (duration == null)    THROWS.throwNPE("duration");
1418        if (delay == null)       THROWS.throwNPE("delay");
1419        
1420        final int       webSocketID = 8009000 + counter++;
1421        final boolean[] optionals   = { false, false, false, };
1422        
1423        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1424        String requestJSON = WriteJSON.get(
1425            parameterTypes.get("setTiming"),
1426            parameterNames.get("setTiming"),
1427            optionals, webSocketID,
1428            "Animation.setTiming",
1429            animationId, duration, delay
1430        );
1431        
1432        // This Remote Command does not have a Return-Value.
1433        return new Script<>
1434            (webSocketID, requestJSON, VOID_RETURN.NoReturnValues);
1435    }
1436    
1437}