本文整理汇总了Java中javafx.scene.SubScene类的典型用法代码示例。如果您正苦于以下问题:Java SubScene类的具体用法?Java SubScene怎么用?Java SubScene使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubScene类属于javafx.scene包,在下文中一共展示了SubScene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mkRoot
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
public Node mkRoot() {
try {
Parent node = FXMLLoader.load(getClass().getResource("/ComplexScene.fxml"));
node.setPickOnBounds(true);
node.setMouseTransparent(true);
WebView webview = (WebView) node.lookup("webview");
if(webview != null){
webview.getEngine().load("http://purecss3.net/doraemon/doraemon_css3.html");
}
GesturePane pane = new GesturePane(new SubScene(node, 500, 500));
VBox.setVgrow(pane, Priority.ALWAYS);
Label description = new Label("Zoom and scroll on the SubScene below, " +
"observe that controls in JavaFX are vectors " +
"and that lighting effects are respected" +
"(different zoom alters light distance).");
description.setWrapText(true);
description.setPadding(new Insets(16));
return new VBox(description, pane);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例2: getControlsForSubScene
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected VBox getControlsForSubScene(SubScene ss) {
GroupMover targetMover;
if(ss.getRoot() == rootDLMV.getGroup()){
targetMover = rootDLMV;
}else if(ss.getRoot() == rootTLMV.getGroup()){
targetMover = rootTLMV;
}else if(ss.getRoot() == rootTRMV.getGroup()){
targetMover = rootTRMV;
}else{
throw new IllegalArgumentException("SubScene does not applicable to this application");
}
ScrollBar rotYBar = new ScrollBar();
VBox controls = new VBox(new HBox(new Label("Rotate"),rotYBar));
rotYBar.setMin(-360);
rotYBar.setMax(360);
rotYBar.setValue(targetMover.rotateYProperty().get());
rotYBar.valueProperty().bindBidirectional(targetMover.rotateYProperty());
return controls;
}
示例3: createDraggingGlobe
import javafx.scene.SubScene; //导入依赖的package包/类
public Parent createDraggingGlobe() {
boolean support = Platform.isSupported(ConditionalFeature.SCENE3D);
if (support)
logger.info("JavaFX 3D features supported");
else
logger.info("JavaFX 3D features NOT supported");
globe = new Globe();
rotateGlobe();
// Use a SubScene
subScene = new SubScene(globe.getRoot(), WIDTH, HEIGHT);//, true, SceneAntialiasing.BALANCED);
subScene.setId("sub");
subScene.setCamera(globe.getCamera());//subScene));
//return new Group(subScene);
return new HBox(subScene);
}
示例4: CameraView
import javafx.scene.SubScene; //导入依赖的package包/类
public CameraView(SubScene scene) {
// Make sure "world" is a group
assert scene.getRoot().getClass().equals(Group.class);
worldToView = (Group)scene.getRoot();
// cameraTransform.setTranslate(0, 0, -500);
camera.setNearClip(0.1);
camera.setFarClip(15000.0);
camera.setTranslateZ(-1500);
// cameraTransform.ry.setAngle(-45.0);
// cameraTransform.rx.setAngle(-10.0);
params.setCamera(camera);
params.setDepthBuffer(true);
params.setFill(Color.rgb(0, 0, 0, 0.5));
viewTimer = new AnimationTimer() {
@Override
public void handle(long now) {
redraw();
}
};
}
示例5: TestApplication3DPattern
import javafx.scene.SubScene; //导入依赖的package包/类
public TestApplication3DPattern() {
root = new StackPane();
scene = new Scene(root, sceneWidth, sceneHeight, true, SceneAntialiasing.BALANCED);
worldRoot = new Group();
subscene = new SubScene(worldRoot, sceneWidth, sceneHeight, true, SceneAntialiasing.BALANCED);
camera = new EulerCamera();
// camera.setTranslateZ(-1000);
worldRoot.getChildren().add(camera);
controller = new DefaultEulerController();
controller.setScene(scene);
controller.setSubScene(subscene);
controller.setCamera(camera);
scene.setFill(Color.BLACK);
subscene.setFill(Color.BLACK);
configure();
// scene.setCamera(camera);
subscene.setCamera(camera);
root.getChildren().addAll(subscene);
}
示例6: initScene
import javafx.scene.SubScene; //导入依赖的package包/类
public Scene initScene(City city, PerspectiveCamera camera, String cityName) {
Group root = new Group();
buildCamera(root, camera);
root.getTransforms().addAll(rxBox, ryBox, rzBox);
subScene = new SubScene(root, SCENE_WIDTH, SCENE_HEIGHT, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
root.getChildren().add(city);
// 2D
BorderPane pane = new BorderPane();
Pane toolBar = null;
try {
toolBar = new CityToolBarService().load(cityName);
} catch (IOException e) {
e.printStackTrace();
}
pane.setBottom(subScene);
pane.setTop(toolBar);
Scene scene = new Scene(pane, SCENE_WIDTH, SCENE_HEIGHT);
subScene.heightProperty().bind(scene.heightProperty());
subScene.widthProperty().bind(scene.widthProperty());
return scene;
}
示例7: start
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Settlers of Catan");
Group root = new Group();
GameGroup game = new GameGroup();
Group cameraGroup = new Group();
Group uiGroup = new Group();
game.addTiles();
SubScene uiScene = drawUI(uiGroup);
SubScene cameraScene = setupCamera(cameraGroup);
root.getChildren().addAll(cameraScene, uiScene);
cameraGroup.getChildren().add(game);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
示例8: ViewPane
import javafx.scene.SubScene; //导入依赖的package包/类
public ViewPane(MyGraphView graphView) {
// Setup Main Pane
AnchorPane.setBottomAnchor(this, 0.0);
AnchorPane.setTopAnchor(this, 0.0);
AnchorPane.setLeftAnchor(this, 0.0);
AnchorPane.setRightAnchor(this, 0.0);
this.setStyle("-fx-background-color : whitesmoke");
// Create new scene with graphView
this.myGraphView = graphView;
bottomPane = new Pane();
topPane = new Pane();
topPane.setPickOnBounds(false);
stackPane = new StackPane(bottomPane, myGraphView, topPane);
viewScene = new SubScene(stackPane, this.getWidth(), this.getHeight());
viewScene.widthProperty().bind(this.widthProperty());
viewScene.heightProperty().bind(this.heightProperty());
viewScene.setPickOnBounds(false);
// Add StackPane in SubScene and add content.
getChildren().addAll(viewScene);
// Bind LayoutWidth to this here
myGraphView.animationService.widthProperty.bind(this.widthProperty());
myGraphView.animationService.heightProperty.bind(this.heightProperty());
hoverInfo = new SimpleStringProperty("");
this.groupNodeInitLocation = new HashMap<>();
// Setup interactions and view elements
setupTransforms();
initRectangle();
addMouseInteractions();
}
示例9: createSubScene
import javafx.scene.SubScene; //导入依赖的package包/类
protected SubScene createSubScene() {
Group group = new Group();
group.getChildren().add(createPlayerModel());
group.getTransforms().add(zRotate);
camera.getTransforms().addAll(yRotate, translate, scale);
subScene = new SubScene(group, preW, preH, true,
msaa ? SceneAntialiasing.BALANCED : SceneAntialiasing.DISABLED);
subScene.setFill(Color.ALICEBLUE);
subScene.setCamera(camera);
return subScene;
}
示例10: getTopLeftScene
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected SubScene getTopLeftScene() {
rootTLMV = buildGroupMover();
SubScene ss = new SubScene(rootTLMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
ss.setCamera(new PerspectiveCamera());
return ss;
}
示例11: getTopRightScene
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected SubScene getTopRightScene() {
rootTRMV = buildGroupMover();
rootTRMV.setRotateY(60);
SubScene ss = new SubScene(rootTRMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
ss.setCamera(new PerspectiveCamera());
return ss;
}
示例12: getDownLeftScene
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected SubScene getDownLeftScene() {
rootDLMV = buildGroupMover();
rootDLMV.setRotateY(-60);
SubScene ss = new SubScene(rootDLMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
ss.setCamera(new PerspectiveCamera());
return ss;
}
示例13: addCamera
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected Camera addCamera(SubScene scene) {
PerspectiveCamera pc = new PerspectiveCamera(true);
scene.setCamera(pc);
pc.setFarClip(10000);
return pc;
}
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:8,代码来源:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java
示例14: getSubScene
import javafx.scene.SubScene; //导入依赖的package包/类
private SubScene getSubScene(int num) {
Group root = cases[num].buildAll();
cases[num].getGroupMover().translateXProperty().set(WIDTH / 4);
cases[num].getGroupMover().translateYProperty().set(HEIGHT / 4);
SubScene ss = new SubScene(root, HEIGHT / 2, WIDTH / 2, true, SceneAntialiasing.DISABLED);
cases[num].addCamera(ss);
ss.setFill(Color.GREEN);
if (!isTest()) {
cases[num].initRotation(ss);
}
return ss;
}
示例15: getControlsForSubScene
import javafx.scene.SubScene; //导入依赖的package包/类
@Override
protected VBox getControlsForSubScene(SubScene ss) {
ShapesTestCase stc = null;
if (ss.equals(scenes[0])) {
stc = cases[0];
} else if (ss.equals(scenes[1])) {
stc = cases[1];
} else {
stc = cases[2];
}
return new VBox(stc.getControlPane(), stc.getShapePane());
}