- 【Java標準GUIライブラリ】 JavaFX スレッド
89 :デフォルトの名無しさん[sage]:2015/04/19(日) 11:46:19.34 ID:P2fhL6qH - <?import javafx.scene.shape.*?>
<?import javafx.scene.paint.*?> <?import javafx.geometry.*?> <Box fx:id="box" depth="60" height="50" layoutX="214.0" layoutY="158.0" width="50"> <material> <PhongMaterial diffuseColor="red" /> </material> <rotationAxis><Point3D x="1.0" y="1.0" z="0.0"/></rotationAxis> <rotate>30.0</rotate> </Box> こんな3DシェイプのBoxがありまして...
| - 【Java標準GUIライブラリ】 JavaFX スレッド
90 :デフォルトの名無しさん[sage]:2015/04/19(日) 11:51:20.46 ID:P2fhL6qH - Parent fxml = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(fxml); // Scene scene = new Scene(fxml, 600,600, true, SceneAntialiasing.BALANCED); stage.setScene(scene); stage.show(); そのままだと Boxの輪郭がジャギーなので、 Scene生成時に SceneAntialiasing.BALANCED を指定してみたのですが、 それをすると ButtonやListViewやらが反応しなくなってしまいます。 3DのShapeにアンチエイリアスがかかるようにするにはどうするのが正解なんでしょうか?
| - 【Java標準GUIライブラリ】 JavaFX スレッド
91 :デフォルトの名無しさん[90]:2015/04/19(日) 18:40:38.25 ID:P2fhL6qH - 3Dシェイプ組に関しては fxmlを分離してみたら表面上は期待通りになりました。
ただ、Controllerクラスはfxml毎に生成されるので classのstaticフィールドを介してコントロールしてみたりと、ちょっと気持ち悪い感じです。 // class JavaFXApplication public void start(Stage stage) throws Exception { SubScene sub1 = new SubScene( (Parent) FXMLLoader.load(getClass().getResource("FXMLDocument1.fxml")), 600, 600, true, SceneAntialiasing.BALANCED); Parent sub2 = FXMLLoader.load(getClass().getResource("FXMLDocument2.fxml")); Group root = new Group(); root.getChildren().addAll(sub1, sub2); Scene scene = new Scene(root,600,600); stage.setScene(scene); stage.show(); } // class FXMLDocumentController ... @FXML private Box box; static Box _box; ... public void initialize(URL url, ResourceBundle rb) { System.out.println("Hi: " + this.toString() ); if (label!=null) _label = label; if (box!=null) _box = box; }
| - ★★Java質問・相談スレッド172★★ [転載禁止]©2ch.net
962 :デフォルトの名無しさん[sage]:2015/04/19(日) 19:10:24.74 ID:P2fhL6qH - 先程ついうっかりVectorを使おうとしたら
NetBeansのコードヒントで「廃止されたコレクション」と表示されました。 通常は ArrayListでよくても 同期処理が必要な場合は 今でも Vector を使えばいいんですよね? 最近はそうでもないんでしょうか? private Vector<〜> vec = new Vector<>();
|
|