Exemplo n.º 1
0
  /*
   * initialize the spheres
   */
  public void initializeParam() {
    lightSetting();

    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 5; j++) {
        for (int k = 0; k < 5; k++) {
          fingerCoor[i][j][k] = new Point3D(0, 0, -100);
          fingerNode[i][j][k] = new VisSphere(fingerSize);
          root.getChildren().add(fingerNode[i][j][k]);
        }
        fingerLine[i][j] = new PolyCylinder3D(getPoint3DArray(i, j), 5, Color.WHITE);
        root.getChildren().addAll(fingerLine[i][j].getLine());
      }
      palmCoor[i] = new Point3D(0, 0, -100);
      palmNode[i] = new VisSphere(palmSize);
      palmLine[i] = new PolyCylinder3D(getPoint3DArray(i), 7, Color.WHITE);
      root.getChildren().addAll(palmLine[i].getLine());
      root.getChildren().add(palmNode[i]);
    }
    // for better appearance, some nodes are hidden
    fingerNode[0][1][4].setVisible(false);
    fingerNode[0][2][4].setVisible(false);
    fingerNode[0][3][4].setVisible(false);
    fingerNode[1][1][4].setVisible(false);
    fingerNode[1][2][4].setVisible(false);
    fingerNode[1][3][4].setVisible(false);
  }
Exemplo n.º 2
0
  @Test
  public void testNodeUpdatedWhenRemovedFromScene() {
    Rectangle rect;
    Group root = new Group();
    Scene scene = new Scene(root);
    root.getChildren().add(rect = new Rectangle());

    assertEquals(scene, rect.getScene());

    root.getChildren().remove(rect);

    assertNull(rect.getScene());
  }
Exemplo n.º 3
0
  private void init(Stage primaryStage) {
    Group root = new Group();
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 600, 460));

    // Ellipse path example
    Rectangle rect = new Rectangle(0, 0, 40, 40);
    rect.setArcHeight(10);
    rect.setArcWidth(10);
    rect.setFill(Color.ORANGE);
    root.getChildren().add(rect);

    Path path = createEllipsePath(200, 200, 50, 100, 45);
    root.getChildren().add(path);

    pathTransitionEllipse =
        PathTransitionBuilder.create()
            .duration(Duration.seconds(4))
            .path(path)
            .node(rect)
            .orientation(OrientationType.NONE)
            .cycleCount(Timeline.INDEFINITE)
            .autoReverse(false)
            .build();

    rect.setLayoutX(rect.getLayoutX() + rect.getLayoutBounds().getWidth() / 2);
    rect.setLayoutY(rect.getLayoutY() + rect.getLayoutBounds().getHeight() / 2);

    // Circle path example
    Rectangle rect2 = new Rectangle(0, 0, 20, 20);
    rect2.setArcHeight(10);
    rect2.setArcWidth(10);
    rect2.setFill(Color.GREEN);
    root.getChildren().add(rect2);

    Path path2 = createEllipsePath(400, 200, 150, 150, 0);
    root.getChildren().add(path2);

    pathTransitionCircle =
        PathTransitionBuilder.create()
            .duration(Duration.seconds(2))
            .path(path2)
            .node(rect2)
            .orientation(OrientationType.NONE)
            .cycleCount(Timeline.INDEFINITE)
            .autoReverse(false)
            .build();

    rect2.setLayoutX(rect2.getLayoutX() + rect2.getLayoutBounds().getWidth() / 2);
    rect2.setLayoutY(rect2.getLayoutY() + rect2.getLayoutBounds().getHeight() / 2);
  }
Exemplo n.º 4
0
  @Test
  public void testSceneSizeSetWithClipOnRoot() {
    Group g = new Group();

    Rectangle clip = new Rectangle();
    clip.setX(20);
    clip.setY(20);
    clip.setWidth(150);
    clip.setHeight(150);

    g.setClip(clip);

    Rectangle r = new Rectangle();

    r.setX(20);
    r.setY(20);
    g.getChildren().add(r);
    r.setWidth(200);
    r.setHeight(200);

    Scene scene = new Scene(g);
    stage.setScene(scene);

    assertEquals(170, (int) scene.getWidth());
    assertEquals(170, (int) scene.getHeight());
  }
  @Override
  public void start(Stage primaryStage) {
    primaryStage.setTitle("CoAP Explorer");
    Group root = new Group();
    Scene scene = new Scene(root, 800, 600);

    TextArea hexArea = new TextArea();
    TextArea binArea = new TextArea();

    CoapPacket packet = new CoapPacket();
    packet.setPayload("PAYLOAD");
    packetProp.setValue(packet);

    binArea.textProperty().bindBidirectional(packetProp, new AsciiConverter());

    hexArea.textProperty().bindBidirectional(packetProp, new HexConverter());
    hexArea.setEditable(false);
    hexArea.setFont(javafx.scene.text.Font.font(Font.MONOSPACED));

    VBox vbox = new VBox();
    vbox.setPadding(new Insets(10));
    vbox.setSpacing(8);

    VBox.setMargin(hexArea, new Insets(0, 0, 0, 8));
    vbox.getChildren().add(hexArea);
    VBox.setMargin(binArea, new Insets(0, 0, 0, 8));
    vbox.getChildren().add(binArea);

    root.getChildren().add(vbox);

    primaryStage.setScene(scene);
    primaryStage.show();
  }
Exemplo n.º 6
0
 private void recursiveParseGroup(Group group, Node rootNode) {
   NodeList nodes = rootNode.getChildNodes();
   for (int i = 0; i < nodes.getLength(); i++) {
     Node node = nodes.item(i);
     String name = node.getNodeName();
     if (node.getNodeType() != Node.ELEMENT_NODE) {
       continue;
     }
     if (GROUP_NODE_NAME.equals(name)) {
       Group subGroup = parseGroup(node);
       group.getChildren().add(subGroup);
       recursiveParseGroup(subGroup, node);
     } else if (ACCOUNT_NODE_NAME.equals(name)) {
       group.getChildren().add(parseAccount(node));
     }
   }
 }
Exemplo n.º 7
0
  @Test
  public void testNodeTreeUpdatedWhenAddedToScene() {
    Rectangle rect;
    Group root = new Group();
    Scene scene = new Scene(root);
    Group g = new Group();

    g.getChildren().add(rect = new Rectangle());

    assertNull(rect.getScene());
    assertNull(g.getScene());

    root.getChildren().add(g);

    assertEquals(scene, g.getScene());
    assertEquals(scene, rect.getScene());
  }
Exemplo n.º 8
0
  @Test
  public void testNodeTreeUpdatedWhenAddedToChildOfScene() {
    Group parentGroup;
    Group root = new Group();
    Scene scene = new Scene(root);
    root.getChildren().add(parentGroup = new Group());

    Rectangle rect;
    Group childGroup = new Group();
    childGroup.getChildren().add(rect = new Rectangle());

    assertNull(rect.getScene());
    assertNull(childGroup.getScene());
    assertEquals(scene, parentGroup.getScene());

    parentGroup.getChildren().add(childGroup);

    assertEquals(scene, rect.getScene());
    assertEquals(scene, childGroup.getScene());
    assertEquals(scene, parentGroup.getScene());
  }
Exemplo n.º 9
0
  /*
   * initialize lights used in this app
   */
  private void lightSetting() {
    // Creating Ambient Light
    AmbientLight ambient = new AmbientLight();
    ambient.setColor(Color.rgb(0, 255, 0, 0.6));
    // Creating Point Light
    PointLight point = new PointLight();
    point.setColor(Color.rgb(255, 255, 255, 1));
    point.setLayoutX(400);
    point.setLayoutY(100);
    point.setTranslateZ(-1100);

    root.getChildren().addAll(ambient, point);
  }
Exemplo n.º 10
0
  @Test
  public void focusChangeShouldBeAtomic() {
    final Group root = new Group();

    final Rectangle r1 = new Rectangle();
    final Rectangle r2 = new Rectangle();

    root.getChildren().addAll(r1, r2);
    final Scene scene = new Scene(root, 600, 600);
    stage.setScene(scene);

    r1.requestFocus();

    assertTrue(r1.isFocused());
    assertFalse(r2.isFocused());

    handler1Called = false;
    handler2Called = true;

    r1.focusedProperty()
        .addListener(
            new ChangeListener<Boolean>() {
              @Override
              public void changed(
                  ObservableValue<? extends Boolean> arg0, Boolean arg1, Boolean focused) {
                assertFalse(focused); // r1 is being defocused
                assertTrue(r2.isFocused()); // r2 is already focused
                handler1Called = true;

                root.getChildren().remove(r2); // be evil: remove r2
              }
            });

    r2.focusedProperty()
        .addListener(
            new ChangeListener<Boolean>() {
              @Override
              public void changed(
                  ObservableValue<? extends Boolean> arg0, Boolean arg1, Boolean focused) {
                assertTrue(focused); // r2 is being focused
                assertFalse(r1.isFocused()); // r1 is already defocused
                assertTrue(handler1Called); // r1 listener was called first
                handler2Called = true;
                // remove the listener otherwise thi final defocus calls it again
                r2.focusedProperty().removeListener(this);
              }
            });

    r2.requestFocus();
    assertTrue(handler2Called); // both listeners were called
  }
Exemplo n.º 11
0
  /**
   * ************************************************************************* * Lookup related
   * tests * * ************************************************************************
   */
  @Test
  public void testLookupCorrectId() {
    Node n;
    Group root = new Group();
    Scene scene = new Scene(root);
    Rectangle a = new Rectangle();
    a.setId("a");
    Rectangle b = new Rectangle();
    a.setId("b");
    Rectangle c = new Rectangle();
    a.setId("c");
    Group g = new Group();
    g.setId("d");

    Rectangle r1 = new Rectangle();
    a.setId("1");
    Rectangle r2 = new Rectangle();
    a.setId("2");
    Rectangle r3 = new Rectangle();
    a.setId("3");
    n = new Rectangle();
    n.setId("4");
    Rectangle r5 = new Rectangle();
    a.setId("5");
    Rectangle r6 = new Rectangle();
    a.setId("6");

    Rectangle e = new Rectangle();
    a.setId("e");
    Rectangle f = new Rectangle();
    a.setId("f");

    g.getChildren().addAll(r1, r2, r3, n, r5, r6);

    root.getChildren().addAll(a, b, c, g, e, f);

    assertEquals(n, scene.lookup("#4"));
  }
Exemplo n.º 12
0
  @Test
  public void testSceneSizeSetWithRotationOnRoot() {
    Group g = new Group();
    g.setRotate(45);
    Rectangle r = new Rectangle();
    r.setX(-20);
    r.setY(-20);
    r.setWidth(200);
    r.setHeight(200);
    g.getChildren().add(r);

    Scene scene = new Scene(g);
    stage.setScene(scene);

    assertTrue(scene.getWidth() > 220.0f && scene.getWidth() < 222.0f);
    assertTrue(scene.getHeight() > 220.0f && scene.getHeight() < 222.0f);
  }
Exemplo n.º 13
0
  @Test
  public void testSceneSizeWhenWidthAndHeightInitialized() {
    Group g = new Group();

    Rectangle r = new Rectangle();
    r.setX(-20);
    r.setY(-20);
    r.setWidth(100);
    r.setHeight(100);
    g.getChildren().add(r);

    Scene scene = new Scene(g, 400, 400);
    stage.setScene(scene);

    assertEquals(400, (int) scene.getWidth());
    assertEquals(400, (int) scene.getHeight());
  }
Exemplo n.º 14
0
  @Test
  public void testSceneSizeSetWithTranslateOnRoot() {
    Group g = new Group();

    g.setTranslateX(10);
    g.setTranslateY(10);
    Rectangle r = new Rectangle();
    r.setX(-20);
    r.setY(-20);
    r.setWidth(200);
    r.setHeight(200);
    g.getChildren().add(r);
    Scene scene = new Scene(g);
    stage.setScene(scene);

    assertEquals(190, (int) scene.getWidth());
    assertEquals(190, (int) scene.getHeight());
  }
Exemplo n.º 15
0
  @Test
  public void scenePropertyListenerShouldBeCalledForInitializedScene() {
    final Group root = new Group();
    final Rectangle rect = new Rectangle();
    root.getChildren().add(rect);

    root.sceneProperty()
        .addListener(
            new InvalidationListener() {
              @Override
              public void invalidated(Observable o) {
                root.getChildren().remove(rect);
              }
            });

    Scene scene = new Scene(root, 600, 450);
    // if there is no exception, the test passed
  }
Exemplo n.º 16
0
  public View23D() {
    this.setAlignment(Pos.CENTER);
    this.setPadding(new Insets(20));

    camera = new PerspectiveCamera();
    camera.setNearClip(0.1);
    camera.setFarClip(10000);
    camera.setTranslateX(0);
    camera.setTranslateY(0);
    camera.setTranslateZ(-500);

    sphere1 = createSphere(Color.BLUE);
    Tooltip.install(sphere1, new Tooltip("A Blue Sphere"));

    sphere2 = createSphere(Color.YELLOWGREEN);
    sphere2.setTranslateX(200);
    sphere2.setTranslateY(200);
    Tooltip.install(sphere2, new Tooltip("A Yellowgreen Sphere"));

    cylinder = createCylinder(Color.BLANCHEDALMOND);
    cylinder.setTranslateY(90);
    cylinder.setTranslateX(90);
    cylinder.setRotate(-45);
    Tooltip.install(cylinder, new Tooltip("A ??? Cylinder"));

    clickMe1 = new Button("Click Me!");
    clickMe1.setTranslateX(200);

    t3dobjects = new Group();

    t3dobjects.getChildren().addAll(sphere1, cylinder, sphere2, clickMe1);

    threeD = new SubScene(t3dobjects, 600, 600, true, SceneAntialiasing.BALANCED);
    t3dobjects.setTranslateX(200);
    t3dobjects.setTranslateY(200);

    topPane = new Pane();
    topPane.setPickOnBounds(false);

    clickMe2 = new Button("Click Me 2!");

    this.getChildren().addAll(threeD, topPane);
    // this.setAlignment(Pos.CENTER);
  }
Exemplo n.º 17
0
  @Test
  public void testSceneSizeSetWithEffectOnRoot() {
    Group g = new Group();

    g.setEffect(new javafx.scene.effect.DropShadow());

    Rectangle r = new Rectangle();
    r.setX(-20);
    r.setY(-20);
    g.getChildren().add(r);
    r.setWidth(200);
    r.setHeight(200);

    Scene scene = new Scene(g);
    stage.setScene(scene);

    assertEquals(189, (int) scene.getWidth());
    assertEquals(189, (int) scene.getHeight());
  }
Exemplo n.º 18
0
  @Test
  public void testSceneSizeSetWithTransformOnRoot() {
    Group g = new Group();

    Scale s = new Scale();
    s.setX(2.0f);
    s.setY(2.0f);
    Rectangle r = new Rectangle();
    r.setX(-20);
    r.setY(-20);
    g.getChildren().add(r);
    r.setWidth(200);
    r.setHeight(200);

    g.getTransforms().add(s);
    Scene scene = new Scene(g);
    stage.setScene(scene);

    assertEquals(360, (int) scene.getWidth());
    assertEquals(360, (int) scene.getHeight());
  }
Exemplo n.º 19
0
  private static boolean isGroupChanged(Group group, Keymap oldKeymap, Keymap newKeymap) {
    if (!newKeymap.canModify()) return false;

    ArrayList children = group.getChildren();
    for (Object child : children) {
      if (child instanceof Group) {
        if (isGroupChanged((Group) child, oldKeymap, newKeymap)) {
          return true;
        }
      } else if (child instanceof String) {
        String actionId = (String) child;
        if (isActionChanged(actionId, oldKeymap, newKeymap)) {
          return true;
        }
      } else if (child instanceof QuickList) {
        String actionId = ((QuickList) child).getActionId();
        if (isActionChanged(actionId, oldKeymap, newKeymap)) {
          return true;
        }
      }
    }
    return false;
  }
Exemplo n.º 20
0
  public void start(final Stage stage) {
    for (ConditionalFeature f : EnumSet.allOf(ConditionalFeature.class)) {
      System.err.println(f + ": " + Platform.isSupported(f));
    }
    Rectangle2D screen = Screen.getPrimary().getVisualBounds();
    final Random rand = new Random();

    /*
    final Group starfield = new Group();
    for(int i=0;i<66;i++) {
        int size = rand.nextInt(3)+1;
        if(size==3) {
            size = rand.nextInt(3)+1;
        }
        Circle circ = new Circle(rand.nextInt((int)screen.getWidth()), rand.nextInt(200+(int)screen.getHeight())-200,
            size);
        circ.setFill(Color.rgb(200,200,200+rand.nextInt(56)));
        circ.setTranslateZ(1+rand.nextInt(40));
        starfield.getChildren().add(circ);
    }
    */
    final List<Starfield> stars = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
      int sw = (int) screen.getWidth(), sh = (int) screen.getHeight();
      Starfield sf = new Starfield(rand, -sw, -sh, 2 * sw, 2 * sh, rand.nextInt(30) + 10);
      sf.setTranslateZ(rand.nextInt(2000) + 50);
      stars.add(sf);
    }
    // final Starfield starfield2 = new Starfield(rand, -200, -200, (int)screen.getWidth(),
    // (int)screen.getHeight()+200, 40);

    final Ruleset1D rules =
        new Ruleset1D(new int[] {Colors.randomColor(rand), Colors.randomColor(rand)});
    final Ruleset rules2 = new Rulespace1D(rules);
    // Rule rule = rules.random(rand).next();
    Iterator<Rule> it = rules.iterator();
    GridPane gridp = new GridPane();
    int i = 0, j = 0;
    while (it.hasNext()) {
      Rule rule = it.next();
      CA ca = new CA(rule, new RandomInitializer(), rand, 42, 100, 100);
      Plane plane = ca.createPlane();
      ImageView imview = new ImageView(plane.toImage());
      imview.setSmooth(true);
      imview.setFitWidth(30);
      imview.setPreserveRatio(true);
      gridp.add(imview, i, j);
      if (++i == 16) {
        i = 0;
        j++;
      }
    }
    // gridp.setScaleX(0.3);
    // gridp.setScaleY(0.3);
    // gridp.setPrefSize(100*3/3, 100*3/3);
    // gridp.setMaxSize(100*3/3, 100*3/3);

    final double XTRANS = screen.getWidth() / 2 - 30 * 16 / 2;
    final double YTRANS = screen.getHeight() / 2 - 30 * 16 / 2;
    // gridp.setTranslateX((screen.getWidth()/2+100*16/2)*0.3);
    // gridp.setTranslateX(0);
    gridp.setTranslateX(XTRANS);
    gridp.setTranslateY(YTRANS);
    // gridp.setAlignment(Pos.CENTER);
    Group grid = new Group(gridp);
    // grid.setTranslateX(0);
    // grid.setTranslateY(0);

    // gridp.relocate(-400, -400);
    // gridp.setTranslateX(-300);
    // gridp.setTranslateY(-150);

    /*
    final RotateTransition rt = new RotateTransition(Duration.millis(3000), gridp);
    rt.setByAngle(180);
    rt.setCycleCount(4);
    rt.setAutoReverse(true);
    */
    // rt.setAutoReverse(false);

    /*`
    final BorderPane border = new BorderPane();
    */
    // Label title = new Label("EXPLORATIONS IN CELLULAR SPACES");
    Label title = new Label("E  X  P  L  O  R  A  T  I  O  N  S");
    title.setFont(new Font("Helvetica Neue Condensed Bold", 36));
    title.setTextFill(Color.WHITE);
    // Label title2 = new Label("IN CELLULAR SPACES");
    Label title2 = new Label("EXPLORATIONS IN CELLULAR SPACES");
    title2.setFont(new Font("Helvetica Neue Condensed Bold", 28));
    title2.setTextFill(Color.WHITE);
    /*`
    title.setAlignment(Pos.CENTER);
    title.setContentDisplay(ContentDisplay.CENTER);
    title.setTextAlignment(TextAlignment.CENTER);
    */
    final HBox toptitle = new HBox();
    toptitle.setAlignment(Pos.CENTER);
    toptitle.getChildren().add(title);
    toptitle.setTranslateX(XTRANS);
    toptitle.setTranslateY(YTRANS - 36);

    final HBox btitle = new HBox();
    btitle.setAlignment(Pos.CENTER);
    title2.setAlignment(Pos.CENTER);
    btitle.getChildren().add(title2);
    btitle.setTranslateX(XTRANS);
    // btitle.setTranslateX(screen.getWidth()/2-title2.getPrefWidth()/2);
    btitle.setTranslateY(YTRANS + 30 * 16);

    Group border = new Group();
    // border.getChildren().add(toptitle);
    for (Starfield st : stars) {
      border.getChildren().add(st);
    }
    // border.getChildren().add(starfield2);
    border.getChildren().add(btitle);
    border.getChildren().add(grid);

    final List<TranslateTransition> tts = new ArrayList<>();
    final TranslateTransition tt = new TranslateTransition(Duration.millis(6000), grid);
    tt.setByY(2000);
    tts.add(tt);
    for (Starfield sf : stars) {
      TranslateTransition st = new TranslateTransition(Duration.millis(6000), sf);
      st.setByY(200);
      st.setByZ(100 + rand.nextInt(100));
      tts.add(st);
    }
    /*
    final TranslateTransition tt2 = new TranslateTransition(Duration.millis(6000), starfield1);
    tt2.setByY(200);
    tt2.setByZ(200);
    final TranslateTransition tt3 = new TranslateTransition(Duration.millis(6000), starfield2);
    tt3.setByY(300);
    tt3.setByZ(200);
    */
    // final ParallelTransition infinite = new ParallelTransition(tt, tt2, tt3);
    final ParallelTransition infinite =
        new ParallelTransition(tts.toArray(new TranslateTransition[0]));

    final BorderPane ctrl = new BorderPane();
    // ctrl.setPrefSize(200, 100);
    // ctrl.setMaxSize(200, 100);
    Label start = new Label("Start");
    start.setTextFill(Color.WHITE);
    start.setFont(new Font("Helvetica", 28));
    start.setAlignment(Pos.CENTER_LEFT);
    start.setContentDisplay(ContentDisplay.CENTER);
    start.setTranslateX(XTRANS + 30 * 16 + 100);
    start.setTranslateY(screen.getHeight() / 2);
    // start.setTranslateX(-400);
    Circle ico = new Circle(15);
    ico.setOnMouseClicked(
        new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent e) {
            FadeTransition ft = new FadeTransition(Duration.millis(500), ctrl);
            ft.setFromValue(1.0);
            ft.setToValue(0.0);
            FadeTransition tft = new FadeTransition(Duration.millis(500), btitle);
            tft.setFromValue(1.0);
            tft.setToValue(0.0);
            ParallelTransition pt = new ParallelTransition(ft, tft);
            // TranslateTransition fft = new TranslateTransition(Duration.millis(3000), border);
            // tt.setByY(2000);
            SequentialTransition st = new SequentialTransition(pt, infinite);
            st.setOnFinished(
                new EventHandler<ActionEvent>() {
                  public void handle(ActionEvent e) {
                    State state = State.state().rules(rules2).random(new Rand()).size(400);
                    Iterator<Rule> it = state.rules().random(state.random().create());
                    CA ca =
                        new CA(
                            it.next(),
                            new RandomInitializer(),
                            state.random().create(),
                            0,
                            state.size(),
                            state.size());
                    state.ca(ca);
                    // final Futures futures = new Futures(rules2, new Rand());
                    final Controls controls = new Controls(state);
                    // controls.setTranslateX(screen.getWidth()/2 -
                    // futures.getPossibilityWidth()/2);
                    // controls.setTranslateY(screen.getHeight()/2 -
                    // futures.getPossiblityHeight()/2-20);

                    // controls.setTranslateX(screen.getWidth()/2 - (3*200+2*10)/2);
                    // controls.setTranslateY(screen.getHeight()/2 - (3*200+2*10)/2-20);

                    for (Starfield sf : stars) {
                      state.addListener(sf);
                      // futures.addFutureListener(sf);
                    }
                    // futures.addFutureListener(starfield1);
                    // futures.addFutureListener(starfield2);
                    border.getChildren().remove(grid);
                    border.getChildren().remove(btitle);
                    // border.getChildren().add(futures);
                    border.getChildren().add(controls);
                    // futures.setTranslateX(screen.getWidth()/2 - futures.getPossibilityWidth()/2);
                    // futures.setTranslateY(screen.getHeight()/2 -
                    // futures.getPossiblityHeight()/2);
                    // border.setCenter(futures);
                    // border.setAlignment(futures, Pos.CENTER);
                  }
                });
            st.play();
          }
        });
    // Sphere ico = new Sphere(15);
    // ico.setDrawMode(DrawMode.LINE);
    ico.setFill(Color.rgb(10, 10, 10));
    ico.setStroke(Color.WHITE);
    ico.setStrokeWidth(3);
    ico.setTranslateX(XTRANS + 30 * 16 + 100);
    ico.setTranslateY(screen.getHeight() / 2);
    // ctrl.setTop(ico);
    ctrl.setCenter(ico);
    /*
    border.setRight(ctrl);

    border.setMaxSize(800,600);
    border.setPrefSize(800,600);
    */
    border.getChildren().add(ctrl);
    Group root = new Group();
    root.getChildren().add(border);
    // root.setAutoSizeChildren(false);
    // root.setLayoutX(-400);
    // root.setLayoutY(-400);
    // Scene scene = new Scene(root, 1200, 1000);
    Scene scene = new Scene(root, 1280, 1024, true, SceneAntialiasing.DISABLED);
    scene.setFill(Color.BLACK);
    scene.setCamera(new PerspectiveCamera());

    // set Stage boundaries to visible bounds of the main screen
    stage.setX(screen.getMinX());
    stage.setY(screen.getMinY());
    stage.setWidth(screen.getWidth());
    stage.setHeight(screen.getHeight());

    stage.setTitle("Explorations in Cellular Spaces");
    stage.setScene(scene);
    stage.setResizable(false);
    // root.autosize();
    // stage.sizeToScene();
    stage.show();
  }
Exemplo n.º 21
0
 public List<IConfigItem> getChildren() {
   return root.getChildren();
 }
Exemplo n.º 22
0
 /*
  * add spheres by coordinates
  */
 public void addSphere(Point3D coordinate, float size) {
   VisSphere sphere = new VisSphere(coordinate, size);
   root.getChildren().add(sphere);
 }