当前位置: 首页>>代码示例>>Java>>正文


Java SubScene.setFill方法代码示例

本文整理汇总了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);
	}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:27,代码来源:TestApplication3DPattern.java

示例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;
}
 
开发者ID:InfinityStudio,项目名称:minecraft-jfx-skin,代码行数:15,代码来源:SkinCanvas.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:13,代码来源:SubSceneShape3DAbstractApp.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:9,代码来源:SubSceneBasicPropsTestApp.java

示例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);
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:9,代码来源:ContentModel.java

示例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;
}
 
开发者ID:miamidade,项目名称:cirmlive,代码行数:28,代码来源:CiRMLive3d.java

示例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);
}
 
开发者ID:jperedadnr,项目名称:RubikFX,代码行数:9,代码来源:ContentModel.java

示例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;
  
}
 
开发者ID:VRL-Studio,项目名称:VRL-JFXVis,代码行数:13,代码来源:Main.java

示例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);
    }
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:60,代码来源:Simple3DSphereApp.java

示例10: setBackgroundColor

import javafx.scene.SubScene; //导入方法依赖的package包/类
private void setBackgroundColor(SubScene scene) {
    scene.setFill(CityStyle.getBackgroundColor(styleProperty.getValue()));
}
 
开发者ID:canoo,项目名称:code-of-gotham,代码行数:4,代码来源:StageUtil.java


注:本文中的javafx.scene.SubScene.setFill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。