本文整理汇总了Java中javafx.scene.SubScene.setFill方法的典型用法代码示例。如果您正苦于以下问题:Java SubScene.setFill方法的具体用法?Java SubScene.setFill怎么用?Java SubScene.setFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.SubScene
的用法示例。
在下文中一共展示了SubScene.setFill方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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;
}
示例4: setFill
import javafx.scene.SubScene; //导入方法依赖的package包/类
private boolean setFill(SubScene ss, Color color) {
Paint fill = ss.getFill();
if (fill == color) {
return true;
}
ss.setFill(color);
return color != fill;
}
示例5: buildSubScene
import javafx.scene.SubScene; //导入方法依赖的package包/类
private void buildSubScene() {
root3D.getChildren().add(autoScalingGroup);
subScene = new SubScene(root3D, paneW, paneH, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
subScene.setFill(Color.CADETBLUE);
setListeners(true);
}
示例6: createContent
import javafx.scene.SubScene; //导入方法依赖的package包/类
public Parent createContent() {
BorderPane p = new BorderPane();
HBox btBox = new HBox(50, leftBt, lookLeftBt, forwardBt, upBt, downBt, backBt, lookRightBt, rightBt);
btBox.alignmentProperty().set(Pos.CENTER);
p.setBottom(btBox);
setUpButtons();
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.getTransforms().add(cameraTranslate);
camera.getTransforms().add(cameraRotate);
camera.setFieldOfView(50);
camera.setFarClip(10000);
camera.setNearClip(1);
p.setDepthTest(DepthTest.ENABLE);
BorderPane cirmLiveUI = cirmLive.createSceneContent();
cirmLiveUI.setCache(true);
cirmLiveUI.setCacheShape(true);
cirmLiveUI.setCacheHint(CacheHint.QUALITY);
//cirmLiveUI.setSsetAlignment(camera, Pos.CENTER);
//cirmLiveUI.setTranslateZ(500);
//TODO root.getChildren().addAll(c, c2, c3);
SubScene subScene = new SubScene(cirmLiveUI, 1600, 900, true, SceneAntialiasing.BALANCED);
subScene.setFill(Color.CORAL);
subScene.setCamera(camera);
p.setCenter(subScene);
return p;
}
示例7: buildSubScene
import javafx.scene.SubScene; //导入方法依赖的package包/类
private void buildSubScene() {
root3D.getChildren().add(autoScalingGroup);
subScene = new SubScene(root3D,paneW,paneH,true,javafx.scene.SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
subScene.setFill(Color.CADETBLUE);
setListeners(true);
}
示例8: createScene3D
import javafx.scene.SubScene; //导入方法依赖的package包/类
/**Creates a 3D subscene with a perspectiveCamera, where the specified group node acts as the parent node of
* the subscene. Dont forget to make the subscene scale with the size of the whole scene, by binding its size
* (mySubscene.heightProperty().bind(myVBox.heightProperty()))
**/
private SubScene createScene3D(Group group,PerspectiveCamera camera) {
SubScene scene3d = new SubScene(group, sceneWidth, sceneHeight, true, SceneAntialiasing.DISABLED);
scene3d.setFill(Color.DARKGRAY.darker().darker().darker().darker());
scene3d.setCamera(camera);
return scene3d;
}
示例9: createContent
import javafx.scene.SubScene; //导入方法依赖的package包/类
public Parent createContent() throws Exception {
Image dImage = new Image(Simple3DSphereApp.class.getResource("/maps/earth-d.jpg").toExternalForm());
Image nImage = new Image(Simple3DSphereApp.class.getResource("/maps/earth-n.jpg").toExternalForm());
Image sImage = new Image(Simple3DSphereApp.class.getResource("/maps/earth-s.jpg").toExternalForm());
Image siImage = new Image(Simple3DSphereApp.class.getResource("/maps/earth-l.jpg").toExternalForm());
material = new PhongMaterial();
material.setDiffuseColor(Color.WHITE);
material.diffuseMapProperty().bind(
Bindings.when(diffuseMap).then(dImage).otherwise((Image) null));
material.setSpecularColor(Color.TRANSPARENT);
material.specularMapProperty().bind(
Bindings.when(specularMap).then(sImage).otherwise((Image) null));
material.bumpMapProperty().bind(
Bindings.when(bumpMap).then(nImage).otherwise((Image) null));
material.selfIlluminationMapProperty().bind(
Bindings.when(selfIlluminationMap).then(siImage).otherwise((Image) null));
earth = new Sphere(5);
earth.setMaterial(material);
earth.setRotationAxis(Rotate.Y_AXIS);
// Create and position camera
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.getTransforms().addAll(
new Rotate(-20, Rotate.Y_AXIS),
new Rotate(-20, Rotate.X_AXIS),
new Translate(0, 0, -20));
sun = new PointLight(Color.rgb(255, 243, 234));
sun.translateXProperty().bind(sunDistance.multiply(-0.82));
sun.translateYProperty().bind(sunDistance.multiply(-0.41));
sun.translateZProperty().bind(sunDistance.multiply(-0.41));
sun.lightOnProperty().bind(sunLight);
AmbientLight ambient = new AmbientLight(Color.rgb(1, 1, 1));
// Build the Scene Graph
Group root = new Group();
root.getChildren().add(camera);
root.getChildren().add(earth);
root.getChildren().add(sun);
root.getChildren().add(ambient);
RotateTransition rt = new RotateTransition(Duration.seconds(24), earth);
rt.setByAngle(360);
rt.setInterpolator(Interpolator.LINEAR);
rt.setCycleCount(Animation.INDEFINITE);
rt.play();
// Use a SubScene
SubScene subScene = new SubScene(root, 400, 300, true, SceneAntialiasing.BALANCED);
subScene.setFill(Color.TRANSPARENT);
subScene.setCamera(camera);
return new Group(subScene);
}
示例10: setBackgroundColor
import javafx.scene.SubScene; //导入方法依赖的package包/类
private void setBackgroundColor(SubScene scene) {
scene.setFill(CityStyle.getBackgroundColor(styleProperty.getValue()));
}