Beispiel #1
0
  private void loadMapUI(Group root) {
    Group editorUI = new Group();
    editorUI.setLayoutX(0);
    editorUI.setLayoutY(600);
    editorUI.setVisible(true);

    ToggleGroup tGroup = new ToggleGroup();

    ToggleButton tb1 = new ToggleButton("Ground");
    tb1.setLayoutX(0);
    tb1.setLayoutY(0);
    tb1.setId("Ground");
    ToggleButton tb2 = new ToggleButton("Forest");
    tb2.setLayoutX(70);
    tb2.setLayoutY(0);
    tb2.setId("Forest");
    ToggleButton tb3 = new ToggleButton("G Env");
    tb3.setLayoutX(140);
    tb3.setLayoutY(0);
    tb3.setId("GEnv");

    tb1.setToggleGroup(tGroup);
    tb2.setToggleGroup(tGroup);
    tb3.setToggleGroup(tGroup);

    tGroup.selectedToggleProperty().addListener(new Gui.Listener.EditorChangePaletteListener());
    tGroup.selectToggle(tb1);
    editorUI.getChildren().add(tb1);
    editorUI.getChildren().add(tb2);
    editorUI.getChildren().add(tb3);

    root.getChildren().add(editorUI);
  }
  private void sceneDidChange() {
    assert this.scrollPane != null;

    if (scrollPane.getScene() != null) {
      assert scalingGroup.isVisible() == false;

      // Here we'd like to layout the user scene graph immediately
      // i.e. invoke:
      //      1) layoutContent()      // to relayout user scene graph
      //      2) adjustWorkspace()    // to size the content workspace
      //
      // However invoking layoutContent() from here (scene change listener)
      // does not work very well (see RT-32326).
      //
      // So we do these two steps in runLater().
      // Until they are done, scalingGroup is kept invisible to avoid
      // visual artifacts. After the two steps are done, we turn the
      // visible by calling revealScalingGroup().

      Platform.runLater(
          () -> {
            layoutContent(true /* applyCSS */);
            adjustWorkspace();
            revealScalingGroup();
          });
    } else {
      assert scalingGroup.isVisible();
      scalingGroup.setVisible(false);
    }
  }
Beispiel #3
0
  /**
   * House
   *
   * @param listener
   * @return
   */
  private Group loadPaletteImg3(Gui.Listener.EditorChoosePaletteListener listener) {
    Group pGroup = new Group();
    pGroup.setVisible(false);
    pGroup.setLayoutX(0);
    pGroup.setLayoutY(650);

    ImageView ivBorder = new ImageView(Objekte.getImgMapEditor().getSingleBorder());
    listener.setBorder(ivBorder);

    ImageView ivGrasBunch01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getGrasBunch01());
    listener.setId(2, 0, 201);
    ivGrasBunch01.setLayoutX(0);
    ImageView ivGrasBunch02 = new Data.Overwrite.ImageView(Objekte.getImgMap().getGrasBunch02());
    listener.setId(2, 1, 202);
    ivGrasBunch02.setLayoutX(25);
    ImageView ivGrasFlower01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getGrasFlower01());
    listener.setId(2, 2, 203);
    ivGrasFlower01.setLayoutX(50);
    ImageView ivGrasFlowerBunch01 =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGrasFlowerBunch01());
    listener.setId(2, 3, 204);
    ivGrasFlowerBunch01.setLayoutX(75);

    ivGrasBunch01.setOnMouseClicked(listener);
    ivGrasBunch02.setOnMouseClicked(listener);
    ivGrasFlower01.setOnMouseClicked(listener);
    ivGrasFlowerBunch01.setOnMouseClicked(listener);
    pGroup.getChildren().add(ivGrasBunch01);
    pGroup.getChildren().add(ivGrasBunch02);
    pGroup.getChildren().add(ivGrasFlower01);
    pGroup.getChildren().add(ivGrasFlowerBunch01);
    pGroup.getChildren().add(ivBorder);
    return pGroup;
  }
  private void revealScalingGroup() {
    assert scalingGroup.isVisible() == false;

    scalingGroup.setVisible(true);
    scalingGroup.setOpacity(0.0);

    FadeTransition showHost = new FadeTransition(Duration.millis(300), scalingGroup);
    showHost.setFromValue(0.0);
    showHost.setToValue(1.0);
    showHost.play();
  }
Beispiel #5
0
 public void showYY1GridLinesGroup(boolean visible) {
   showyy1GridLinesGroup = visible;
   yy1GridLinesGroup.setVisible(visible);
 }
Beispiel #6
0
  /**
   * Forest
   *
   * @param listener
   * @return
   */
  private Group loadPaletteImg2(Gui.Listener.EditorChoosePaletteListener listener) {
    Group pGroup = new Group();
    pGroup.setVisible(false);
    pGroup.setLayoutX(0);
    pGroup.setLayoutY(650);

    ImageView ivBorder = new ImageView(Objekte.getImgMapEditor().getSingleBorderHover());
    listener.setBorder(ivBorder);

    ImageView ivPlant01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getPlant01());
    listener.setId(1, 0, 101);
    ImageView ivZaunH01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunH01());
    listener.setId(1, 1, 102);
    ivZaunH01.setLayoutX(25);
    ImageView ivZaunV01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunV01());
    listener.setId(1, 2, 103);
    ivZaunV01.setLayoutX(50);
    ImageView ivZaunOL_UR01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunOL_UR01());
    listener.setId(1, 3, 104);
    ivZaunOL_UR01.setLayoutX(75);
    ImageView ivZaunUL_OR01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunUL_OR01());
    listener.setId(1, 4, 105);
    ivZaunUL_OR01.setLayoutX(100);
    ImageView ivZaunOM_RM01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunOM_RM01());
    listener.setId(1, 5, 106);
    ivZaunOM_RM01.setLayoutX(125);
    ImageView ivZaunLM_UM01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getZaunLM_UM01());
    listener.setId(1, 6, 107);
    ivZaunLM_UM01.setLayoutX(150);

    ImageView ivCrystal_kl = new Data.Overwrite.ImageView(Objekte.getImgMap().getCrystal_kl());
    listener.setId(1, 7, 120);
    ivCrystal_kl.setLayoutX(175);

    ImageView ivTree01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getTree01());
    listener.setId(1, 8, 150);
    ivTree01.setLayoutX(200);

    // listener
    ivPlant01.setOnMouseClicked(listener);
    ivZaunH01.setOnMouseClicked(listener);
    ivZaunV01.setOnMouseClicked(listener);
    ivZaunOL_UR01.setOnMouseClicked(listener);
    ivZaunUL_OR01.setOnMouseClicked(listener);
    ivZaunOM_RM01.setOnMouseClicked(listener);
    ivZaunLM_UM01.setOnMouseClicked(listener);

    ivCrystal_kl.setOnMouseClicked(listener);

    ivTree01.setOnMouseClicked(listener);

    // group
    pGroup.getChildren().add(ivPlant01);
    pGroup.getChildren().add(ivZaunH01);
    pGroup.getChildren().add(ivZaunV01);
    pGroup.getChildren().add(ivZaunOL_UR01);
    pGroup.getChildren().add(ivZaunUL_OR01);
    pGroup.getChildren().add(ivZaunOM_RM01);
    pGroup.getChildren().add(ivZaunLM_UM01);
    pGroup.getChildren().add(ivBorder);

    pGroup.getChildren().add(ivCrystal_kl);

    pGroup.getChildren().add(ivTree01);
    return pGroup;
  }
Beispiel #7
0
  /**
   * Ground
   *
   * @param listener
   * @return
   */
  private Group loadPaletteImg1(Gui.Listener.EditorChoosePaletteListener listener) {
    Group pGroup = new Group();
    pGroup.setVisible(false);
    pGroup.setLayoutX(0);
    pGroup.setLayoutY(650);

    ImageView ivBorder = new ImageView(Objekte.getImgMapEditor().getSingleBorder());
    listener.setBorder(ivBorder);

    ImageView gras01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getGras());
    listener.setId(0, 0, 1);
    gras01.setLayoutX(0);

    ImageView groundWalk01 = new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalk01());
    listener.setId(0, 1, 20);
    groundWalk01.setLayoutX(25);
    ImageView groundWalkRB01 =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkRB01());
    listener.setId(0, 2, 21);
    groundWalkRB01.setLayoutX(50);
    ImageView groundWalkRT01 =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkRT01());
    listener.setId(0, 3, 22);
    groundWalkRT01.setLayoutX(75);
    ImageView groundWalkRR01 =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkRR01());
    listener.setId(0, 4, 23);
    groundWalkRR01.setLayoutX(100);
    ImageView groundWalkRL01 =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkRL01());
    listener.setId(0, 5, 24);
    groundWalkRL01.setLayoutX(125);

    ImageView groundWalkOL_UR_L =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkOL_UR_L());
    listener.setId(0, 6, 25);
    groundWalkOL_UR_L.setLayoutX(150);
    ImageView groundWalkOL_UR_R =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkOL_UR_R());
    listener.setId(0, 7, 26);
    groundWalkOL_UR_R.setLayoutX(175);
    ImageView groundWalkUL_OR_L =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkUL_OR_L());
    listener.setId(0, 8, 27);
    groundWalkUL_OR_L.setLayoutX(200);
    ImageView groundWalkUL_OR_R =
        new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkUL_OR_R());
    listener.setId(0, 9, 28);
    groundWalkUL_OR_R.setLayoutX(225);

    ImageView groundWalkE_B = new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkE_B());
    listener.setId(0, 10, 29);
    groundWalkE_B.setLayoutX(250);
    ImageView groundWalkE_T = new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkE_T());
    listener.setId(0, 11, 30);
    groundWalkE_T.setLayoutX(275);
    ImageView groundWalkE_R = new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkE_R());
    listener.setId(0, 12, 31);
    groundWalkE_R.setLayoutX(300);
    ImageView groundWalkE_L = new Data.Overwrite.ImageView(Objekte.getImgMap().getGroundWalkE_L());
    listener.setId(0, 13, 32);
    groundWalkE_L.setLayoutX(325);

    // Listener
    gras01.setOnMouseClicked(listener);

    groundWalk01.setOnMouseClicked(listener);
    groundWalkRB01.setOnMouseClicked(listener);
    groundWalkRT01.setOnMouseClicked(listener);
    groundWalkRR01.setOnMouseClicked(listener);
    groundWalkRL01.setOnMouseClicked(listener);

    groundWalkOL_UR_L.setOnMouseClicked(listener);
    groundWalkOL_UR_R.setOnMouseClicked(listener);
    groundWalkUL_OR_L.setOnMouseClicked(listener);
    groundWalkUL_OR_R.setOnMouseClicked(listener);

    groundWalkE_B.setOnMouseClicked(listener);
    groundWalkE_T.setOnMouseClicked(listener);
    groundWalkE_R.setOnMouseClicked(listener);
    groundWalkE_L.setOnMouseClicked(listener);

    // Gruppe adden
    pGroup.getChildren().add(gras01);

    pGroup.getChildren().add(groundWalk01);
    pGroup.getChildren().add(groundWalkRB01);
    pGroup.getChildren().add(groundWalkRT01);
    pGroup.getChildren().add(groundWalkRR01);
    pGroup.getChildren().add(groundWalkRL01);

    pGroup.getChildren().add(groundWalkOL_UR_L);
    pGroup.getChildren().add(groundWalkOL_UR_R);
    pGroup.getChildren().add(groundWalkUL_OR_L);
    pGroup.getChildren().add(groundWalkUL_OR_R);

    pGroup.getChildren().add(groundWalkE_B);
    pGroup.getChildren().add(groundWalkE_T);
    pGroup.getChildren().add(groundWalkE_R);
    pGroup.getChildren().add(groundWalkE_L);

    pGroup.getChildren().add(ivBorder);
    return pGroup;
  }
Beispiel #8
0
 public void showZX2GridLinesGroup(boolean visible) {
   showzx2GridLinesGroup = visible;
   zx2GridLinesGroup.setVisible(visible);
 }
Beispiel #9
0
 public void showYX2GridLinesGroup(boolean visible) {
   showyx2GridLinesGroup = visible;
   yx2GridLinesGroup.setVisible(visible);
 }
Beispiel #10
0
 public void showXX2GridLinesGroup(boolean visible) {
   showxx2GridLinesGroup = visible;
   xx2GridLinesGroup.setVisible(visible);
 }
Beispiel #11
0
 public void showZY1GridLinesGroup(boolean visible) {
   showzy1GridLinesGroup = visible;
   zy1GridLinesGroup.setVisible(visible);
 }
Beispiel #12
0
 public void showXY1GridLinesGroup(boolean visible) {
   showxy1GridLinesGroup = visible;
   xy1GridLinesGroup.setVisible(visible);
 }
Beispiel #13
0
 public void showZAxesGroup(boolean visible) {
   showzAxesGroup = visible;
   zAxesGroup.setVisible(visible);
 }
Beispiel #14
0
 public void showYAxesGroup(boolean visible) {
   showyAxesGroup = visible;
   yAxesGroup.setVisible(visible);
 }
Beispiel #15
0
 public void showXAxesGroup(boolean visible) {
   showxAxesGroup = visible;
   xAxesGroup.setVisible(visible);
 }
Beispiel #16
0
 public void showSphereGroup(boolean visible) {
   showSphereGroup = visible;
   sphereGroup.setVisible(visible);
 }
Beispiel #17
0
  public void adjustPanelsByPos(double rx, double ry, double rz) {
    cameraRX = rx;
    cameraRY = ry;
    cameraRZ = rz;

    if (-85 < ry && ry < 85) {
      x1AxisRectangle.setVisible(false);
      xy1GridLinesGroup.setVisible(false);
      xx1GridLinesGroup.setVisible(false);
    } else {
      if (showx1AxisRectangle) x1AxisRectangle.setVisible(true);
      if (showxy1GridLinesGroup) xy1GridLinesGroup.setVisible(true);
      if (showxx1GridLinesGroup) xx1GridLinesGroup.setVisible(true);
    }
    if ((95 < ry && ry < 180) || (-180 < ry && ry < -95)) {
      x2AxisRectangle.setVisible(false);
      xy2GridLinesGroup.setVisible(false);
      xx2GridLinesGroup.setVisible(false);

    } else {
      if (showx1AxisRectangle) x2AxisRectangle.setVisible(true);
      if (showxy2GridLinesGroup) xy2GridLinesGroup.setVisible(true);
      if (showxx2GridLinesGroup) xx2GridLinesGroup.setVisible(true);
    }

    if (5 < ry && ry < 175) {
      y1AxisRectangle.setVisible(false);
      yy1GridLinesGroup.setVisible(false);
      yx1GridLinesGroup.setVisible(false);
    } else {
      if (showy1AxisRectangle) y1AxisRectangle.setVisible(true);
      if (showyy1GridLinesGroup) yy1GridLinesGroup.setVisible(true);
      if (showyx1GridLinesGroup) yx1GridLinesGroup.setVisible(true);
    }
    if (-175 < ry && ry < -5) {
      y2AxisRectangle.setVisible(false);
      yy2GridLinesGroup.setVisible(false);
      yx2GridLinesGroup.setVisible(false);
    } else {
      if (showy2AxisRectangle) y2AxisRectangle.setVisible(true);
      if (showyy2GridLinesGroup) yy2GridLinesGroup.setVisible(true);
      if (showyx2GridLinesGroup) yx2GridLinesGroup.setVisible(true);
    }

    if (rx > 0) {
      z1AxisRectangle.setVisible(false);
      zy1GridLinesGroup.setVisible(false);
      zx1GridLinesGroup.setVisible(false);
    } else {
      if (showz1AxisRectangle) z1AxisRectangle.setVisible(true);
      if (showzy1GridLinesGroup) zy1GridLinesGroup.setVisible(true);
      if (showzx1GridLinesGroup) zx1GridLinesGroup.setVisible(true);
    }
    if (rx < 0) {
      z2AxisRectangle.setVisible(false);
      zy2GridLinesGroup.setVisible(false);
      zx2GridLinesGroup.setVisible(false);
    } else {
      if (showz2AxisRectangle) z2AxisRectangle.setVisible(true);
      if (showzy2GridLinesGroup) zy2GridLinesGroup.setVisible(true);
      if (showzx2GridLinesGroup) zx2GridLinesGroup.setVisible(true);
    }
  }