package org.develnext.jphp.ext.javafx.classes;

import javafx.scene.media.MediaPlayer;
import org.develnext.jphp.ext.javafx.JavaFXExtension;
import org.develnext.jphp.ext.javafx.classes.layout.UXAnchorPane;
import org.develnext.jphp.ext.javafx.classes.layout.UXPanel;
import org.develnext.jphp.ext.javafx.support.control.MediaViewBox;
import php.runtime.annotation.Reflection;
import php.runtime.annotation.Reflection.Nullable;
import php.runtime.annotation.Reflection.Property;
import php.runtime.annotation.Reflection.Signature;
import php.runtime.env.Environment;
import php.runtime.reflection.ClassEntity;

@Reflection.Name(JavaFXExtension.NS + "UXMediaViewBox")
public class UXMediaViewBox extends UXPanel<MediaViewBox> {
    interface WrappedInterface {
        @Property("player") @Nullable MediaPlayer mediaPlayer();
        @Property boolean proportional();
        @Property boolean smooth();
    }

    public UXMediaViewBox(Environment env, MediaViewBox wrappedObject) {
        super(env, wrappedObject);
    }

    public UXMediaViewBox(Environment env, ClassEntity clazz) {
        super(env, clazz);
    }

    @Override
    @Signature
    public void __construct() {
        __wrappedObject = new MediaViewBox();
    }
}

@@ -43,16 +43,50 @@
 ses;%0D%0A%0D%0A
+import javafx.scene.media.Media;%0D%0A
 import j
@@ -117,16 +117,16 @@
 layer;%0D%0A
-
 import o
@@ -652,16 +652,40 @@
 ity;%0D%0A%0D%0A
+import java.io.File;%0D%0A%0D%0A
 @Reflect
@@ -1264,24 +1264,24 @@
 struct() %7B%0D%0A
-
         __wr
@@ -1321,12 +1321,1052 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    @Signature%0D%0A    public void open(String fileName) %7B%0D%0A        open(fileName, true);%0D%0A    %7D%0D%0A%0D%0A    @Signature%0D%0A    public void open(String fileName, boolean autoPlay) %7B%0D%0A        getWrappedObject().setMediaPlayer(new MediaPlayer(new Media(new File(fileName).toURI().toString())));%0D%0A%0D%0A        if (autoPlay) %7B%0D%0A            play();%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @Signature%0D%0A    public boolean play() %7B%0D%0A        if (getWrappedObject().getMediaPlayer() == null) %7B%0D%0A            return false;%0D%0A        %7D%0D%0A%0D%0A        getWrappedObject().getMediaPlayer().play();%0D%0A        return true;%0D%0A    %7D%0D%0A%0D%0A    @Signature%0D%0A    public boolean stop() %7B%0D%0A        if (getWrappedObject().getMediaPlayer() == null) %7B%0D%0A            return false;%0D%0A        %7D%0D%0A%0D%0A        getWrappedObject().getMediaPlayer().stop();%0D%0A        return true;%0D%0A    %7D%0D%0A%0D%0A    @Signature%0D%0A    public boolean pause() %7B%0D%0A        if (getWrappedObject().getMediaPlayer() == null) %7B%0D%0A            return false;%0D%0A        %7D%0D%0A%0D%0A        getWrappedObject().getMediaPlayer().pause();%0D%0A        return true;%0D%0A    %7D%0D
 %0A%7D%0D%0A

Improve UXMediaViewBox.