java升级后OSX上的JavaFX渲染问题 [英] JavaFX rendering issue on OSX after java upgrade

查看:166
本文介绍了java升级后OSX上的JavaFX渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序与javafx 3D对象工作正常,直到我将java从8u51升级到8u60。
升级后,UI会颠倒显示。
以下是我使用以下测试代码获得的内容。看起来y轴在渲染时是相反的,但在功能上却没有。



我试图将-Dprism.order = sw作为VM选项。这解决了测试问题,
但是不允许渲染javafx 3D对象。



有谁知道如何解决这个java / javafx问题。我将尝试下载并安装Java 8u51。



注意,我已阅读

  import javafx.application.Application; 
import javafx.scene.PerspectiveCamera;
import javafx.scene.SceneAntialiasing;
import javafx.scene.control。*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.scene.Scene;

公共类TestAppj扩展Application {
public static void main(String [] args){Application.launch(args); }
public void start(Stage primaryStage){
primaryStage.setTitle(Test Stage);
TabPane tabbedPane =新的TabPane(新标签(工具,新的BorderPane()),新标签(事物,新的BorderPane()));
MenuBar menuBar = new MenuBar(
新菜单(文件,null,新菜单项(打开),新菜单项(新建),新菜单项(保存)),
new Menu(Edit,null,new MenuItem(Cut),new MenuItem(Copy),new MenuItem(Paste)));
BorderPane root = new BorderPane();
root.setTop(new VBox(menuBar,new ToolBar()));
root.setCenter(tabbedPane);
场景theScene =新场景(root,500,500,true,SceneAntialiasing.BALANCED);
theScene.setCamera(new PerspectiveCamera());
primaryStage.setScene(theScene);
primaryStage.show();
}
}


解决方案

这复制你在Mac上使用8u60找到的错误的缩短方法:

  @Override 
public void start( Stage primaryStage){
场景场景=新场景(新的StackPane(新标签(Antialising\\\
Balanced)),
300,300,true,SceneAntialiasing.BALANCED);
primaryStage.setScene(scene);
primaryStage.show();
}



问题不在相机中,而是在抗锯齿中。



现在在Mac上的解决方法:使用 SceneAntialiasing.DISABLED 。这将照常工作,您将能够添加3D对象。


My app with javafx 3D objects was working fine until I upgraded java from 8u51 to 8u60. After the upgrade, the UI is displayed upside down. Here is what I get with the following test code. It seems the y axis is reversed in rendering but not in functionality.

I have tried to put -Dprism.order=sw as a VM option. This fixes the test problem, but then does not allow javafx 3D objects to be rendered.

Does anyone knows how to fix this java/javafx issue. I will try to download and install Java 8u51.

Note, I have read JavaFX Mac OS strange rendering .

import javafx.application.Application;
import javafx.scene.PerspectiveCamera;
import javafx.scene.SceneAntialiasing;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.scene.Scene;

public class TestAppj extends Application {
    public static void main(String[] args) {  Application.launch(args); }
        public void start(Stage primaryStage) {
            primaryStage.setTitle("Test Stage");
            TabPane tabbedPane = new TabPane(new Tab("Tools", new BorderPane()), new Tab("Things", new BorderPane()));
            MenuBar menuBar = new MenuBar(
                    new Menu("File", null, new MenuItem("Open"), new     MenuItem("New"), new MenuItem("Save")),
                new Menu("Edit", null, new MenuItem("Cut"), new MenuItem("Copy"),   new MenuItem("Paste")));
          BorderPane root = new BorderPane();
        root.setTop(new VBox(menuBar, new ToolBar()));
        root.setCenter(tabbedPane);
        Scene theScene = new Scene(root, 500, 500, true, SceneAntialiasing.BALANCED);
        theScene.setCamera(new PerspectiveCamera());
        primaryStage.setScene(theScene);
        primaryStage.show();
    }
}

解决方案

This is a shorter way to reproduce the bug you have found with 8u60 on Mac:

@Override
public void start(Stage primaryStage) {
    Scene scene = new Scene(new StackPane(new Label("Antialising\nBalanced")), 
            300, 300, true, SceneAntialiasing.BALANCED);
    primaryStage.setScene(scene);
    primaryStage.show();
}

The problem is not in the camera, but just in the antialiasing.

Workaround for now on Mac: use SceneAntialiasing.DISABLED. That will work as usual and you will be able to add 3D objects.

这篇关于java升级后OSX上的JavaFX渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆