@Override
  public void initialize(URL location, ResourceBundle resources) {

    ImageView backImgBtnLayout =
        createImageBtnLayout(
            Constants.BACK_IMAGE_PATH, Constants.BACK_IMAGE_WIDTH, Constants.BACK_IMAGE_HEIGHT);
    backBtn.setGraphic(backImgBtnLayout);
    ImageView addImgBtnLayout =
        createImageBtnLayout(
            Constants.ADD_BUTTON_IMAGE_PATH, Constants.ADD_IMAGE_WIDTH, Constants.ADD_IMAGE_HEIGHT);
    addButton.setGraphic(addImgBtnLayout);

    cancelBtn.setOnAction(
        event -> {
          showWindow(true, false);
          setTitle(Constants.CHARACTER_SCENE_HEADER.toUpperCase());
        });

    levelField.setEditable(false);

    classBox.setItems(
        FXCollections.observableArrayList(
            "Guardin",
            "Assassin",
            "Archmage",
            "Necromancer",
            "Prophet",
            "Shaman",
            "Druid",
            "Ranger"));
    characterRaceBox.setItems(
        FXCollections.observableArrayList(
            "Human", "Gnome", "Dwarf", "Elf", "Eladin", "Tiefling", "Deva", "Goliath"));
  }
  private void showPersoon(Persoon persoon) {
    if (persoon == null) {
      clearTabPersoon();
    } else {
      tfPersoonNr.setText(persoon.getNr() + "");
      tfVoornamen.setText(persoon.getVoornamen());
      tfTussenvoegsel.setText(persoon.getTussenvoegsel());
      tfAchternaam.setText(persoon.getAchternaam());
      tfGeslacht.setText(persoon.getGeslacht().toString());
      tfGebDatum.setText(StringUtilities.datumString(persoon.getGebDat()));
      tfGebPlaats.setText(persoon.getGebPlaats());
      if (persoon.getOuderlijkGezin() != null) {
        cbOuderlijkGezin.getSelectionModel().select(persoon.getOuderlijkGezin());
      } else {
        cbOuderlijkGezin.getSelectionModel().clearSelection();
      }
      // todo opgave 3

      this.alsOuderBetrokkenIn =
          FXCollections.observableArrayList(persoon.getAlsOuderBetrokkenIn());

      ArrayList<Persoon> pList = new ArrayList<Persoon>();
      for (Gezin g : persoon.getAlsOuderBetrokkenIn()) {
        pList.addAll(g.getKinderen());
      }

      this.kinderen = FXCollections.observableArrayList(pList);

      lvAlsOuderBetrokkenBij.setItems(this.getAlsOuderBetrokkenIn());
    }
  }
Example #3
0
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    albumList = FXCollections.observableArrayList();
    playlistList = FXCollections.observableArrayList();
    fileList = new ArrayList<>();

    // obs³uga zamykania okna
    Platform.runLater(
        new Runnable() {
          @Override
          public void run() {
            root.getScene()
                .getWindow()
                .setOnCloseRequest(
                    e -> {
                      clearData();
                    });
          }
        });

    // wczytanie albumów i playlist
    loadAlbums();
    loadPlaylists();

    // domyœlnie pokazuje albumy
    drawAlbums();
    addPlaylistButton.disableProperty().set(true);
  }
 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);
   }
 }
  public static void main(String[] args) {
    ListProperty<String> lp1 = new SimpleListProperty<>(FXCollections.observableArrayList());
    ListProperty<String> lp2 = new SimpleListProperty<>(FXCollections.observableArrayList());

    lp1.bind(lp2);

    print("Before addAll():", lp1, lp2);
    lp1.addAll("One", "Two");
    print("After addAll():", lp1, lp2);

    // Change the reference of the ObservableList in lp2
    lp2.set(FXCollections.observableArrayList("1", "2"));
    print("After lp2.set():", lp1, lp2);

    // Cannot do the following as lp1 is a bound property
    // lp1.set(FXCollections.observableArrayList("1", "2"));
    // Unbind lp1
    lp1.unbind();
    print("After unbind():", lp1, lp2);

    // Bind lp1 and lp2 bidirectionally
    lp1.bindBidirectional(lp2);
    print("After bindBidirectional():", lp1, lp2);

    lp1.set(FXCollections.observableArrayList("X", "Y"));
    print("After lp1.set():", lp1, lp2);
  }
Example #6
0
  private void optimizePoints() {
    int total = 0, duplicates = 0, check = 0;

    Map<Point3D, Integer> pp = new HashMap<>();
    ObservableIntegerArray reindex = FXCollections.observableIntegerArray();
    ObservableFloatArray newPoints = FXCollections.observableFloatArray();

    for (MeshView meshView : meshViews) {
      TriangleMesh mesh = (TriangleMesh) meshView.getMesh();
      ObservableFloatArray points = mesh.getPoints();
      int pointElementSize = mesh.getPointElementSize();
      int os = points.size() / pointElementSize;

      pp.clear();
      newPoints.clear();
      newPoints.ensureCapacity(points.size());
      reindex.clear();
      reindex.resize(os);

      for (int i = 0, oi = 0, ni = 0; i < points.size(); i += pointElementSize, oi++) {
        float x = points.get(i);
        float y = points.get(i + 1);
        float z = points.get(i + 2);
        Point3D p = new Point3D(x, y, z);
        Integer index = pp.get(p);
        if (index == null) {
          pp.put(p, ni);
          reindex.set(oi, ni);
          newPoints.addAll(x, y, z);
          ni++;
        } else {
          reindex.set(oi, index);
        }
      }

      int ns = newPoints.size() / pointElementSize;

      int d = os - ns;
      duplicates += d;
      total += os;

      points.setAll(newPoints);
      points.trimToSize();

      ObservableIntegerArray faces = mesh.getFaces();
      for (int i = 0; i < faces.size(); i += 2) {
        faces.set(i, reindex.get(faces.get(i)));
      }

      //            System.out.printf("There are %d (%.2f%%) duplicate points out of %d total for
      // mesh '%s'.\n",
      //                    d, 100d * d / os, os, meshView.getId());

      check += mesh.getPoints().size() / pointElementSize;
    }
    System.out.printf(
        "There are %d (%.2f%%) duplicate points out of %d total.\n",
        duplicates, 100d * duplicates / total, total);
    System.out.printf("Now we have %d points.\n", check);
  }
  @Override
  public void start(Stage stage) throws Exception {
    Parent root = createLayout();
    scene =
        SceneBuilder.create()
            .fill(new Color(0.5, 0.5, 0.5, 1.0))
            .root(root)
            .width(600)
            .height(400)
            .build();
    stage.setScene(scene);
    stage.show();

    // Add values to the spinner controls
    String[] months = new DateFormatSymbols().getMonths();
    ObservableList<String> dayList = FXCollections.observableArrayList();
    ObservableList<String> monthList = FXCollections.observableArrayList(months);
    ObservableList<String> yearList = FXCollections.observableArrayList();
    for (int i = 1; i <= 31; i++) {
      dayList.add(Integer.toString(i));
    }
    for (int i = 1970; i <= 2013; i++) {
      yearList.add(Integer.toString(i));
    }
    spinnerControlDay.setItems(dayList);
    spinnerControlMonth.setItems(monthList);
    spinnerControlYear.setItems(yearList);
  }
  @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);
  }
  /** Contructor of the controller */
  public EnergyOverviewController() {

    dailyIntervalData = FXCollections.observableArrayList();
    dailyWeatherData = FXCollections.observableArrayList();
    intervalDataList = FXCollections.observableArrayList();
    chartNode = new SwingNode();
  }
Example #10
0
/** @author eguchi */
public class KanbanModel {

  private GetIssueService getIssueService = new GetIssueService();
  private ObservableList<Issue> todoIssues = FXCollections.observableArrayList();
  private ObservableList<Issue> inProgressIssues = FXCollections.observableArrayList();
  private ObservableList<Issue> resolvedIssues = FXCollections.observableArrayList();
  private ObservableList<Issue> closedIssues = FXCollections.observableArrayList();

  public KanbanModel() {}

  public ObservableList<Issue> getTodoIssues() {
    return todoIssues;
  }

  public ObservableList<Issue> getInProgressIssues() {
    return inProgressIssues;
  }

  public ObservableList<Issue> getResolvedIssues() {
    return resolvedIssues;
  }

  public ObservableList<Issue> getClosedIssues() {
    return closedIssues;
  }

  public void loadIssue() {

    getIssueService.start();
    getIssueService.setOnSucceeded(
        new EventHandler<WorkerStateEvent>() {
          @Override
          public void handle(WorkerStateEvent workerStateEvent) {

            List<Issue> issues = (List<Issue>) workerStateEvent.getSource().getValue();
            for (Issue issue : issues) {
              Status status = issue.getStatus();

              switch (status.getId()) {
                case 1:
                  todoIssues.add(issue);
                  break;
                case 2:
                  inProgressIssues.add(issue);
                  break;
                case 3:
                  resolvedIssues.add(issue);
                  break;
                case 4:
                  closedIssues.add(issue);
                  break;
                default:
                  throw new IllegalStateException("unknown id : " + issue.getId());
              }
            }
          }
        });
  }
}
  private void initGameLobbyViews() {

    ObservableGameLobbyChat = FXCollections.observableArrayList(this.gameLobbyChat);
    ObservableGameLobbyPlayers = FXCollections.observableArrayList(this.gamePlayers);

    this.lvGameChat.setItems(this.ObservableGameLobbyChat);
    this.lvGamePlayer.setItems(this.ObservableGameLobbyPlayers);
  }
Example #12
0
/** @author Dub-Laptop */
public class MediaLibrary implements Initializable {

  @FXML private TilePane tilePane;

  private String mrl;
  private ObservableList<ImageView> images = FXCollections.observableArrayList();
  private List<File> fileList = new ArrayList<>();
  private Map<String, ImageView> map;
  private List<LibraryEntry> libEntries = FXCollections.observableArrayList();
  static int totalFiles = 0;

  @FXML
  private void handleButtonAction(ActionEvent event) throws IOException {

    // DirectoryChooser dc = new DirectoryChooser();
    // File f = dc.showDialog(null);

    LibraryLoader.generateMissingThumbs();
    try {
      Thread.sleep(500);
    } catch (InterruptedException ex) {
      Logger.getLogger(MediaLibrary.class.getName()).log(Level.SEVERE, null, ex);
    }
    refresh();
  }

  @Override
  public void initialize(URL url, ResourceBundle rb) {
    // TODO

    // tilePane.setPrefColumns(4);
    tilePane.setHgap(5);
    tilePane.setVgap(15);
    tilePane.setPrefTileHeight(85);
    tilePane.setPrefTileWidth(150);
    tilePane.setPadding(new Insets(5, 5, 15, 5));

    map = LibraryLoader.getMappedItems();
    for (String s : map.keySet()) {
      LibraryEntry e = new LibraryEntry(map.get(s), new File(s));
      libEntries.add(e);
    }
    tilePane.getChildren().addAll(libEntries);
  }

  private void refresh() {
    tilePane.getChildren().clear();
    map = LibraryLoader.getMappedItems();
    for (String s : map.keySet()) {
      LibraryEntry e = new LibraryEntry(map.get(s), new File(s));
      tilePane.getChildren().add(e);
    }
  }

  public List<LibraryEntry> getLibEntries() {
    return libEntries;
  }
} // ====================================EOF======================================
  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);
  }
  /** Clear all items in SnapShot plugin. */
  public void clearAllItems() {
    currentTarget.set(FXCollections.emptyObservableList());
    summaryData.set(null);
    currentClassNameSet.set(FXCollections.emptyObservableSet());
    currentObjectTag.set(-1);

    summaryController.clearAllItems();
    histogramController.clearAllItems();
    snapshotController.clearAllItems();
  }
 public void releaseVariables() {
   freqValues = null;
   productTypeValues = null;
   billCategoryValues = null;
   prodSpclPriceValues = null;
   freqValues = FXCollections.observableArrayList();
   productTypeValues = FXCollections.observableArrayList();
   billCategoryValues = FXCollections.observableArrayList();
   prodSpclPriceValues = FXCollections.observableArrayList();
 }
  @Test
  public void ensureSelectionIsCorrectWhenItemsChange() {
    box.setItems(FXCollections.observableArrayList("Item 1"));
    box.getSelectionModel().select(0);
    assertEquals("Item 1", box.getSelectionModel().getSelectedItem());

    box.setItems(FXCollections.observableArrayList("Item 2"));
    assertEquals(-1, box.getSelectionModel().getSelectedIndex());
    assertEquals(null, box.getSelectionModel().getSelectedItem());
  }
  @FXML
  private void initViews() {
    ObservableUsers = FXCollections.observableArrayList(this.userList);
    ObservableGames = FXCollections.observableArrayList(this.gameList);
    ObservableLobbyChat = FXCollections.observableArrayList(this.lobbyChat);

    this.lvLobbyUsers.setItems(this.ObservableUsers);
    this.lvLobbyGames.setItems(this.ObservableGames);
    this.lvLobbyChat.setItems(this.ObservableLobbyChat);
  }
Example #18
0
 public Project() { // NO_UCD (unused code)
   super();
   expressions = new ArrayList<Expression>();
   triggers = new ArrayList<Trigger>();
   variables = FXCollections.observableList(new ArrayList<UserVariable>());
   surveys = FXCollections.observableList(new ArrayList<Survey>());
   uielements = FXCollections.observableList(new ArrayList<UIElement>());
   this.name = "My project";
   this.description = "A brand spanking new project";
 }
  @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());
    }
  }
Example #20
0
 public Task() {
   shortName = new SimpleStringProperty("");
   description = new SimpleStringProperty("");
   estimate = new SimpleFloatProperty(0.0f);
   status = new SimpleObjectProperty<>(Status.NOT_STARTED);
   story = new SimpleObjectProperty<>(null);
   blocked = new SimpleBooleanProperty(false);
   impediments = FXCollections.observableArrayList(Impediment.getWatchStrategy());
   loggedEffort = FXCollections.observableArrayList(Effort.getWatchStrategy());
   assignees = FXCollections.observableArrayList(Person.getWatchStrategy());
 }
 private void updateScores() {
   switch (selectedGame) {
     case "wordex":
       game = "ΛΕΞΟΜΑΝΤΕΙΑ";
       break;
     case "wordsearch":
       game = "ΚΡΥΠΤΟΛΕΞΟ";
       break;
     case "splitwords":
       game = "ΑΝΤΙΣΤΟΙΧΙΣΗ";
       break;
     case "wordsFromALetter":
       game = "ΛΕΞΕΙΣ ΑΠΟ ΓΡΑΜΜΑ";
       break;
     case "correctSpelling":
       game = "ΣΩΣΤΗ ΟΡΘΟΓΡΑΦΙΑ";
       break;
     case "correctSpelling2":
       game = "ΣΩΣΤΗ ΟΡΘΟΓΡΑΦΙΑ 2";
       break;
     case "namesAnimalsPlants":
       game = "ΟΝΟΜΑTA, ΖΩΑ, ΦΥΤΑ";
       break;
     case "coloredBoxes":
       game = "ΧΡΩΜΑΤΙΣΤΑ ΚΟΥΤΙΑ";
       break;
     case "matchCards":
       game = "ΤΑΙΡΙΑΞΕ ΚΑΡΤΕΣ";
       break;
     case "faceNameHouse":
       game = "Face Name House";
       break;
   }
   try {
     gameScores = db.getScores(game);
     gScoresContents = FXCollections.observableArrayList();
     Collections.sort(gameScores, Collections.reverseOrder());
     for (int i = 0; i < Math.min(gameScores.size(), 5); i++) {
       gScoresContents.add(gameScores.get(i));
     }
     gScores.setItems(gScoresContents);
     personalScores = db.getScores(player, game);
     pScoresContents = FXCollections.observableArrayList();
     Collections.sort(personalScores, Collections.reverseOrder());
     for (int i = 0; i < Math.min(personalScores.size(), 5); i++) {
       pScoresContents.add(personalScores.get(i));
     }
     pScores.setItems(pScoresContents);
   } catch (SQLException ex) {
     // TODO handle score exceptions
   }
 }
  @Override
  @SuppressWarnings("unchecked")
  public void getSettings(final Map<NewFileWizard.Settings, Object> map) {
    fileNameField.setText((String) map.get(NewFileWizard.Settings.DATABASE_NAME));
    defaultCurrencyField.setText(map.get(NewFileWizard.Settings.DEFAULT_CURRENCY).toString());

    final ObservableList<CurrencyNode> currencyNodes = FXCollections.observableArrayList();
    currencyNodes.addAll(
        (Collection<? extends CurrencyNode>) map.get(NewFileWizard.Settings.CURRENCIES));
    currencyNodes.add((CurrencyNode) map.get(NewFileWizard.Settings.DEFAULT_CURRENCY));
    FXCollections.sort(currencyNodes);

    currenciesList.getItems().setAll(currencyNodes);
  }
  @Inject
  public FileDetailsCtrl(FileNavigationState navState) {
    this.navState = navState;
    this.navState.selectedFileProperty().addListener(new SelectedFileListener());

    listFiles = FXCollections.observableList(new ArrayList<>());
    fileDetails = FXCollections.observableList(new ArrayList<>());

    fileGrid.setCellHeight(80);
    fileGrid.setCellWidth(100);

    fileGrid.getItems().addAll(listFiles);
    fileDetailsList.getItems().addAll(fileDetails);
  }
  private void initComboboxes() {
    // todo opgave 3

    personen = FXCollections.observableArrayList(this.getAdministratie().getPersonen());
    gezinnen = FXCollections.observableArrayList(this.getAdministratie().getGezinnen());

    this.cbGezinnen.setItems(this.getGezinnen());
    this.cbPersonen.setItems(this.getPersonen());
    this.cbOuderlijkGezinInvoer.setItems(this.getGezinnen());
    this.cbOuderlijkGezin.setItems(this.getGezinnen());
    this.cbOuder1Invoer.setItems(this.getPersonen());
    this.cbOuder2Invoer.setItems(this.getPersonen());
    this.cbGeslachtInvoer.setItems(FXCollections.observableArrayList(Geslacht.values()));
  }
Example #25
0
public class SimpleLineIndicator implements LineIndicator {

  private ObservableList<State> states = FXCollections.observableArrayList();
  private ObservableList<Integer> breakpoints = FXCollections.observableArrayList();

  @Override
  public ObservableList<State> statesProperty() {
    return states;
  }

  @Override
  public ObservableList<Integer> breakpointsProperty() {
    return breakpoints;
  }
}
Example #26
0
 /**
  * Creates a grid with a fixed number of rows and columns.
  *
  * @param rowCount
  * @param columnCount
  */
 public GridBase(int rowCount, int columnCount) {
   this.rowCount = rowCount;
   this.columnCount = columnCount;
   rowsHeader = FXCollections.observableArrayList();
   columnsHeader = FXCollections.observableArrayList();
   locked = new SimpleBooleanProperty(false);
   rowHeightFactory = new MapBasedRowHeightFactory(new HashMap<>());
   rows = FXCollections.observableArrayList();
   rows.addListener(
       (Observable observable) -> {
         setRowCount(rows.size());
       });
   resizableRow = new BitSet(rowCount);
   resizableRow.set(0, rowCount, true);
 }
  public Inventory(
      ObservableList<Weapon> weapons,
      ObservableList<Armor> armor,
      ObservableList<Goods> goods,
      double money) {
    super();
    this.armor = armor;
    this.weapons = weapons;
    this.goods = goods;
    this.characterGold = money;

    consumables = FXCollections.observableArrayList();
    armorWorn = FXCollections.observableArrayList();
    weaponEquipped = FXCollections.observableArrayList();
  }
Example #28
0
  private ObservableList getYesNo() {
    ObservableList<String> YesNoList = FXCollections.observableArrayList();
    YesNoList.add("Yes");
    YesNoList.add("No");

    return YesNoList;
  }
Example #29
0
  private ObservableList getGender() {
    ObservableList<String> maritalStatus = FXCollections.observableArrayList();
    maritalStatus.add("Male");
    maritalStatus.add("Female");

    return maritalStatus;
  }
  public FileInfoTablePanel() {
    tableItems = FXCollections.observableArrayList();

    tableView = new TableView<>(tableItems);

    final TableColumn<FileInfoPath, String> col0 = new TableColumn<>("Name");
    col0.setCellValueFactory(
        p -> new ReadOnlyObjectWrapper<>(p.getValue().getFileInfo().getFilename()));
    col0.prefWidthProperty().bind(tableView.widthProperty().multiply(0.3));
    tableView.getColumns().add(col0);

    final TableColumn<FileInfoPath, String> col1 = new TableColumn<>("Path");
    col1.setCellValueFactory(p -> new ReadOnlyObjectWrapper<>(p.getValue().getPath()));
    col1.prefWidthProperty().bind(tableView.widthProperty().multiply(0.6));
    tableView.getColumns().add(col1);

    final TableColumn<FileInfoPath, String> col2 = new TableColumn<>("Size");
    col2.setCellValueFactory(
        p ->
            new ReadOnlyObjectWrapper<>(
                BackupUtil.humanReadableByteCount(p.getValue().getFileInfo().getSize())));
    col2.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
    tableView.getColumns().add(col2);

    final TableColumn<FileInfoPath, String> col3 = new TableColumn<>("Alg");
    col3.setCellValueFactory(
        p -> new ReadOnlyObjectWrapper<>(p.getValue().getFileInfo().getDigestAlg().name()));
    col3.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
    tableView.getColumns().add(col3);

    final TableColumn<FileInfoPath, String> col4 = new TableColumn<>("Digest");
    col4.setCellValueFactory(
        p -> new ReadOnlyObjectWrapper<>(p.getValue().getFileInfo().getDigest()));
    col4.prefWidthProperty().bind(tableView.widthProperty().multiply(0.2));
    tableView.getColumns().add(col4);

    final TableColumn<FileInfoPath, String> col5 = new TableColumn<>("Timestamp");
    col5.setCellValueFactory(
        p -> new ReadOnlyObjectWrapper<>(p.getValue().getFileInfo().getLastModifiedStr()));
    col5.prefWidthProperty().bind(tableView.widthProperty().multiply(0.2));
    tableView.getColumns().add(col5);

    final TableColumn<FileInfoPath, Integer> col6 = new TableColumn<>("Path Len");
    col6.setCellValueFactory(p -> new ReadOnlyObjectWrapper<>(p.getValue().getPath().length()));
    col6.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
    tableView.getColumns().add(col6);

    tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    // pathList.setVisibleRowCount(4);
    tableView.setPrefHeight(100);

    label = new Label();

    final ScrollPane scrollPane = GuiUtils.createScrollPane(tableView);

    setCenter(scrollPane);
    setBottom(label);

    setFileInfo(null, null);
  }