protected Node getContentNode() {
    Node taskView = getTaskView();

    if (SettingsUtil.loadSettings().isShowStatistics()) {
      LOGGER.debug("Statistics enabled in settings");
      statisticsView = new VBox(20);

      // wrap statistics in scrollpane
      ScrollPane scrollPane = new ScrollPane(statisticsView);
      scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
      scrollPane.setFitToWidth(true);
      scrollPane.setPadding(new Insets(7));

      // both statistics and task view present
      // show both in a split pane
      SplitPane splitPane = new SplitPane();
      splitPane.setOrientation(Orientation.HORIZONTAL);
      splitPane.setDividerPosition(0, 0.8);
      splitPane.getItems().addAll(taskView, scrollPane);
      return splitPane;
    } else {
      LOGGER.debug("Statistics disabled in settings");
      return taskView;
    }
  }
  public PrenotaViaggioView(
      Stage stage, PrenotaViaggioControl prenotaViaggioControl, GpMediator gpimpl) {
    this.prenotaViaggioControl = prenotaViaggioControl;
    this.gpMediator = gpimpl;
    gpimpl.addColleague(this);

    this.tg = new ToggleGroup();

    this.gridCredential = new GridPane();

    double percentageWidth = 0.50;
    double percentageHeight = 0.50;

    layout = new SplitPane();
    layout.setPadding(new Insets(20, 0, 20, 20));
    layout.setOrientation(Orientation.HORIZONTAL);
    Rectangle2D screenSize = Screen.getPrimary().getBounds();
    percentageWidth *= screenSize.getWidth();
    percentageHeight *= screenSize.getHeight();

    sp1 = buildLeft();
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(sp1);

    sp2 = new StackPane();

    layout.getItems().addAll(scrollPane, sp2);
    layout.setDividerPositions(0.5f, 0.5f);

    this.scene = new Scene(layout, percentageWidth, percentageHeight);

    scene.getStylesheets().add("JMetroLightTheme.css");
    stage.getIcons().add(new Image("icon.png"));

    stage.setTitle("Creazione Viaggio Gruppo");
    stage.setScene(scene);
    stage.show();
  }
示例#3
0
  public ResourceLinkView(
      ResourceLinkModel resourceLinkModel, ResourceLinkController resourceLinkController) {
    this.resourceLinkModel = resourceLinkModel;
    this.dataSet = resourceLinkModel.getDataSet();
    this.trest = resourceLinkModel.getTrest();
    // this.dictionaryModel =dictionaryModel;
    // this.dataSet =dictionaryModel.getTMenuModel().getTrestModel().getDataSet();
    FXMLLoader fxmlLoader =
        XmlRW.fxmlLoad(
            this,
            resourceLinkController,
            "resourceLinkView.fxml",
            "resources.ui",
            "resourceLinkStyle.css");

    SplitPane splitPane = new SplitPane();
    BorderPane borderPane = new BorderPane();

    // ----------------------------------------------------------------------------------------------------------------------

    MVC schemaWorkMVC =
        new MVC(
            SchemaModel.class,
            SchemaController.class,
            SchemaView.class,
            this.resourceLinkModel,
            Rule.Work);
    SchemaView view = (SchemaView) schemaWorkMVC.getView();
    view.addEventHandler(MouseEvent.MOUSE_MOVED, (SchemaController) schemaWorkMVC.getController());
    view.addEventHandler(
        MouseEvent.MOUSE_PRESSED, (SchemaController) schemaWorkMVC.getController());

    //        pschemeView.addMouseMotionListener(pschemeController);                          //
    // Here we add an observer (MouseMotionListener: mouseDragged, mouseMoved) for the view.
    //        pschemeView.addMouseListener(pschemeController);                                //
    // Here we add an observer (MouseListener:  mousePressed) for the view.

    // ----------------------------------------------------------------------------------------------------------------------
    MVC tableWorkMVC =
        new MVC(
            TableModel.class,
            TableController.class,
            TableViewP.class,
            this.resourceLinkModel,
            Rule.Work);
    MVC hboxpaneWorkMVC =
        new MVC(
            HboxpaneModel.class, HboxpaneController.class, HboxpaneView.class, dataSet, Rule.Work);
    hboxpaneWorkMVC.addObserverP((TableModel) tableWorkMVC.getModel());

    VBox vboxWork = new VBox();

    Label labelWork = new Label(fxmlLoader.getResources().getString("ListManufacturing"));
    labelWork.setGraphic(
        new ImageView(new Image(IconT.class.getResource("RowWork.png").toString())));

    vboxWork
        .getChildren()
        .addAll(
            labelWork,
            (HboxpaneView) hboxpaneWorkMVC.getView(),
            (TableViewP) tableWorkMVC.getView());
    vboxWork.setSpacing(5); // The amount of vertical space between each child in the vbox.
    vboxWork.setPadding(
        new Insets(
            10, 0, 0,
            10)); // The top,right,bottom,left padding around the region's content. This space will
                  // be included in the calculation of the region's minimum and preferred sizes. By
                  // default padding is Insets.EMPTY and cannot be set to null.
    // ----------------------------------------------------------------------------------------------------------------------
    MVC tableMacineMVC =
        new MVC(
            TableModel.class,
            TableController.class,
            TableViewP.class,
            this.resourceLinkModel,
            Rule.Machine);
    MVC hboxpaneMVCmacine =
        new MVC(
            HboxpaneModel.class,
            HboxpaneController.class,
            HboxpaneView.class,
            dataSet,
            Rule.RowMachine);
    hboxpaneMVCmacine.addObserverP((TableModel) tableMacineMVC.getModel());

    tableWorkMVC.addObserverP((TableModel) tableMacineMVC.getModel());
    tableWorkMVC.addObserverP((SchemaModel) schemaWorkMVC.getModel());

    VBox vboxMacine = new VBox();
    Label labelMacine = new Label(fxmlLoader.getResources().getString("ListEquipment"));
    labelMacine.setGraphic(
        new ImageView(new Image(IconT.class.getResource("RowMachine.png").toString())));

    vboxMacine
        .getChildren()
        .addAll(
            labelMacine,
            (HboxpaneView) hboxpaneMVCmacine.getView(),
            (TableViewP) tableMacineMVC.getView());
    vboxMacine.setSpacing(5); // The amount of vertical space between each child in the vbox.
    vboxMacine.setPadding(
        new Insets(
            30, 0, 0,
            10)); // The top,right,bottom,left padding around the region's content. This space will
                  // be included in the calculation of the region's minimum and preferred sizes. By
                  // default padding is Insets.EMPTY and cannot be set to null.
    // ----------------------------------------------------------------------------------------------------------------------
    VBox vboxSplitPaneLeft = new VBox();
    vboxSplitPaneLeft.getChildren().addAll(vboxWork, vboxMacine);
    vboxSplitPaneLeft.setSpacing(5); // The amount of vertical space between each child in the vbox.
    vboxSplitPaneLeft.setPadding(
        new Insets(
            10, 0, 0,
            10)); // The top,right,bottom,left padding around the region's content. This space will
                  // be included in the calculation of the region's minimum and preferred sizes. By
                  // default padding is Insets.EMPTY and cannot be set to null.
    // ----------------------------------------------------------------------------------------------------------------------

    final StackPane sp3 = new StackPane();
    sp3.setMinHeight(120);
    sp3.getChildren().add(new Button("Button Tree"));

    splitPane.getItems().addAll(vboxSplitPaneLeft, borderPane);

    borderPane.setCenter((BorderPane) schemaWorkMVC.getView());
    borderPane.setBottom(sp3);

    /*
            splitPaneInner.getItems().addAll((BorderPane)schemaWorkMVC.getView(), sp3);
            splitPaneInner.setDividerPositions(0.5f, 0.1f);
            splitPaneInner.setOrientation(Orientation.VERTICAL);

    */

    splitPane.setDividerPositions(0.2f, 0.6f);

    setCenter(splitPane);
  }
 public static void main(String args[]) {
   // Create an instance of the test application
   SplitPane mainFrame = new SplitPane();
   mainFrame.pack();
   mainFrame.setVisible(true);
 }