@Override
  public void handlePerspective(
      final Message<Event, Object> action, final PerspectiveLayout perspectiveLayout) {
    if (action.messageBodyEquals(MessageUtil.INIT)) {

      perspectiveLayout.registerRootComponent(createRoot());
      GridPane.setVgrow(perspectiveLayout.getRootComponent(), Priority.ALWAYS);
      GridPane.setHgrow(perspectiveLayout.getRootComponent(), Priority.ALWAYS);

      // register left panel
      perspectiveLayout.registerTargetLayoutComponent("content0", this.content1);
      perspectiveLayout.registerTargetLayoutComponent("content1", this.content2);
      perspectiveLayout.registerTargetLayoutComponent("content2", this.content3);
      ApplicationLauncherPerspectiveMessaginTest.latch.countDown();
    } else {
      if (counter.get() > 1) {
        counter.decrementAndGet();
        context.send("id10", "message");
      } else {
        System.out.println("Perspective id12: FINISH");
        if (wait.getCount() > 0) wait.countDown();
        if (PerspectiveMessagingTestP1.wait.getCount() > 0) context.send("id10", "message");
      }
    }
  }
Example #2
0
  @PostConstruct
  public void onStartPerspective(
      PerspectiveLayout perspectiveLayout,
      FXComponentLayout layout,
      ResourceBundle resourceBundle) {
    // Top Buttons component
    StackPane topPane = new StackPane();

    // Center Component
    StackPane centerPane = new StackPane();
    centerPane.setAlignment(Pos.TOP_CENTER);

    // Bottom Component
    bottomPane = new StackPane();
    bottomPane.setAlignment(Pos.BOTTOM_CENTER);

    // Bottom Bar Component
    bottomBar = new StackPane();
    bottomBar.setAlignment(Pos.BOTTOM_CENTER);

    // Attach to PERSPECTIVE
    mainSplit = constructSplitPane(constructScrollPane(centerPane), bottomPane);
    mainPane = constructMainPane(mainSplit, bottomBar);
    perspectiveLayout.registerTargetLayoutComponent(GuiConfig.TARGET_CONTAINER_TOP, topPane);
    perspectiveLayout.registerTargetLayoutComponent(GuiConfig.TARGET_CONTAINER_ABOUT, centerPane);
    perspectiveLayout.registerTargetLayoutComponent(GuiConfig.TARGET_CONTAINER_PANE, bottomPane);
    perspectiveLayout.registerTargetLayoutComponent(GuiConfig.TARGET_CONTAINER_BAR, bottomBar);

    // Define main pane
    borderPane = constructBorderPane(perspectiveLayout, topPane, mainPane);
  }