本文整理汇总了Java中javafx.scene.Scene.setCamera方法的典型用法代码示例。如果您正苦于以下问题:Java Scene.setCamera方法的具体用法?Java Scene.setCamera怎么用?Java Scene.setCamera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.Scene
的用法示例。
在下文中一共展示了Scene.setCamera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showMasterDetailInWindow
import javafx.scene.Scene; //导入方法依赖的package包/类
private void showMasterDetailInWindow(final Stage stage, final Database database, final MasterDetailViewFeatures features) throws JAXBException, IOException {
final Parent viewRoot = ViewFactory.createMasterDetailView(database, features);
final Rectangle clip = new Rectangle();
clip.setArcHeight(18);
clip.setArcWidth(18);
clip.widthProperty().bind(stage.widthProperty());
clip.heightProperty().bind(stage.heightProperty());
//TODO: Only clipping or PerspectiveCamera is working... :(
features.customWindowClipProperty().addListener((obs, oldVal, newVal) -> {
if (newVal) {
viewRoot.setClip(clip);
} else {
viewRoot.setClip(null);
}
});
final Scene scene = new Scene(viewRoot);
features.useCssProperty().addListener((obs, oldVal, newVal) -> {
updateStylesheets(scene, newVal);
});
updateStylesheets(scene, features.isUseCss());
scene.setFill(Color.TRANSPARENT);
scene.setCamera(new PerspectiveCamera());
if (features.isCustomWindowUI()) {
stage.initStyle(StageStyle.TRANSPARENT);
}
stage.setTitle("Movie Database");
stage.setScene(scene);
stage.setWidth(1100);
stage.setHeight(720);
stage.centerOnScreen();
stage.show();
final FeaturesDialog featuresDialog = new FeaturesDialog(stage);
featuresDialog.addFeature(new Feature("Layout & Style", "demo2-css", features.useCssProperty()));
featuresDialog.addFeature(new Feature("Image Background", "demo2-image-background",features.movieBackgroundProperty()));
featuresDialog.addFeature(new Feature("List Animation", "demo2-list-animation",features.listAnimationProperty()));
featuresDialog.addFeature(new Feature("List Shadow", "demo2-list-shadow",features.listShadowProperty()));
// featuresDialog.addFeature(new Feature("List Cache", "demo2-list-cache",features.listCacheProperty()));
featuresDialog.addFeature(new Feature("Poster Transform", "demo2-poster-transform",features.posterTransformProperty()));
featuresDialog.addFeature(new Feature("Custom Window UI", "demo2-custom-window-ui",features.customWindowUIProperty()));
featuresDialog.addFeature(new Feature("Custom Window Clip", "demo2-custom-window-clip", features.customWindowClipProperty()));
featuresDialog.show();
}