< prev index next >

functional/SceneGraphTests/src/test/scenegraph/app/LocalTo_TransformsApp.java

Print this page




  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  */
  24 package test.scenegraph.app;
  25 
  26 import javafx.application.Application;
  27 import javafx.event.ActionEvent;
  28 import javafx.event.EventHandler;
  29 import javafx.geometry.Orientation;
  30 import javafx.scene.PerspectiveCamera;
  31 import javafx.scene.Scene;
  32 import javafx.scene.control.Button;
  33 import javafx.scene.layout.FlowPane;
  34 import javafx.scene.layout.HBox;
  35 import javafx.scene.layout.StackPane;
  36 import javafx.scene.shape.Circle;
  37 import javafx.scene.shape.CircleBuilder;
  38 import javafx.stage.Stage;
  39 import test.javaclient.shared.InteroperabilityApp;
  40 import test.javaclient.shared.Utils;
  41 
  42 /**
  43  *
  44  * @author asakharu
  45  */
  46 public class LocalTo_TransformsApp extends InteroperabilityApp {
  47 
  48     public static void main(String[] args) {
  49         Utils.launch(LocalTo_TransformsApp.class, args);
  50     }
  51 
  52     @Override
  53     protected Scene getScene() {
  54         return new LocalTo_TransformsScene();
  55     }
  56 
  57     public class LocalTo_TransformsScene extends Scene
  58     {
  59 
  60         public LocalTo_TransformsScene()
  61         {
  62             super(hBox, 150, 150, true);
  63             setCamera(new PerspectiveCamera());
  64 
  65             StackPane firstPane = new StackPane();
  66             StackPane secondPane = new StackPane();
  67             StackPane thirdPane = new StackPane();
  68             StackPane nestedPane = new StackPane();
  69             StackPane doubleNestedPane = new StackPane();
  70             StackPane forthPane = new StackPane();
  71 
  72             Circle circle1 = CircleBuilder.create().radius(20).id("circle_one").build();
  73             Circle circle2 = CircleBuilder.create().radius(20).id("circle_two").build();
  74             Circle circle3 = CircleBuilder.create().radius(20).id("circle_three").build();
  75             Circle circle4 = CircleBuilder.create().radius(20).id("circle_four").translateZ(-50).build();





  76 
  77             forthPane.getChildren().add(circle4);
  78             doubleNestedPane.getChildren().add(circle3);
  79             nestedPane.getChildren().add(doubleNestedPane);
  80             thirdPane.getChildren().add(nestedPane);
  81             secondPane.getChildren().add(circle2);
  82             firstPane.getChildren().add(circle1);
  83             hBox.getChildren().addAll(firstPane, secondPane, thirdPane, forthPane);
  84         }
  85 
  86     }
  87 
  88     private FlowPane hBox = new FlowPane(Orientation.HORIZONTAL, 50, 50);
  89 
  90 }


  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  */
  24 package test.scenegraph.app;
  25 
  26 import javafx.application.Application;
  27 import javafx.event.ActionEvent;
  28 import javafx.event.EventHandler;
  29 import javafx.geometry.Orientation;
  30 import javafx.scene.PerspectiveCamera;
  31 import javafx.scene.Scene;
  32 import javafx.scene.control.Button;
  33 import javafx.scene.layout.FlowPane;
  34 import javafx.scene.layout.HBox;
  35 import javafx.scene.layout.StackPane;
  36 import javafx.scene.shape.Circle;

  37 import javafx.stage.Stage;
  38 import test.javaclient.shared.InteroperabilityApp;
  39 import test.javaclient.shared.Utils;
  40 
  41 /**
  42  *
  43  * @author asakharu
  44  */
  45 public class LocalTo_TransformsApp extends InteroperabilityApp {
  46 
  47     public static void main(String[] args) {
  48         Utils.launch(LocalTo_TransformsApp.class, args);
  49     }
  50 
  51     @Override
  52     protected Scene getScene() {
  53         return new LocalTo_TransformsScene();
  54     }
  55 
  56     public class LocalTo_TransformsScene extends Scene
  57     {
  58 
  59         public LocalTo_TransformsScene()
  60         {
  61             super(hBox, 150, 150, true);
  62             setCamera(new PerspectiveCamera());
  63 
  64             StackPane firstPane = new StackPane();
  65             StackPane secondPane = new StackPane();
  66             StackPane thirdPane = new StackPane();
  67             StackPane nestedPane = new StackPane();
  68             StackPane doubleNestedPane = new StackPane();
  69             StackPane forthPane = new StackPane();
  70 
  71             Circle circle1 = new Circle(20);
  72             circle1.setId("circle_one");
  73             Circle circle2 = new Circle(20);
  74             circle2.setId("circle_two");
  75             Circle circle3 = new Circle(20);
  76             circle3.setId("circle_three");
  77             Circle circle4 = new Circle(20);
  78             circle4.setId("circle_four");
  79             circle4.setTranslateZ(-50);
  80 
  81             forthPane.getChildren().add(circle4);
  82             doubleNestedPane.getChildren().add(circle3);
  83             nestedPane.getChildren().add(doubleNestedPane);
  84             thirdPane.getChildren().add(nestedPane);
  85             secondPane.getChildren().add(circle2);
  86             firstPane.getChildren().add(circle1);
  87             hBox.getChildren().addAll(firstPane, secondPane, thirdPane, forthPane);
  88         }
  89 
  90     }
  91 
  92     private FlowPane hBox = new FlowPane(Orientation.HORIZONTAL, 50, 50);
  93 
  94 }
< prev index next >