001package Torello.Browser.BrowserAPI; 002 003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 004// Java-HTML Imports 005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 006 007import Torello.Browser.*; 008import Torello.Browser.helper.*; 009import Torello.Browser.JavaScriptAPI.*; 010import Torello.JSON.*; 011 012import Torello.Java.ReadOnly.ReadOnlyList; 013import Torello.Java.ReadOnly.ReadOnlyArrayList; 014 015import Torello.JavaDoc.Annotations.StaticFunctional; 016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg; 017 018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Animation$$Commands; 019 020 021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 022// JDK Imports 023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 024 025import javax.json.JsonObject; 026import javax.json.JsonValue; 027 028/** 029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN> 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE> 031 */ 032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE") 033public class Animation 034{ 035 // No Pubic Constructors 036 private Animation() { } 037 038 039 040 // ******************************************************************************************** 041 // ******************************************************************************************** 042 // Basic Types 043 // ******************************************************************************************** 044 // ******************************************************************************************** 045 046 047 /** 048 * AnimationEffect instance 049 * 050 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 051 */ 052 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 053 public static class AnimationEffect 054 extends BaseType<AnimationEffect> 055 implements java.io.Serializable 056 { 057 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 058 protected static final long serialVersionUID = 1; 059 060 private static final NestedHelper<Animation.AnimationEffect> singleton = 061 Torello.Browser.BrowserAPI.NestedHelpers.Types. 062 Animation$$AnimationEffect$$.singleton; 063 064 /** <CODE>AnimationEffect</CODE>'s delay. */ 065 public final Number delay; 066 067 /** <CODE>AnimationEffect</CODE>'s end delay. */ 068 public final Number endDelay; 069 070 /** <CODE>AnimationEffect</CODE>'s iteration start. */ 071 public final Number iterationStart; 072 073 /** <CODE>AnimationEffect</CODE>'s iterations. */ 074 public final Number iterations; 075 076 /** 077 * <CODE>AnimationEffect</CODE>'s iteration duration. 078 * Milliseconds for time based animations and 079 * percentage [0 - 100] for scroll driven animations 080 * (i.e. when viewOrScrollTimeline exists). 081 */ 082 public final Number duration; 083 084 /** <CODE>AnimationEffect</CODE>'s playback direction. */ 085 public final String direction; 086 087 /** <CODE>AnimationEffect</CODE>'s fill mode. */ 088 public final String fill; 089 090 /** 091 * <CODE>AnimationEffect</CODE>'s target node. 092 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 093 */ 094 public final Integer backendNodeId; 095 096 /** 097 * <CODE>AnimationEffect</CODE>'s keyframes. 098 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 099 */ 100 public final Animation.KeyframesRule keyframesRule; 101 102 /** <CODE>AnimationEffect</CODE>'s timing function. */ 103 public final String easing; 104 105 /** Constructor. Please review this class' fields for documentation. */ 106 public AnimationEffect( 107 ReadOnlyList<Boolean> isPresent, Number delay, Number endDelay, 108 Number iterationStart, Number iterations, Number duration, String direction, 109 String fill, Integer backendNodeId, KeyframesRule keyframesRule, String easing 110 ) 111 { 112 super(singleton, Domains.Animation, "AnimationEffect", 10); 113 114 this.delay = delay; 115 this.endDelay = endDelay; 116 this.iterationStart = iterationStart; 117 this.iterations = iterations; 118 this.duration = duration; 119 this.direction = direction; 120 this.fill = fill; 121 this.backendNodeId = backendNodeId; 122 this.keyframesRule = keyframesRule; 123 this.easing = easing; 124 125 this.isPresent = (isPresent == null) 126 ? singleton.generateIsPresentList(this) 127 : THROWS.check(isPresent, 10, "Animation.AnimationEffect"); 128 } 129 130 /** Creates an instance of this class from a {@link JsonObject}.*/ 131 public static AnimationEffect fromJSON(JsonObject jo) 132 { return singleton.fromJSON(jo); } 133 134 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 135 public static NestedDescriptor<AnimationEffect> descriptor() 136 { return singleton.descriptor(); } 137 } 138 139 /** 140 * Keyframe Style 141 * 142 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 143 */ 144 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 145 public static class KeyframeStyle 146 extends BaseType<KeyframeStyle> 147 implements java.io.Serializable 148 { 149 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 150 protected static final long serialVersionUID = 1; 151 152 private static final NestedHelper<Animation.KeyframeStyle> singleton = 153 Torello.Browser.BrowserAPI.NestedHelpers.Types. 154 Animation$$KeyframeStyle$$.singleton; 155 156 /** Keyframe's time offset. */ 157 public final String offset; 158 159 /** <CODE>AnimationEffect</CODE>'s timing function. */ 160 public final String easing; 161 162 /** Constructor. Please review this class' fields for documentation. */ 163 public KeyframeStyle(ReadOnlyList<Boolean> isPresent, String offset, String easing) 164 { 165 super(singleton, Domains.Animation, "KeyframeStyle", 2); 166 167 this.offset = offset; 168 this.easing = easing; 169 170 this.isPresent = (isPresent == null) 171 ? singleton.generateIsPresentList(this) 172 : THROWS.check(isPresent, 2, "Animation.KeyframeStyle"); 173 } 174 175 /** Creates an instance of this class from a {@link JsonObject}.*/ 176 public static KeyframeStyle fromJSON(JsonObject jo) 177 { return singleton.fromJSON(jo); } 178 179 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 180 public static NestedDescriptor<KeyframeStyle> descriptor() 181 { return singleton.descriptor(); } 182 } 183 184 /** 185 * Keyframes Rule 186 * 187 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 188 */ 189 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 190 public static class KeyframesRule 191 extends BaseType<KeyframesRule> 192 implements java.io.Serializable 193 { 194 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 195 protected static final long serialVersionUID = 1; 196 197 private static final NestedHelper<Animation.KeyframesRule> singleton = 198 Torello.Browser.BrowserAPI.NestedHelpers.Types. 199 Animation$$KeyframesRule$$.singleton; 200 201 /** 202 * CSS keyframed animation's name. 203 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 204 */ 205 public final String name; 206 207 /** List of animation keyframes. */ 208 public final Animation.KeyframeStyle[] keyframes; 209 210 /** Constructor. Please review this class' fields for documentation. */ 211 public KeyframesRule 212 (ReadOnlyList<Boolean> isPresent, String name, KeyframeStyle[] keyframes) 213 { 214 super(singleton, Domains.Animation, "KeyframesRule", 2); 215 216 this.name = name; 217 this.keyframes = keyframes; 218 219 this.isPresent = (isPresent == null) 220 ? singleton.generateIsPresentList(this) 221 : THROWS.check(isPresent, 2, "Animation.KeyframesRule"); 222 } 223 224 /** Creates an instance of this class from a {@link JsonObject}.*/ 225 public static KeyframesRule fromJSON(JsonObject jo) 226 { return singleton.fromJSON(jo); } 227 228 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 229 public static NestedDescriptor<KeyframesRule> descriptor() 230 { return singleton.descriptor(); } 231 } 232 233 /** 234 * Timeline instance 235 * 236 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 237 */ 238 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 239 public static class ViewOrScrollTimeline 240 extends BaseType<ViewOrScrollTimeline> 241 implements java.io.Serializable 242 { 243 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 244 protected static final long serialVersionUID = 1; 245 246 private static final NestedHelper<Animation.ViewOrScrollTimeline> singleton = 247 Torello.Browser.BrowserAPI.NestedHelpers.Types. 248 Animation$$ViewOrScrollTimeline$$.singleton; 249 250 /** 251 * Scroll container node 252 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 253 */ 254 public final Integer sourceNodeId; 255 256 /** 257 * Represents the starting scroll position of the timeline 258 * as a length offset in pixels from scroll origin. 259 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 260 */ 261 public final Number startOffset; 262 263 /** 264 * Represents the ending scroll position of the timeline 265 * as a length offset in pixels from scroll origin. 266 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 267 */ 268 public final Number endOffset; 269 270 /** 271 * The element whose principal box's visibility in the 272 * scrollport defined the progress of the timeline. 273 * Does not exist for animations with ScrollTimeline 274 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 275 */ 276 public final Integer subjectNodeId; 277 278 /** 279 * Orientation of the scroll 280 * <EMBED CLASS='external-html' DATA-D=DOM DATA-C=ScrollOrientation DATA-F=axis DATA-FILE-ID=CDP.EL2> 281 * @see BaseType#enumStrList(String) 282 */ 283 public final String axis; 284 285 /** Constructor. Please review this class' fields for documentation. */ 286 public ViewOrScrollTimeline( 287 ReadOnlyList<Boolean> isPresent, Integer sourceNodeId, Number startOffset, 288 Number endOffset, Integer subjectNodeId, String axis 289 ) 290 { 291 super(singleton, Domains.Animation, "ViewOrScrollTimeline", 5); 292 293 this.sourceNodeId = sourceNodeId; 294 this.startOffset = startOffset; 295 this.endOffset = endOffset; 296 this.subjectNodeId = subjectNodeId; 297 this.axis = axis; 298 299 this.isPresent = (isPresent == null) 300 ? singleton.generateIsPresentList(this) 301 : THROWS.check(isPresent, 5, "Animation.ViewOrScrollTimeline"); 302 } 303 304 /** Creates an instance of this class from a {@link JsonObject}.*/ 305 public static ViewOrScrollTimeline fromJSON(JsonObject jo) 306 { return singleton.fromJSON(jo); } 307 308 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 309 public static NestedDescriptor<ViewOrScrollTimeline> descriptor() 310 { return singleton.descriptor(); } 311 } 312 313 /** 314 * _Animation instance. 315 * 316 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 317 */ 318 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 319 public static class _Animation 320 extends BaseType<_Animation> 321 implements java.io.Serializable 322 { 323 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 324 protected static final long serialVersionUID = 1; 325 326 private static final NestedHelper<Animation._Animation> singleton = 327 Torello.Browser.BrowserAPI.NestedHelpers.Types. 328 Animation$$_Animation$$.singleton; 329 330 /** <CODE>Animation</CODE>'s id. */ 331 public final String id; 332 333 /** <CODE>Animation</CODE>'s name. */ 334 public final String name; 335 336 /** <CODE>Animation</CODE>'s internal paused state. */ 337 public final boolean pausedState; 338 339 /** <CODE>Animation</CODE>'s play state. */ 340 public final String playState; 341 342 /** <CODE>Animation</CODE>'s playback rate. */ 343 public final Number playbackRate; 344 345 /** 346 * <CODE>Animation</CODE>'s start time. 347 * Milliseconds for time based animations and 348 * percentage [0 - 100] for scroll driven animations 349 * (i.e. when viewOrScrollTimeline exists). 350 */ 351 public final Number startTime; 352 353 /** <CODE>Animation</CODE>'s current time. */ 354 public final Number currentTime; 355 356 /** 357 * Animation type of <CODE>Animation</CODE>. 358 * <EMBED CLASS='external-html' DATA-D=Animation DATA-C=_Animation DATA-F=type DATA-FILE-ID=CDP.EL1> 359 * @see BaseType#enumStrList(String) 360 */ 361 public final String type; 362 363 /** 364 * <CODE>Animation</CODE>'s source animation node. 365 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 366 */ 367 public final Animation.AnimationEffect source; 368 369 /** 370 * A unique ID for <CODE>Animation</CODE> representing the sources that triggered this CSS 371 * animation/transition. 372 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 373 */ 374 public final String cssId; 375 376 /** 377 * View or scroll timeline 378 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 379 */ 380 public final Animation.ViewOrScrollTimeline viewOrScrollTimeline; 381 382 /** Constructor. Please review this class' fields for documentation. */ 383 public _Animation( 384 ReadOnlyList<Boolean> isPresent, String id, String name, boolean pausedState, 385 String playState, Number playbackRate, Number startTime, Number currentTime, 386 String type, AnimationEffect source, String cssId, 387 ViewOrScrollTimeline viewOrScrollTimeline 388 ) 389 { 390 super(singleton, Domains.Animation, "_Animation", 11); 391 392 this.id = id; 393 this.name = name; 394 this.pausedState = pausedState; 395 this.playState = playState; 396 this.playbackRate = playbackRate; 397 this.startTime = startTime; 398 this.currentTime = currentTime; 399 this.type = type; 400 this.source = source; 401 this.cssId = cssId; 402 this.viewOrScrollTimeline = viewOrScrollTimeline; 403 404 this.isPresent = (isPresent == null) 405 ? singleton.generateIsPresentList(this) 406 : THROWS.check(isPresent, 11, "Animation._Animation"); 407 } 408 409 /** Creates an instance of this class from a {@link JsonObject}.*/ 410 public static _Animation fromJSON(JsonObject jo) 411 { return singleton.fromJSON(jo); } 412 413 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 414 public static NestedDescriptor<_Animation> descriptor() 415 { return singleton.descriptor(); } 416 } 417 418 419 // ******************************************************************************************** 420 // ******************************************************************************************** 421 // Event Types 422 // ******************************************************************************************** 423 // ******************************************************************************************** 424 425 426 /** 427 * Event for when an animation has been cancelled. 428 * 429 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 430 */ 431 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 432 public static class animationCanceled 433 extends BrowserEvent<animationCanceled> 434 implements java.io.Serializable 435 { 436 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 437 protected static final long serialVersionUID = 1; 438 439 private static final NestedHelper<Animation.animationCanceled> singleton = 440 Torello.Browser.BrowserAPI.NestedHelpers.Events. 441 Animation$$animationCanceled$$.singleton; 442 443 /** Id of the animation that was cancelled. */ 444 public final String id; 445 446 /** Constructor. Please review this class' fields for documentation. */ 447 public animationCanceled(ReadOnlyList<Boolean> isPresent, String id) 448 { 449 super(singleton, Domains.Animation, "animationCanceled", 1); 450 451 this.id = id; 452 453 this.isPresent = (isPresent == null) 454 ? singleton.generateIsPresentList(this) 455 : THROWS.check(isPresent, 1, "Animation.animationCanceled"); 456 } 457 458 /** Creates an instance of this class from a {@link JsonObject}.*/ 459 public static animationCanceled fromJSON(JsonObject jo) 460 { return singleton.fromJSON(jo); } 461 462 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 463 public static NestedDescriptor<animationCanceled> descriptor() 464 { return singleton.descriptor(); } 465 } 466 467 /** 468 * Event for each animation that has been created. 469 * 470 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 471 */ 472 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 473 public static class animationCreated 474 extends BrowserEvent<animationCreated> 475 implements java.io.Serializable 476 { 477 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 478 protected static final long serialVersionUID = 1; 479 480 private static final NestedHelper<Animation.animationCreated> singleton = 481 Torello.Browser.BrowserAPI.NestedHelpers.Events. 482 Animation$$animationCreated$$.singleton; 483 484 /** Id of the animation that was created. */ 485 public final String id; 486 487 /** Constructor. Please review this class' fields for documentation. */ 488 public animationCreated(ReadOnlyList<Boolean> isPresent, String id) 489 { 490 super(singleton, Domains.Animation, "animationCreated", 1); 491 492 this.id = id; 493 494 this.isPresent = (isPresent == null) 495 ? singleton.generateIsPresentList(this) 496 : THROWS.check(isPresent, 1, "Animation.animationCreated"); 497 } 498 499 /** Creates an instance of this class from a {@link JsonObject}.*/ 500 public static animationCreated fromJSON(JsonObject jo) 501 { return singleton.fromJSON(jo); } 502 503 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 504 public static NestedDescriptor<animationCreated> descriptor() 505 { return singleton.descriptor(); } 506 } 507 508 /** 509 * Event for animation that has been started. 510 * 511 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 512 */ 513 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 514 public static class animationStarted 515 extends BrowserEvent<animationStarted> 516 implements java.io.Serializable 517 { 518 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 519 protected static final long serialVersionUID = 1; 520 521 private static final NestedHelper<Animation.animationStarted> singleton = 522 Torello.Browser.BrowserAPI.NestedHelpers.Events. 523 Animation$$animationStarted$$.singleton; 524 525 /** _Animation that was started. */ 526 public final Animation._Animation animation; 527 528 /** Constructor. Please review this class' fields for documentation. */ 529 public animationStarted(ReadOnlyList<Boolean> isPresent, _Animation animation) 530 { 531 super(singleton, Domains.Animation, "animationStarted", 1); 532 533 this.animation = animation; 534 535 this.isPresent = (isPresent == null) 536 ? singleton.generateIsPresentList(this) 537 : THROWS.check(isPresent, 1, "Animation.animationStarted"); 538 } 539 540 /** Creates an instance of this class from a {@link JsonObject}.*/ 541 public static animationStarted fromJSON(JsonObject jo) 542 { return singleton.fromJSON(jo); } 543 544 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 545 public static NestedDescriptor<animationStarted> descriptor() 546 { return singleton.descriptor(); } 547 } 548 549 /** 550 * Event for animation that has been updated. 551 * 552 * <EMBED CLASS=globalDefs DATA-DOMAIN=Animation DATA-API=BrowserAPI> 553 */ 554 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 555 public static class animationUpdated 556 extends BrowserEvent<animationUpdated> 557 implements java.io.Serializable 558 { 559 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 560 protected static final long serialVersionUID = 1; 561 562 private static final NestedHelper<Animation.animationUpdated> singleton = 563 Torello.Browser.BrowserAPI.NestedHelpers.Events. 564 Animation$$animationUpdated$$.singleton; 565 566 /** _Animation that was updated. */ 567 public final Animation._Animation animation; 568 569 /** Constructor. Please review this class' fields for documentation. */ 570 public animationUpdated(ReadOnlyList<Boolean> isPresent, _Animation animation) 571 { 572 super(singleton, Domains.Animation, "animationUpdated", 1); 573 574 this.animation = animation; 575 576 this.isPresent = (isPresent == null) 577 ? singleton.generateIsPresentList(this) 578 : THROWS.check(isPresent, 1, "Animation.animationUpdated"); 579 } 580 581 /** Creates an instance of this class from a {@link JsonObject}.*/ 582 public static animationUpdated fromJSON(JsonObject jo) 583 { return singleton.fromJSON(jo); } 584 585 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 586 public static NestedDescriptor<animationUpdated> descriptor() 587 { return singleton.descriptor(); } 588 } 589 590 591 592 593 // ******************************************************************************************** 594 // ******************************************************************************************** 595 // Commands 596 // ******************************************************************************************** 597 // ******************************************************************************************** 598 599 600 /** 601 * Disables animation domain notifications. 602 * 603 * @return An instance of <CODE>{@link Script}<Void></CODE> 604 * 605 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 606 * browser receives the invocation-request. 607 * 608 * <BR /><BR /><DIV CLASS=JDHint> 609 * This Browser-Function <I>does not have</I> a return-value. You may choose to 610 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 611 * the Browser Function has run to completion. 612 * </DIV> 613 */ 614 public static Script<Void> disable() 615 { 616 // Ultra-Simple Request JSON - Because this method has no parameters 617 final String requestJSON = "{\"method\":\"Animation.disable\"}"; 618 619 return Script.NO_RET(Domains.Animation, "disable", requestJSON); 620 } 621 622 /** 623 * Enables animation domain notifications. 624 * 625 * @return An instance of <CODE>{@link Script}<Void></CODE> 626 * 627 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 628 * browser receives the invocation-request. 629 * 630 * <BR /><BR /><DIV CLASS=JDHint> 631 * This Browser-Function <I>does not have</I> a return-value. You may choose to 632 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 633 * the Browser Function has run to completion. 634 * </DIV> 635 */ 636 public static Script<Void> enable() 637 { 638 // Ultra-Simple Request JSON - Because this method has no parameters 639 final String requestJSON = "{\"method\":\"Animation.enable\"}"; 640 641 return Script.NO_RET(Domains.Animation, "enable", requestJSON); 642 } 643 644 /** 645 * Returns the current time of the an animation. 646 * 647 * @param id Id of animation. 648 * 649 * @return An instance of <CODE>{@link Script}<Number></CODE> 650 * 651 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 652 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 653 * <CODE><Number></CODE> will be returned 654 * 655 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 656 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 657 * be retrieved.</I> 658 * 659 * <BR /><BR /><DIV CLASS=JDHint> 660 * This Browser Function's {@code Promise} returns: 661 * <CODE>Number (<B>currentTime</B>)</CODE> 662 * <BR /> 663 * Current time of the page. 664 * </DIV> 665 */ 666 public static Script<Number> getCurrentTime(String id) 667 { 668 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 669 final String requestJSON = WriteJSON.get 670 (CDPTypes.STRING, "id", false, "Animation.getCurrentTime", id); 671 672 return new Script<>( 673 Domains.Animation, "getCurrentTime", requestJSON, 674 jo -> ReadNumberJSON.get(jo, "currentTime", true, false), 675 Number.class 676 ); 677 } 678 679 /** 680 * Gets the playback rate of the document timeline. 681 * 682 * @return An instance of <CODE>{@link Script}<Number></CODE> 683 * 684 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 685 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 686 * <CODE><Number></CODE> will be returned 687 * 688 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 689 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 690 * be retrieved.</I> 691 * 692 * <BR /><BR /><DIV CLASS=JDHint> 693 * This Browser Function's {@code Promise} returns: 694 * <CODE>Number (<B>playbackRate</B>)</CODE> 695 * <BR /> 696 * Playback rate for animations on page. 697 * </DIV> 698 */ 699 public static Script<Number> getPlaybackRate() 700 { 701 // Ultra-Simple Request JSON - Because this method has no parameters 702 final String requestJSON = "{\"method\":\"Animation.getPlaybackRate\"}"; 703 704 return new Script<>( 705 Domains.Animation, "getPlaybackRate", requestJSON, 706 jo -> ReadNumberJSON.get(jo, "playbackRate", true, false), 707 Number.class 708 ); 709 } 710 711 /** 712 * Releases a set of animations to no longer be manipulated. 713 * 714 * @param animations List of animation ids to seek. 715 * 716 * @return An instance of <CODE>{@link Script}<Void></CODE> 717 * 718 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 719 * browser receives the invocation-request. 720 * 721 * <BR /><BR /><DIV CLASS=JDHint> 722 * This Browser-Function <I>does not have</I> a return-value. You may choose to 723 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 724 * the Browser Function has run to completion. 725 * </DIV> 726 */ 727 public static Script<Void> releaseAnimations(String[] animations) 728 { 729 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 730 final String requestJSON = WriteJSON.get( 731 CDPTypes.STRING_ARRAY_1D, "animations", false, "Animation.releaseAnimations", 732 (Object) animations 733 ); 734 735 return Script.NO_RET(Domains.Animation, "releaseAnimations", requestJSON); 736 } 737 738 /** 739 * Gets the remote object of the Animation. 740 * 741 * @param animationId Animation id. 742 * 743 * @return An instance of <CODE>{@link Script}<{@link RunTime.RemoteObject}></CODE> 744 * 745 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 746 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 747 * <CODE><{@link RunTime.RemoteObject}></CODE> will be returned 748 * 749 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 750 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 751 * be retrieved.</I> 752 * 753 * <BR /><BR /><DIV CLASS=JDHint> 754 * This Browser Function's {@code Promise} returns: 755 * <CODE>{@link RunTime.RemoteObject} (<B>remoteObject</B>)</CODE> 756 * <BR /> 757 * Corresponding remote object. 758 * </DIV> 759 */ 760 public static Script<RunTime.RemoteObject> resolveAnimation(String animationId) 761 { 762 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 763 final String requestJSON = WriteJSON.get 764 (CDPTypes.STRING, "animationId", false, "Animation.resolveAnimation", animationId); 765 766 return new Script<>( 767 Domains.Animation, "resolveAnimation", requestJSON, 768 Animation$$Commands::resolveAnimation, 769 RunTime.RemoteObject.class 770 ); 771 } 772 773 /** 774 * Seek a set of animations to a particular time within each animation. 775 * 776 * @param animations List of animation ids to seek. 777 * 778 * @param currentTime Set the current time of each animation. 779 * 780 * @return An instance of <CODE>{@link Script}<Void></CODE> 781 * 782 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 783 * browser receives the invocation-request. 784 * 785 * <BR /><BR /><DIV CLASS=JDHint> 786 * This Browser-Function <I>does not have</I> a return-value. You may choose to 787 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 788 * the Browser Function has run to completion. 789 * </DIV> 790 */ 791 public static Script<Void> seekAnimations(String[] animations, Number currentTime) 792 { 793 // Convert all Method Parameters into a JSON Request-Object (as a String) 794 final String requestJSON = WriteJSON.get( 795 Animation$$Commands.seekAnimations$$, "Animation.seekAnimations", 796 animations, currentTime 797 ); 798 799 return Script.NO_RET(Domains.Animation, "seekAnimations", requestJSON); 800 } 801 802 /** 803 * Sets the paused state of a set of animations. 804 * 805 * @param animations Animations to set the pause state of. 806 * 807 * @param paused Paused state to set to. 808 * 809 * @return An instance of <CODE>{@link Script}<Void></CODE> 810 * 811 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 812 * browser receives the invocation-request. 813 * 814 * <BR /><BR /><DIV CLASS=JDHint> 815 * This Browser-Function <I>does not have</I> a return-value. You may choose to 816 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 817 * the Browser Function has run to completion. 818 * </DIV> 819 */ 820 public static Script<Void> setPaused(String[] animations, boolean paused) 821 { 822 // Convert all Method Parameters into a JSON Request-Object (as a String) 823 final String requestJSON = WriteJSON.get( 824 Animation$$Commands.setPaused$$, "Animation.setPaused", 825 animations, paused 826 ); 827 828 return Script.NO_RET(Domains.Animation, "setPaused", requestJSON); 829 } 830 831 /** 832 * Sets the playback rate of the document timeline. 833 * 834 * @param playbackRate Playback rate for animations on page 835 * 836 * @return An instance of <CODE>{@link Script}<Void></CODE> 837 * 838 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 839 * browser receives the invocation-request. 840 * 841 * <BR /><BR /><DIV CLASS=JDHint> 842 * This Browser-Function <I>does not have</I> a return-value. You may choose to 843 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 844 * the Browser Function has run to completion. 845 * </DIV> 846 */ 847 public static Script<Void> setPlaybackRate(Number playbackRate) 848 { 849 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 850 final String requestJSON = WriteJSON.get 851 (CDPTypes.NUMBER, "playbackRate", false, "Animation.setPlaybackRate", playbackRate); 852 853 return Script.NO_RET(Domains.Animation, "setPlaybackRate", requestJSON); 854 } 855 856 /** 857 * Sets the timing of an animation node. 858 * 859 * @param animationId Animation id. 860 * 861 * @param duration Duration of the animation. 862 * 863 * @param delay Delay of the animation. 864 * 865 * @return An instance of <CODE>{@link Script}<Void></CODE> 866 * 867 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 868 * browser receives the invocation-request. 869 * 870 * <BR /><BR /><DIV CLASS=JDHint> 871 * This Browser-Function <I>does not have</I> a return-value. You may choose to 872 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 873 * the Browser Function has run to completion. 874 * </DIV> 875 */ 876 public static Script<Void> setTiming(String animationId, Number duration, Number delay) 877 { 878 // Convert all Method Parameters into a JSON Request-Object (as a String) 879 final String requestJSON = WriteJSON.get( 880 Animation$$Commands.setTiming$$, "Animation.setTiming", 881 animationId, duration, delay 882 ); 883 884 return Script.NO_RET(Domains.Animation, "setTiming", requestJSON); 885 } 886 887 888}