Search in sources :

Example 1 with ImageViewEx

use of org.develnext.jphp.ext.javafx.support.ImageViewEx in project jphp by jphp-compiler.

the class UXImageArea method __construct.

@Signature
public void __construct(@Nullable Image image) {
    __wrappedObject = new ImageViewEx();
    getWrappedObject().setImage(image);
}
Also used : ImageViewEx(org.develnext.jphp.ext.javafx.support.ImageViewEx)

Example 2 with ImageViewEx

use of org.develnext.jphp.ext.javafx.support.ImageViewEx in project jphp by jphp-compiler.

the class FXLauncher method readConfig.

@Override
protected void readConfig() {
    super.readConfig();
    Memory fxSplash = getConfigValue("fx.splash");
    if (fxSplash.toBoolean()) {
        InputStream fxSplashStream = getClass().getResourceAsStream(fxSplash.toString());
        if (fxSplashStream == null) {
            System.err.println("Failed to load 'fx.splash': " + fxSplash.toString());
            return;
        }
        new JFXPanel();
        Platform.runLater(() -> {
            Image image = new Image(fxSplashStream);
            ImageViewEx imageView = new ImageViewEx();
            imageView.setAutoSize(true);
            imageView.setImage(image);
            splashStage = new Stage(StageStyle.TRANSPARENT);
            VBox root = new VBox(imageView);
            root.setBackground(null);
            Scene scene = new Scene(root);
            scene.setFill(null);
            splashStage.setScene(scene);
            Memory opacity = getConfigValue("fx.splash.opacity");
            if (opacity.isNotNull()) {
                splashStage.setOpacity(opacity.toDouble());
            }
            Memory alwaysOnTop = getConfigValue("fx.splash.alwaysOnTop");
            if (alwaysOnTop.isNotNull()) {
                splashStage.setAlwaysOnTop(alwaysOnTop.toBoolean());
            }
            splashStage.centerOnScreen();
            splashStage.show();
            splashStage.centerOnScreen();
        });
    }
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) ImageViewEx(org.develnext.jphp.ext.javafx.support.ImageViewEx) Memory(php.runtime.Memory) StringMemory(php.runtime.memory.StringMemory) InputStream(java.io.InputStream) Stage(javafx.stage.Stage) UXImage(org.develnext.jphp.ext.javafx.classes.UXImage) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox)

Aggregations

ImageViewEx (org.develnext.jphp.ext.javafx.support.ImageViewEx)2 InputStream (java.io.InputStream)1 JFXPanel (javafx.embed.swing.JFXPanel)1 Scene (javafx.scene.Scene)1 Image (javafx.scene.image.Image)1 VBox (javafx.scene.layout.VBox)1 Stage (javafx.stage.Stage)1 UXImage (org.develnext.jphp.ext.javafx.classes.UXImage)1 Memory (php.runtime.Memory)1 StringMemory (php.runtime.memory.StringMemory)1