@Override
  protected void activate() {
    currencyComboBox.setItems(model.getTradeCurrencies());
    currencyComboBox.getSelectionModel().select(model.getTradeCurrency());
    currencyComboBox.setVisibleRowCount(Math.min(currencyComboBox.getItems().size(), 25));
    currencyComboBox.setOnAction(
        e -> {
          model.onSetTradeCurrency(currencyComboBox.getSelectionModel().getSelectedItem());
          updateChartData();
        });

    model.getOfferBookListItems().addListener(changeListener);
    tradeCurrencySubscriber =
        EasyBind.subscribe(
            model.tradeCurrency,
            newValue -> {
              String code = newValue.getCode();
              areaChart.setTitle("Offer book for " + newValue.getName());
              priceColumnLabel.set("Price (" + code + "/BTC)");
              volumeColumnLabel.set("Volume (" + code + ")");
              xAxis.setLabel(priceColumnLabel.get());
              xAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(xAxis, "", ""));
            });

    buyOfferTableView.setItems(model.getBuyOfferList());
    sellOfferTableView.setItems(model.getSellOfferList());

    updateChartData();
  }
Beispiel #2
0
  public void putInTable(ObservableList<Medarbejder> datars) {

    viewNavn.setCellValueFactory(new PropertyValueFactory("navn"));
    viewEmail.setCellValueFactory(new PropertyValueFactory("email"));
    viewAfdeling.setCellValueFactory(new PropertyValueFactory("afdeling"));

    TableView.setItems(null);
    TableView.setItems(datars);
  }
  @FXML
  private void genararb(ActionEvent event) {
    tablabloque.getColumns().clear();
    String[] titulos = {
      "Numero", "bloque", "Fecha De Creacion", "Fecha De Modificacion",
    };

    for (int i = 0; i < titulos.length; i++) {
      final int j = i;
      this.titulo = new TableColumn(titulos[i]);
      this.titulo.setCellValueFactory(
          new Callback<
              TableColumn.CellDataFeatures<ObservableList, String>, ObservableValue<String>>() {
            @Override
            public ObservableValue<String> call(
                TableColumn.CellDataFeatures<ObservableList, String> parametro) {
              return new SimpleStringProperty((String) parametro.getValue().get(j));
            }
          });
      tablabloque.getColumns().addAll(titulo);
      // Asignamos un tamaño a ls columnnas
      titulo.setMinWidth(120);

      // Centrar los datos de la tabla
      titulo.setCellFactory(
          new Callback<TableColumn<String, String>, TableCell<String, String>>() {
            @Override
            public TableCell<String, String> call(TableColumn<String, String> p) {
              TableCell cell =
                  new TableCell() {
                    @Override
                    protected void updateItem(Object t, boolean bln) {
                      if (t != null) {
                        super.updateItem(t, bln);
                        setText(t.toString());
                        setAlignment(Pos.CENTER); // Setting the Alignment
                      }
                    }
                  };
              return cell;
            }
          });
    }

    tbbloque = FXCollections.observableArrayList();
    for (Tbbloque bloq : resultsbloque) {
      ObservableList<String> row = FXCollections.observableArrayList();
      row.add(bloq.getId().toString());
      row.add(bloq.getNombre());
      row.add(df1.format(bloq.getFechacreacion()));
      System.out.print(bloq.getFechacreacion());
      String fecha =
          bloq.getFechamodificacion() == null
              ? bloq.getFechamodificacion() + ""
              : df1.format(bloq.getFechamodificacion());
      row.add(fecha);
      tbbloque.addAll(row);
    }
    tablabloque.setItems(tbbloque);
  }
  @FXML
  void initialize() {
    getAllImageViewsForButtons();
    configureWidthHeightForImageViews();
    configureButtons();
    contentPane.setAlignment(Pos.CENTER);

    // show all customers and all employees
    titleLabel.setText("All Customers and All Employees");
    TableView table = new TableView();

    TableColumn fnCol = new TableColumn("First Name");
    fnCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    TableColumn lnCol = new TableColumn("Last Name");
    lnCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    TableColumn emailCol = new TableColumn("email");
    emailCol.setCellValueFactory(new PropertyValueFactory<>("email"));

    table.getColumns().addAll(fnCol, lnCol, emailCol);

    ObservableList<Person> data =
        FXCollections.observableArrayList(operation.getAllCustomersAndEmployees());
    table.setItems(data);
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    contentPane.getChildren().add(table);
  }
 @SuppressWarnings("unchecked")
 private void initComponents() {
   pane = new AnchorPane();
   pane.setPrefSize(800, 600);
   pane.setStyle(
       "-fx-background-color: linear-gradient(from 0% 0% to 100% 100%, blue 0%, silver 100%);");
   txPesquisa = new TextField();
   DropShadow ds = new DropShadow();
   ds.setSpread(0.5);
   ds.setColor(Color.web("#FF0000"));
   txPesquisa.setEffect(ds);
   txPesquisa.setPromptText("Digite o item para pesquisa");
   txPesquisa.setPrefWidth(200);
   txPesquisa.setFocusTraversable(false);
   tbVitrine = new TableView<ItensProperty>();
   initItens();
   tbVitrine.setItems(listItens);
   tbVitrine.setPrefSize(780, 550);
   columnProduto = new TableColumn<ItensProperty, String>();
   columnProduto.setCellValueFactory(new PropertyValueFactory<ItensProperty, String>("produto"));
   columnProduto.setText("Produto");
   columnPreco = new TableColumn<ItensProperty, Double>();
   columnPreco.setCellValueFactory(new PropertyValueFactory<ItensProperty, Double>("preco"));
   columnPreco.setText("Preço");
   tbVitrine.getColumns().addAll(columnProduto, columnPreco);
   pane.getChildren().addAll(txPesquisa, tbVitrine);
 }
Beispiel #6
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  public void initialize(URL url, ResourceBundle rb) {

    ObservableList<Medarbejder> data = FXCollections.observableArrayList();

    try {
      Connection con = dataaccess.getConnection();

      PreparedStatement prep =
          con.prepareStatement(
              "SELECT MEDARBEJDER.NAVN, EMAIL, MEDARBEJDER.AFDELING  FROM MEDARBEJDER");

      rs = prep.executeQuery();

      while (rs.next()) {

        data.add(
            new Medarbejder(rs.getString("navn"), rs.getString("email"), rs.getString("afdeling")));
      }

      viewNavn.setCellValueFactory(new PropertyValueFactory("navn"));
      viewEmail.setCellValueFactory(new PropertyValueFactory("email"));
      viewAfdeling.setCellValueFactory(new PropertyValueFactory("afdeling"));

      TableView.setItems(null);
      TableView.setItems(data);

    } catch (Exception e) {
      e.printStackTrace();
      System.out.println("Error on Building Data");
    }
  }
  /** Initializes the controller class. */
  @Override
  public void initialize(URL url, ResourceBundle rb) {
    resultTable.setItems(searchResults);

    titleC.setCellFactory(
        (TableColumn<SearchResult, String> p) -> {
          TextFieldTableCell<SearchResult, String> cell = new TextFieldTableCell<>();
          cell.setOnMouseClicked(
              t -> {
                if (t.getClickCount() == 2 && (!cell.isEmpty())) {
                  try {
                    String file = cell.getTableView().getItems().get(cell.getIndex()).getId().get();
                    Runtime.getRuntime()
                        .exec(
                            "open /Users/Luxin/Documents/UTC/LO17/SearchEngine/TD/TD01/BULLETINS/"
                                + file
                                + ".htm");
                  } catch (IOException ex) {
                    Logger.getLogger(SearchEngineInterfaceController.class.getName())
                        .log(Level.SEVERE, null, ex);
                  }
                }
              });
          return cell;
        });

    scoreC.setCellValueFactory(cell -> cell.getValue().getScore());
    idC.setCellValueFactory(cell -> cell.getValue().getId());
    titleC.setCellValueFactory(cell -> cell.getValue().getTitle());
  }
 public void loadData(boolean forceReload) {
   ICFSecuritySchemaObj schemaObj = (ICFSecuritySchemaObj) javafxSchema.getSchema();
   if ((containingCluster == null) || forceReload) {
     CFSecurityAuthorization auth = schemaObj.getAuthorization();
     long containingClusterId = auth.getSecClusterId();
     containingCluster = schemaObj.getClusterTableObj().readClusterByIdIdx(containingClusterId);
   }
   if ((listOfSysCluster == null) || forceReload) {
     observableListOfSysCluster = null;
     listOfSysCluster =
         schemaObj
             .getSysClusterTableObj()
             .readSysClusterByClusterIdx(containingCluster.getRequiredId(), javafxIsInitializing);
     if (listOfSysCluster != null) {
       observableListOfSysCluster = FXCollections.observableArrayList(listOfSysCluster);
       observableListOfSysCluster.sort(compareSysClusterByQualName);
     } else {
       observableListOfSysCluster = FXCollections.observableArrayList();
     }
     dataTable.setItems(observableListOfSysCluster);
     // Hack from stackoverflow to fix JavaFX TableView refresh issue
     ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
     ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
   }
 }
Beispiel #9
0
  @Override
  public void initialize(URL url, ResourceBundle rb) {
    table = new TableView<>();
    data = new ProjectData();

    TableColumn idProjectCol = new TableColumn("ID");
    idProjectCol.setCellValueFactory(
        new PropertyValueFactory<ProjectDataItem, String>("IDProject"));
    idProjectCol.setCellFactory(new EditableCell());

    TableColumn nameCol = new TableColumn("Name");
    nameCol.setCellValueFactory(new PropertyValueFactory<ProjectDataItem, String>("Name"));
    nameCol.setCellFactory(new EditableCell());

    TableColumn descriptionCol = new TableColumn("Description");
    descriptionCol.setCellValueFactory(
        new PropertyValueFactory<ProjectDataItem, String>("Description"));
    descriptionCol.setCellFactory(new EditableCell());

    table.setItems(data.getData());
    table.getColumns().addAll(idProjectCol, nameCol, descriptionCol);
    table.setEditable(true);
    table.setTableMenuButtonVisible(true);
    table.setContextMenu(new ProjectFormController.ProjectContextMenu());
    table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

    paneTable.getChildren().add(table);
    AnchorPane.setTopAnchor(table, 0.0);
    AnchorPane.setLeftAnchor(table, 0.0);
    AnchorPane.setRightAnchor(table, 0.0);
    AnchorPane.setBottomAnchor(table, 50.0);
  }
  private void populateServiceData(
      final String serviceVirtualName,
      final Calendar creationTimeStamp,
      final Calendar lastUpdatedTimeStamp,
      final MsttResponseDefinition msttRes,
      final MsttRequestDefinition msttReq) {
    removeEntries();
    System.out.println("in the serviece populating" + serviceVirtualName);
    TableEntry virtualName = new TableEntry(VIRTUAL_NAME, serviceVirtualName);
    TableEntry fixedDelayinMilliSeconds = new TableEntry();
    TableEntry virtualCreation =
        new TableEntry(CREATED_TIMESTAMP, calendarToString(creationTimeStamp));
    TableEntry virtualLastUpdation =
        new TableEntry(LAST_UPDATED_TIMESTAMP, calendarToString(lastUpdatedTimeStamp));
    TableEntry priority = new TableEntry();
    fixedDelayinMilliSeconds.setElementName(RESPONSE_DELAY);
    if (msttRes.getFixedDelayMilliseconds() != null) {
      fixedDelayinMilliSeconds.setElementValue("" + msttRes.getFixedDelayMilliseconds());
    } else {
      fixedDelayinMilliSeconds.setElementValue(EMPTY_STRING);
    }
    priority.setElementName(PRIORITY);
    if (msttReq.getPriority() != null) {
      priority.setElementValue("" + msttReq.getPriority());
    } else {
      priority.setElementValue(EMPTY_STRING);
    }
    ObservableList<TableEntry> data =
        FXCollections.observableArrayList(
            virtualName, fixedDelayinMilliSeconds, priority, virtualCreation, virtualLastUpdation);
    dataTable.setItems(data);
    // dataTable.getItems().addAll();

  }
Beispiel #11
0
 @Override
 public void saveAsExcel() {
   TableView<ItemPrice> itemTable = new ItemTable(this).getTable();
   itemTable.setItems(item.list());
   itemTable.setId(module + " List as of " + Util.formatDate(LocalDate.now()));
   new ExcelWriter(
       Arrays.asList(Arrays.asList(itemTable)), module, Util.dateToFileName(LocalDate.now()));
 }
  /**
   * Erzeugt eine TableView mit den Daten aus der Datenbank.
   *
   * @return Eine TableView mit Polizist Daten
   */
  private Node getPolizistAnsichtInnereTabelle() {
    refreshPolizistAnsicht();

    // Name Spalte
    TableColumn<PolizistDaten, String> SpalteName = new TableColumn<>("Name");
    SpalteName.setMinWidth(200);
    SpalteName.setCellValueFactory(new PropertyValueFactory<>("Name"));

    // GebDatum Spalte
    TableColumn<PolizistDaten, String> SpalteDatum = new TableColumn<>("Geburtsdatum");
    SpalteDatum.setMinWidth(200);
    SpalteDatum.setCellValueFactory(new PropertyValueFactory<>("GebDatum"));

    // Nationalitaet Spalte
    TableColumn<PolizistDaten, String> SpalteNation = new TableColumn<>("Nationalität");
    SpalteNation.setMinWidth(200);
    SpalteNation.setCellValueFactory(new PropertyValueFactory<>("Nation"));

    // Geschlecht Spalte
    TableColumn<PolizistDaten, String> SpalteGeschlecht = new TableColumn<>("Geschlecht");
    SpalteGeschlecht.setMinWidth(200);
    SpalteGeschlecht.setCellValueFactory(new PropertyValueFactory<>("Geschlecht"));

    // Todesdatum Spalte
    TableColumn<PolizistDaten, String> SpalteTod = new TableColumn<>("Todesdatum");
    SpalteTod.setMinWidth(200);
    SpalteTod.setCellValueFactory(new PropertyValueFactory<>("TodDatum"));

    // Dienstgrad Spalte
    TableColumn<PolizistDaten, String> SpalteGrad = new TableColumn<>("Dienstgrad");
    SpalteGrad.setMinWidth(200);
    SpalteGrad.setCellValueFactory(new PropertyValueFactory<>("Dienstgrad"));

    Tabelle.setItems(PolizistDatenListe);
    Tabelle.getColumns().add(SpalteName);
    Tabelle.getColumns().add(SpalteDatum);
    Tabelle.getColumns().add(SpalteNation);
    Tabelle.getColumns().add(SpalteGeschlecht);
    Tabelle.getColumns().add(SpalteTod);
    Tabelle.getColumns().add(SpalteGrad);

    Tabelle.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

    // Doppelklicke auf Spalten sollen Detailansichten oeffnen:
    Tabelle.setRowFactory(
        param -> {
          TableRow<PolizistDaten> Spalte = new TableRow<>();
          Spalte.setOnMouseClicked(
              event -> {
                if (event.getClickCount() == 2 && (!Spalte.isEmpty())) {
                  erzeugeDetailAnsicht(Spalte.getItem());
                }
              });
          return Spalte;
        });

    return Tabelle;
  }
 /** initializes the tableView (history) */
 private void initializeTableView() {
   historyTable.setItems(HistoryHelper.getHistory());
   nameColumn.setCellValueFactory(
       new PropertyValueFactory<TransformationResultHistory, String>("fileName"));
   percentageColumn.setCellValueFactory(
       new PropertyValueFactory<TransformationResultHistory, Number>("percentOfSuppression"));
   dateColumn.setCellValueFactory(
       new PropertyValueFactory<TransformationResultHistory, Date>("transformationDate"));
 }
  private void CargarTabla() {
    tablabloque.getColumns().clear();
    String[] titulos = {
      "Bloque", "Pregunta",
    };

    for (int i = 0; i < titulos.length; i++) {
      final int j = i;
      this.titulo = new TableColumn(titulos[i]);
      this.titulo.setCellValueFactory(
          new Callback<
              TableColumn.CellDataFeatures<ObservableList, String>, ObservableValue<String>>() {
            @Override
            public ObservableValue<String> call(
                TableColumn.CellDataFeatures<ObservableList, String> parametro) {
              return new SimpleStringProperty((String) parametro.getValue().get(j));
            }
          });
      tablabloque.getColumns().addAll(titulo);
      // Asignamos un tamaño a ls columnnas
      if (i == 0) {
        titulo.setMinWidth(120);
      } else {
        titulo.setMinWidth(450);
      }

      // Centrar los datos de la tabla
      titulo.setCellFactory(
          new Callback<TableColumn<String, String>, TableCell<String, String>>() {
            @Override
            public TableCell<String, String> call(TableColumn<String, String> p) {
              TableCell cell =
                  new TableCell() {
                    @Override
                    protected void updateItem(Object t, boolean bln) {
                      if (t != null) {
                        super.updateItem(t, bln);
                        setText(t.toString());
                        setAlignment(Pos.CENTER); // Setting the Alignment
                      }
                    }
                  };
              return cell;
            }
          });
    }

    tbbloque = FXCollections.observableArrayList();
    for (Tbbloquesxpregunta bloqxpreg : resultsbloqxpreg) {
      ObservableList<String> row = FXCollections.observableArrayList();
      row.add(bloqxpreg.getIdbloque().getNombre());
      row.add(bloqxpreg.getIdpregunta().getNombre());
      tbbloque.addAll(row);
    }
    tablabloque.setItems(tbbloque);
  }
  @Override
  public void loaded() {
    Course course = (Course) parameter;
    courseNameField.textProperty().bindBidirectional(course.getNameProperty());
    universityField.textProperty().bindBidirectional(course.getUniversity().getNameProperty());

    preRequisitesTable.setItems(course.getPreRequisites());
    preRequisiteNameColumn.setCellValueFactory((q) -> q.getValue().getNameProperty());
    preRequisiteFieldColumn.setCellValueFactory((q) -> q.getValue().getFieldProperty());
  }
  @FXML
  private void handleButton(ActionEvent event)
      throws ClassNotFoundException, InstantiationException, IllegalAccessException {

    try {
      conn = DbConn.connect();
      String sql =
          "SELECT patient_id, first_name, last_name, date_of_birth FROM PR_PATIENT where first_name LIKE '%"
              + search_first.getText()
              + "%'";
      // "SELECT patient_id, first_name, last_name, date_of_birth FROM PR_PATIENT where first_name
      // LIKE '%"+search_first.getText()+"%'";

      ResultSet rs =
          conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY)
              .executeQuery(sql);
      ObservableList<Object> data = FXCollections.observableArrayList();

      for (int i = 0; i < rs.getMetaData().getColumnCount(); i++) {
        final int j = i;
        TableColumn col = new TableColumn(rs.getMetaData().getColumnName(i + 1));
        col.setCellValueFactory(
            new Callback<CellDataFeatures<ObservableList, String>, ObservableValue<String>>() {
              public ObservableValue<String> call(CellDataFeatures<ObservableList, String> param) {
                return new SimpleStringProperty(param.getValue().get(j).toString());
              }
            });

        search_results.getColumns().addAll(col);
      }

      while (rs.next()) {

        ObservableList<String> row = FXCollections.observableArrayList();
        for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {

          row.add(rs.getString(i));
        }
        System.out.println(row);
        data.add(row);
        // search_results.setItems(row);

      }
      search_results.setItems(data);
      // search_results.setItems(table);

      // ObservableList<Patient> data = search_results.getItems();
      // data.add(new Patient (FirstName.getText(), LastName.getText(), DOB.getText()));
      // FirstName.setText("");
      rs.close();

    } catch (SQLException e) {
      System.out.println("Error " + e.getMessage());
    }
  }
Beispiel #17
0
  private Pane buildUpperArea() {

    Pane up = new Pane();
    up.prefHeightProperty().bind(this.heightProperty());
    up.prefWidthProperty().bind(this.widthProperty());

    TableView<DebateDetails> table = new TableView<DebateDetails>();
    table.prefHeightProperty().bind(up.heightProperty());
    table.prefWidthProperty().bind(up.widthProperty());

    final Label label = new Label("Debate Tournament");
    label.setFont(new Font("Arial", 20));

    table.setEditable(false);

    table.getChildrenUnmodifiable().clear();
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    TableColumn<DebateDetails, String> divCol = new TableColumn<DebateDetails, String>("Division");
    divCol.setCellValueFactory(new PropertyValueFactory<>("division"));

    TableColumn<DebateDetails, String> teamCountCol =
        new TableColumn<DebateDetails, String>("Team Count");
    teamCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("teamCount")));

    TableColumn<DebateDetails, String> debCountCol =
        new TableColumn<DebateDetails, String>("Debate Count");
    debCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("totalMatch")));

    TableColumn<DebateDetails, String> debCompCol =
        new TableColumn<DebateDetails, String>("Debates Completed ");
    debCompCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchCompleted")));

    TableColumn<DebateDetails, String> debRemCol =
        new TableColumn<DebateDetails, String>("Upcoming Debates");
    debRemCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchRemaining")));

    final ObservableList<DebateDetails> data =
        FXCollections.observableArrayList(TeamManager.getDebateDetails());

    table.setItems(data);
    table.getColumns().add(divCol);
    table.getColumns().add(teamCountCol);
    table.getColumns().add(debCountCol);
    table.getColumns().add(debCompCol);
    table.getColumns().add(debRemCol);

    final VBox vbox = new VBox();
    vbox.setSpacing(5);
    vbox.setPadding(new Insets(10, 0, 0, 10));
    vbox.getChildren().addAll(label, table);
    up.getChildren().add(vbox);

    return up;
  }
 protected void loadContent() {
   if (wfEngine_ == null) {
     wfEngine_ = LocalWorkflowRuntimeEngineFactory.getRuntimeEngine();
     taskService_ = wfEngine_.getLocalTaskService();
     ObservableList<LocalTask> tasks =
         new ObservableListWrapper<LocalTask>(taskService_.getOpenOwnedTasks(user));
     taskTable.setItems(tasks);
   } else {
     refreshContent();
   }
 }
  public void setResult(List<PersonDTO> argResult) {
    List<PersonDTO> result = new LinkedList<>(argResult);

    if (result.size() > 0) {
      ObservableList<PersonDTO> obsResults = FXCollections.observableArrayList();
      for (PersonDTO p : result) {
        obsResults.add(p);
      }
      _personTable.setItems(obsResults);
    }
  }
  private void setupTable() {
    atracaoTableView.setItems(atracoes);

    columnIdAtracao.setCellValueFactory(cellData -> cellData.getValue().getIdAtracaoProperty());
    columnIdDescricao.setCellValueFactory(cellData -> cellData.getValue().getDescricaoProperty());
    columnIdClassificacaoEtaria.setCellValueFactory(
        cellData -> cellData.getValue().getClassificacaoEtariaProperty());
    columnIdLocal.setCellValueFactory(cellData -> cellData.getValue().getLocalProperty());
    columnIdEvento.setCellValueFactory(cellData -> cellData.getValue().getEventoProperty());
    columnIdData.setCellValueFactory(cellData -> cellData.getValue().getDataProperty());
  }
Beispiel #21
0
 private void refresh() {
   List<ImageResource> imageResources = new ArrayList<>();
   List<Resource> resources =
       book.getResources()
           .getResourcesByMediaTypes(
               new MediaType[] {MediaType.GIF, MediaType.PNG, MediaType.SVG, MediaType.JPG});
   for (Resource resource : resources) {
     imageResources.add((ImageResource) resource);
   }
   tableView.setItems(FXCollections.observableList(imageResources));
   tableView.getSelectionModel().select(0);
 }
  public void setFddObjectModel(FddObjectModel fddObjectModel) {
    logger.entry();
    if (fddObjectModel != null) {
      fddObjectModel
          .getInteractionClasses()
          .values()
          .stream()
          .forEach(
              (value) -> {
                interactions.add(new InteractionState(value));
              });
      InteractionTableView.setItems(interactions);
      interactions.forEach(
          (interaction) -> {
            interaction
                .onProperty()
                .addListener(
                    (observable, oldValue, newValue) -> {
                      if (!newValue) {
                        cb.setSelected(false);
                      } else if (interactions.stream().allMatch(a -> a.isOn())) {
                        cb.setSelected(true);
                      }
                    });
          });
      InteractionTableColumn.setCellValueFactory(new PropertyValueFactory<>("interactionName"));
      CheckTableColumn.setCellValueFactory(
          new Callback<
              TableColumn.CellDataFeatures<InteractionState, Boolean>, ObservableValue<Boolean>>() {
            @Override
            public ObservableValue<Boolean> call(
                TableColumn.CellDataFeatures<InteractionState, Boolean> param) {
              return param.getValue().onProperty();
            }
          });

      CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn));
      cb.setUserData(CheckTableColumn);
      cb.setOnAction(
          (ActionEvent event) -> {
            CheckBox cb1 = (CheckBox) event.getSource();
            TableColumn tc = (TableColumn) cb1.getUserData();
            InteractionTableView.getItems()
                .stream()
                .forEach(
                    (item) -> {
                      item.setOn(cb1.isSelected());
                    });
          });
      CheckTableColumn.setGraphic(cb);
    }
    logger.exit();
  }
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    imageSave.setImage(new Image(GuiMain.class.getResourceAsStream("save_32x32.png")));
    imageCancel.setImage(new Image(GuiMain.class.getResourceAsStream("cancel_32x32.png")));
    dpDate.setValue(LocalDate.now());

    cnDetails.setCellValueFactory(new PropertyValueFactory<>("details"));
    cnValue.setCellValueFactory(new PropertyValueFactory<>("value"));
    cnDate.setCellValueFactory(new PropertyValueFactory<>("date"));
    withdrawals = FXCollections.observableArrayList();
    tableWithdrawals.setItems(withdrawals);
  }
Beispiel #24
0
 //
 // Action When "Run" is pressed,
 //
 @Override
 public void handle(ActionEvent e) {
   // String currentText = textStatus.getText();
   // textStatus.setText(currentText + ", Run button pressed, more text wider than normal to
   // see if the text box will wrap>>>");
   YearData[] yd = MU.runMultiYearModel(30);
   for (int i = 0; i < yd.length; i++) {
     // Print out a result
     String msg = yd[i].toString();
     textStatus.appendText(msg + "\n");
   }
   tableV.setItems(MU.modelDataList);
 }
  /** ButtonMethod for add ingredients from the ingredientList into the tableview */
  public void addIngredientButton() {

    String selectedIngredient = recipeIngredients.getSelectionModel().getSelectedItems().toString();
    selectedIngredient = selectedIngredient.replaceAll("\\[", "").replaceAll("\\]", "");

    items.add(
        new Ingredient(
            selectedIngredient,
            ingredientAmount.getText(),
            ingredientUnit.getSelectionModel().getSelectedItem().toString())); // Creates new
    addedIngredientTable.setItems(
        items); // Object of the type Ingredient and adds it to the tableView.
  }
 public void setChapitres(int id) {
   this.idCours = id;
   chapitreDAO = new ImplChapitreDAO();
   chapitreDisplayChapitreTable.setItems(chapitreDAO.displayChapitre(id));
   nomDisplayChapitreColumn.setCellValueFactory(cellData -> cellData.getValue().NomProperty());
   numeroDisplayChapitreColumn.setCellValueFactory(
       cellData -> cellData.getValue().NumeroProperty().asString());
   showChapitreDetails(null);
   chapitreDisplayChapitreTable
       .getSelectionModel()
       .selectedItemProperty()
       .addListener((observable, oldValue, newValue) -> showChapitreDetails(newValue));
 }
  @FXML
  private void initialize() {
    name.setCellValueFactory(cellData -> cellData.getValue().nameProperty());
    rule.setCellValueFactory(cellData -> cellData.getValue().ruleProperty());
    status.setCellValueFactory(cellData -> cellData.getValue().statusProperty());
    alertMessage.setCellValueFactory(cellData -> cellData.getValue().alertMessageProperty());

    // add listener for change in table
    ruleTable
        .getSelectionModel()
        .selectedItemProperty()
        .addListener((observable, oldValue, newValue) -> ruleChanged(newValue));

    ruleTable.setItems(DeviceOverviewController.hydraCN.getCEPRuleData());
  }
Beispiel #28
0
  @FXML
  private void initialize() {
    createListMyBox();

    cbName.setPromptText("Выберите наименование...");
    cbName.setItems(listMyBoxName.getListName());
    tableColName.setCellValueFactory(new PropertyValueFactory<MyBox, String>("name"));
    tableColNumOfSubject.setCellValueFactory(
        new PropertyValueFactory<MyBox, Integer>("numberOfSubject"));
    tableColCount.setCellValueFactory(new PropertyValueFactory<MyBox, Integer>("countBox"));
    tableColVolume.setCellValueFactory(new PropertyValueFactory<MyBox, Double>("volume"));
    tableView.setItems(listMyBox.getListMyBox());
    labelKoef.setText("Коэффициент заполнения: " + String.valueOf(koef * 100 + "%"));
    initLisners();
  }
Beispiel #29
0
  @Override
  protected void activate() {
    FilteredList<Dispute> filteredList =
        new FilteredList<>(disputeManager.getDisputesAsObservableList());
    setFilteredListPredicate(filteredList);
    SortedList<Dispute> sortedList = new SortedList<>(filteredList);
    sortedList.setComparator((o1, o2) -> o2.getOpeningDate().compareTo(o1.getOpeningDate()));
    disputesTable.setItems(sortedList);
    disputesTable.getSelectionModel().selectedItemProperty().addListener(disputeChangeListener);

    Dispute selectedItem = disputesTable.getSelectionModel().getSelectedItem();
    if (selectedItem != null) disputesTable.getSelectionModel().select(selectedItem);

    scrollToBottom();
  }
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    Clientes cl = new Clientes();

    try {
      tcRfc.setCellValueFactory(c -> c.getValue().getF().Rfc);
      tcNombre.setCellValueFactory(c -> c.getValue().getF().Nombre);
      // tcNombre.setCellValueFactory(new PropertyValueFactory<Clientes, String>("F"));
      reci = cl.getReciclar();
      tablaClientes.setItems(reci);
    } catch (Exception e) {
      System.out.println(e);
      e.printStackTrace();
    }
  }