javafx.scene.control.cell.PropertyValueFactory Java Examples

The following examples show how to use javafx.scene.control.cell.PropertyValueFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TableSample.java    From marathonv5 with Apache License 2.0 7 votes vote down vote up
public TableSample() {
    final ObservableList<Person> data = FXCollections.observableArrayList(
        new Person("Jacob",     "Smith",    "[email protected]" ),
        new Person("Isabella",  "Johnson",  "[email protected]" ),
        new Person("Ethan",     "Williams", "[email protected]" ),
        new Person("Emma",      "Jones",    "[email protected]" ),
        new Person("Michael",   "Brown",    "[email protected]" )
    );
    TableColumn firstNameCol = new TableColumn();
    firstNameCol.setText("First");
    firstNameCol.setCellValueFactory(new PropertyValueFactory("firstName"));
    TableColumn lastNameCol = new TableColumn();
    lastNameCol.setText("Last");
    lastNameCol.setCellValueFactory(new PropertyValueFactory("lastName"));
    TableColumn emailCol = new TableColumn();
    emailCol.setText("Email");
    emailCol.setMinWidth(200);
    emailCol.setCellValueFactory(new PropertyValueFactory("email"));
    TableView tableView = new TableView();
    tableView.setItems(data);
    tableView.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
    getChildren().add(tableView);
}
 
Example #2
Source File: ChannelTableController.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@FXML
public void initialize() {

    tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    tableView.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
        if (newSelection != null) {
            SelectionService.getInstance().setSelection(tableView, tableView.getSelectionModel().getSelectedItems());
        }
    });

    tableView.getColumns().clear();
    TableColumn<Channel, String> nameCol = new TableColumn<>("Name");
    nameCol.setCellValueFactory(new PropertyValueFactory<Channel, String>("name"));

    TableColumn<Channel, String> ownerCol = new TableColumn<>("Owner");
    ownerCol.setCellValueFactory(new PropertyValueFactory<Channel, String>("owner"));
    tableView.getColumns().addAll(nameCol, ownerCol);
}
 
Example #3
Source File: RGBColorSpacesController.java    From MyBox with Apache License 2.0 6 votes vote down vote up
private void initPrimaries() {
    csColumn.setCellValueFactory(new PropertyValueFactory<>("colorSpaceName"));
    whiteColumn.setCellValueFactory(new PropertyValueFactory<>("illuminantName"));
    algorithmColumn.setCellValueFactory(new PropertyValueFactory<>("adaptAlgorithm"));
    colorColumn.setCellValueFactory(new PropertyValueFactory<>("colorName"));
    txcsColumn.setCellValueFactory(new PropertyValueFactory<>("X"));
    tycsColumn.setCellValueFactory(new PropertyValueFactory<>("Y"));
    tzcsColumn.setCellValueFactory(new PropertyValueFactory<>("Z"));
    nxcsColumn.setCellValueFactory(new PropertyValueFactory<>("normalizedX"));
    nycsColumn.setCellValueFactory(new PropertyValueFactory<>("normalizedY"));
    nzcsColumn.setCellValueFactory(new PropertyValueFactory<>("normalizedZ"));
    rxcsColumn.setCellValueFactory(new PropertyValueFactory<>("relativeX"));
    rycsColumn.setCellValueFactory(new PropertyValueFactory<>("relativeY"));
    rzcsColumn.setCellValueFactory(new PropertyValueFactory<>("relativeZ"));

}
 
Example #4
Source File: ServiceMatchingViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is found luggage table overview initialized with the right values
 * 
 * @void - No direct output 
 */
@Override
public void initializeFoundLuggageTable(){
    foundRegistrationNr.setCellValueFactory(       new PropertyValueFactory<>("registrationNr"));
    foundDateFound.setCellValueFactory(            new PropertyValueFactory<>("dateFound"));
    foundTimeFound.setCellValueFactory(            new PropertyValueFactory<>("timeFound"));
    
    foundLuggageTag.setCellValueFactory(           new PropertyValueFactory<>("luggageTag"));
    foundLuggageType.setCellValueFactory(          new PropertyValueFactory<>("luggageType"));
    foundBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    foundMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    foundSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor")); 
    foundSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    foundWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));

    foundPassengerId.setCellValueFactory(          new PropertyValueFactory<>("passengerId"));
    
    foundArrivedWithFlight.setCellValueFactory(    new PropertyValueFactory<>("arrivedWithFlight"));
    foundLocationFound.setCellValueFactory(        new PropertyValueFactory<>("locationFound"));
    
    //set place holder text when there are no results
    foundLuggageTable.setPlaceholder(new Label("No found luggage's to display"));
}
 
Example #5
Source File: ServiceMatchingViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is lost luggage table overview initialized with the right values
 * 
 * @void - No direct output 
 */
@Override
public void initializeLostLuggageTable(){
    lostRegistrationNr.setCellValueFactory(      new PropertyValueFactory<>("registrationNr"));
    DateLost.setCellValueFactory(            new PropertyValueFactory<>("dateLost"));  //-> lost
    TimeLost.setCellValueFactory(            new PropertyValueFactory<>("timeLost"));
    
    lostLuggageTag.setCellValueFactory(           new PropertyValueFactory<>("luggageTag"));
    lostLuggageType.setCellValueFactory(          new PropertyValueFactory<>("luggageType"));
    lostBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    lostMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    lostSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor"));
    lostSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    lostWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));

    lostPassengerId.setCellValueFactory(          new PropertyValueFactory<>("passengerId"));
    
    lostFlight.setCellValueFactory(               new PropertyValueFactory<>("flight"));
    
    //set place holder text when there are no results
    lostLuggageTable.setPlaceholder(new Label("No lost luggage's to display"));
}
 
Example #6
Source File: TakeOrderController.java    From Online-Food-Ordering-System with MIT License 6 votes vote down vote up
@Override
public void initialize(URL url, ResourceBundle rb) {
    if(takeOrderModel.isDbConnected()){
         System.out.println("Db connected");
    }else{
         System.out.println("Db not connected");
    }
    
   
    
  
    ordernoCol.setCellValueFactory(new PropertyValueFactory<>("orderid"));
    custCol.setCellValueFactory(new PropertyValueFactory<>("custid"));
    menuCol.setCellValueFactory(new PropertyValueFactory<>("menuname"));
     QuantityCol.setCellValueFactory(new PropertyValueFactory<>("qnt"));
    deliveryCol.setCellValueFactory(new PropertyValueFactory<>("deliverytyp"));
    addressCol.setCellValueFactory(new PropertyValueFactory<>("address"));
   
    tableConnection();
    table.setItems(obList);
    table.refresh();
    table.getSelectionModel().clearSelection();
   
    
}
 
Example #7
Source File: ServiceMatchingViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is potential matching table overview initialized with the right values
 * 
 * @void - No direct output 
 */
public void initializePotentialLuggageTable(){
    potentialIdLost.setCellValueFactory(               new PropertyValueFactory<>("registrationNrLost"));
    potentialIdFound.setCellValueFactory(              new PropertyValueFactory<>("registrationNrFound"));
    potentialTag.setCellValueFactory(                  new PropertyValueFactory<>("luggageTag"));
    
    potentialPercentage.setCellValueFactory(           new PropertyValueFactory<>("matchPercentage"));
    potentialType.setCellValueFactory(                 new PropertyValueFactory<>("luggageType"));
    potentialBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    potentialMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    potentialSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor"));
    potentialSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    potentialWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));
    
    //set place holder text when there are no results
    potentialMatchingTable.setPlaceholder(new Label("No potential matches found"));
}
 
Example #8
Source File: ServiceOverviewLostViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is lost luggage table overview initialized with the right values
 * 
 * @void - No direct output 
 */
@Override
public void initializeLostLuggageTable(){
    lostRegistrationNr.setCellValueFactory(       new PropertyValueFactory<>("registrationNr"));
    DateLost.setCellValueFactory(            new PropertyValueFactory<>("dateLost"));
    TimeLost.setCellValueFactory(            new PropertyValueFactory<>("timeLost"));
    
    lostLuggageTag.setCellValueFactory(           new PropertyValueFactory<>("luggageTag"));
    lostLuggageType.setCellValueFactory(          new PropertyValueFactory<>("luggageType"));
    lostBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    lostMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    lostSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor"));
    lostSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    lostWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));

    lostOtherCharacteristics.setCellValueFactory( new PropertyValueFactory<>("otherCharacteristics"));
    lostPassengerId.setCellValueFactory(          new PropertyValueFactory<>("passengerId"));
    
    lostFlight.setCellValueFactory(               new PropertyValueFactory<>("flight"));
    lostMatchedId.setCellValueFactory(            new PropertyValueFactory<>("matchedId"));
     
    //set place holder text when there are no results
    lostLuggageTable.setPlaceholder(new Label("No lost luggage's to display"));
}
 
Example #9
Source File: ManagerLostViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * @author Thijs Zijdel - 500782165
 * 
 * Here is lost luggage table overview initialized with the right values
 * 
 * @void - No direct output 
 */
@Override
public void initializeLostLuggageTable(){
    managerLostRegistrationNr.setCellValueFactory(      new PropertyValueFactory<>("registrationNr"));
    managerLostDateLost.setCellValueFactory(            new PropertyValueFactory<>("dateLost"));
    managerLostTimeLost.setCellValueFactory(            new PropertyValueFactory<>("timeLost"));
    
    managerLostLuggageTag.setCellValueFactory(          new PropertyValueFactory<>("luggageTag"));
    managerLostLuggageType.setCellValueFactory(         new PropertyValueFactory<>("luggageType"));
    managerLostBrand.setCellValueFactory(               new PropertyValueFactory<>("brand"));
    managerLostMainColor.setCellValueFactory(           new PropertyValueFactory<>("mainColor"));
    managerLostSecondColor.setCellValueFactory(         new PropertyValueFactory<>("secondColor"));
    managerLostSize.setCellValueFactory(                new PropertyValueFactory<>("size"));
    managerLostWeight.setCellValueFactory(              new PropertyValueFactory<>("weight"));

    managerLostOtherCharacteristics.setCellValueFactory(new PropertyValueFactory<>("otherCharacteristics"));
    managerLostPassengerId.setCellValueFactory(         new PropertyValueFactory<>("passengerId"));
    
    managerLostFlight.setCellValueFactory(              new PropertyValueFactory<>("flight"));
    
    managerLostEmployeeId.setCellValueFactory(          new PropertyValueFactory<>("employeeId"));
    managerLostMatchedId.setCellValueFactory(           new PropertyValueFactory<>("matchedId"));
     
    //set place holder text when there are no results
    lostTable.setPlaceholder(new Label("No lost luggage's to display"));
}
 
Example #10
Source File: ServiceOverviewFoundViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is found luggage table overview initialized with the right values
 * 
 * @void - No direct output 
 */
@Override
public void initializeFoundLuggageTable() {
    foundRegistrationNr.setCellValueFactory(       new PropertyValueFactory<>("registrationNr"));
    foundDateFound.setCellValueFactory(            new PropertyValueFactory<>("dateFound"));
    foundTimeFound.setCellValueFactory(            new PropertyValueFactory<>("timeFound"));
    
    foundLuggageTag.setCellValueFactory(           new PropertyValueFactory<>("luggageTag"));
    foundLuggageType.setCellValueFactory(          new PropertyValueFactory<>("luggageType"));
    foundBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    foundMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    foundSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor"));
    foundSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    foundWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));

    foundOtherCharacteristics.setCellValueFactory( new PropertyValueFactory<>("otherCharacteristics"));
    foundPassengerId.setCellValueFactory(          new PropertyValueFactory<>("passengerId"));
    
    foundArrivedWithFlight.setCellValueFactory(    new PropertyValueFactory<>("arrivedWithFlight"));
    foundLocationFound.setCellValueFactory(        new PropertyValueFactory<>("locationFound"));
    foundMatchedId.setCellValueFactory(            new PropertyValueFactory<>("matchedId"));

    //set place holder text when there are no results
    foundLuggageTable.setPlaceholder(new Label("No found luggage's to display"));
}
 
Example #11
Source File: ServiceMatchingViewController.java    From Corendon-LostLuggage with MIT License 6 votes vote down vote up
/**  
 * Here is automatic matching table overview initialized with the right values
 * Also the matching tabs will be set on the right tab
 * 
 * @void - No direct output 
 */
public void initializeMatchingLuggageTable(){
    matchIdLost.setCellValueFactory(               new PropertyValueFactory<>("registrationNrLost"));
    matchIdFound.setCellValueFactory(              new PropertyValueFactory<>("registrationNrFound"));
    matchTag.setCellValueFactory(                  new PropertyValueFactory<>("luggageTag"));
    
    matchPercentage.setCellValueFactory(           new PropertyValueFactory<>("matchPercentage"));
    matchType.setCellValueFactory(                 new PropertyValueFactory<>("luggageType"));
    matchBrand.setCellValueFactory(                new PropertyValueFactory<>("brand"));
    matchMainColor.setCellValueFactory(            new PropertyValueFactory<>("mainColor"));
    matchSecondColor.setCellValueFactory(          new PropertyValueFactory<>("secondColor"));
    matchSize.setCellValueFactory(                 new PropertyValueFactory<>("size"));
    matchWeight.setCellValueFactory(               new PropertyValueFactory<>("weight"));

    matchId.setCellValueFactory(                   new PropertyValueFactory<>("matchedId"));
    
    //set place holder text when there are no results
    matchTabbleView.setPlaceholder(new Label("No automatic matches found"));
    
    //sort on match percentage
    matchTabbleView.getSortOrder().add(matchPercentage);
    
    //set right matching 
    setMatchingTab(0);
}
 
Example #12
Source File: MediaTableController.java    From MyBox with Apache License 2.0 6 votes vote down vote up
@Override
protected void initColumns() {
    try {
        super.initColumns();
        if (addressColumn != null) {
            addressColumn.setCellValueFactory(new PropertyValueFactory<>("address"));
        }
        if (durationColumn != null) {
            durationColumn.setCellValueFactory(new PropertyValueFactory<>("duration"));
            durationColumn.setCellFactory(new TableDurationCell());
        }
        if (resolutionColumn != null) {
            resolutionColumn.setCellValueFactory(new PropertyValueFactory<>("resolution"));
        }
        if (audioColumn != null) {
            audioColumn.setCellValueFactory(new PropertyValueFactory<>("audioEncoding"));
        }
        if (videoColumn != null) {
            videoColumn.setCellValueFactory(new PropertyValueFactory<>("videoEncoding"));
        }

    } catch (Exception e) {
        logger.error(e.toString());
    }
}
 
Example #13
Source File: IccProfileEditorController.java    From MyBox with Apache License 2.0 6 votes vote down vote up
protected void initTagsTable() {
    tagColumn.setCellValueFactory(new PropertyValueFactory<>("tag"));
    nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
    typeColumn.setCellValueFactory(new PropertyValueFactory<>("type"));
    offsetColumn.setCellValueFactory(new PropertyValueFactory<>("offset"));
    sizeColumn.setCellValueFactory(new PropertyValueFactory<>("size"));

    tagsTableView.setItems(tagsTable);
    tagsTableView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
        @Override
        public void changed(ObservableValue ov, Object t, Object t1) {
            IccTag selected = tagsTableView.getSelectionModel().getSelectedItem();
            displayTagData(selected);
        }
    });
}
 
Example #14
Source File: DownloadController.java    From Animu-Downloaderu with MIT License 6 votes vote down vote up
@FXML private void initialize() {
	DownloadManager manager = DownloadManager.getInstance();
	tableView.setRowFactory(new TableSelectListener());
	fileName.setCellValueFactory(new PropertyValueFactory<DownloadInfo, String>("fileName"));
	size.setCellValueFactory(new PropertyValueFactory<DownloadInfo, Double>("size"));
	downloaded.setCellValueFactory(new PropertyValueFactory<DownloadInfo, Double>("downloaded"));
	progress.setCellValueFactory(new PropertyValueFactory<DownloadInfo, String>("progress"));
	status.setCellValueFactory(new PropertyValueFactory<DownloadInfo, Status>("status"));

	clearAll.setOnAction(e -> {
		tableView.getItems().removeIf(d -> {
			boolean remove = d.getStatus() == Status.FINISHED || d.getStatus() == Status.CANCELLED;
			if (remove) {
				manager.remove(d);
			}
			return remove;
		});
		tableView.refresh();
	});
	pauseAll.setOnAction(e -> manager.pauseAll());
	resumeAll.setOnAction(e -> manager.resumeAll());
	cancelAll.setOnAction(e -> manager.cancelAll());
	retryAll.setOnAction(e -> manager.retryAll());
	restartAll.setOnAction(e -> manager.restartAll());
}
 
Example #15
Source File: RamView.java    From ARMStrong with Mozilla Public License 2.0 6 votes vote down vote up
/**
 * refresh the ram values displayed
 */
public void refresh() {
	for (int i = this.tableView.getColumns().size()+1; i> UneSuperImplemFournieParValentinLeBg.getColumns()+2; i--) {
     this.tableView.getColumns().remove(i-2);
    }
	
    for (int i = this.tableView.getColumns().size(); i <= UneSuperImplemFournieParValentinLeBg.getColumns(); i++) {
     TableColumn<NewLineRam,String> a = new TableColumn<>();
     a.setCellFactory(TextFieldTableCellFixed.forTableColumn());
     a.setCellValueFactory(
             new PropertyValueFactory<>(Character.toString('a'+i-1)));
     a.setMaxWidth( 1f * Integer.MAX_VALUE * 11 );
     this.tableView.getColumns().add(a);

        a.setOnEditCommit(t -> UneSuperImplemFournieParValentinLeBg.setValue(t.getTablePosition().getColumn(), t.getTablePosition().getRow(), t.getNewValue()));

    }
	
	this.tableView.refresh();
}
 
Example #16
Source File: BrowserTab.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
public PreferenceTableView() {
    getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    setPrefHeight(100);
    setEditable(false);
    TableColumn<BrowserPreference, String> colName = new TableColumn<>("Name");
    colName.setCellValueFactory(new PropertyValueFactory<>("name"));
    colName.prefWidthProperty().bind(widthProperty().multiply(0.5));
    TableColumn<BrowserPreference, String> colType = new TableColumn<>("Type");
    colType.setCellValueFactory(new PropertyValueFactory<>("type"));
    colType.prefWidthProperty().bind(widthProperty().multiply(0.20));
    TableColumn<BrowserPreference, String> colValue = new TableColumn<>("Value");
    colValue.setCellValueFactory(new PropertyValueFactory<>("value"));
    colValue.prefWidthProperty().bind(widthProperty().multiply(0.25));
    getColumns().add(colName);
    getColumns().add(colType);
    getColumns().add(colValue);
}
 
Example #17
Source File: TableScrollSample.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
public TableScrollSample() {
    final ObservableList<Person> data = FXCollections.observableArrayList(
            new Person("Jacob", "Smith", "[email protected]"),
            new Person("Isabella", "Johnson", "[email protected]"),
            new Person("Ethan", "Williams", "[email protected]"),
            new Person("Emma", "Jones", "[email protected]"), new Person("Michael", "Brown", "[email protected]"));
    TableColumn firstNameCol = new TableColumn();
    firstNameCol.setText("First");
    firstNameCol.setCellValueFactory(new PropertyValueFactory("firstName"));
    TableColumn lastNameCol = new TableColumn();
    lastNameCol.setText("Last");
    lastNameCol.setCellValueFactory(new PropertyValueFactory("lastName"));
    TableColumn emailCol = new TableColumn();
    emailCol.setText("Email");
    emailCol.setMinWidth(200);
    emailCol.setCellValueFactory(new PropertyValueFactory("email"));
    TableView tableView = new TableView();
    tableView.setItems(data);
    ObservableList items = tableView.getItems();
    for (int i = 0; i < 10; i++)
        items.add(new Person("Name" + i, "Last" + i, "Email " + i));
    tableView.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
    getChildren().add(tableView);
}
 
Example #18
Source File: PersonQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    System.out.println("adasdasdas");
    customers= FXCollections.observableArrayList();
    
    Address address = new Address("32321", 0, "dsdas", "dsda", "dsadsa");
    ArrayList<String> telephones = new ArrayList<>();
    telephones.add("dsada");
    LegalPerson lp= new LegalPerson("32312312","batata",address,telephones,"312321");
    customers.add(lp);
    JuridicalPerson jp = new JuridicalPerson("batata2", address, telephones, "9031231212");
    customers.add(jp);
    
    Id.setCellValueFactory(new PropertyValueFactory<>("Id"));
    Name.setCellValueFactory(new PropertyValueFactory<>("name"));
    PersonTable.setItems(customers);
}
 
Example #19
Source File: StockQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    products=FXCollections.observableArrayList();
    
    ArrayList<Brand> brands = new ArrayList<>();
    brands.add(new Brand(1,"Nvidia"));
    brands.add(new Brand(2,"Asus"));
    ArrayList<Brand> brands2 = new ArrayList<>();
    brands2.add(new Brand(2,"Asus"));
    
    Product p1= new Product("111",brands, 3, "Placa de video");
    products.add(p1);
    Product p2= new Product("222", brands2, 100, "Placa mãe");
    products.add(p2);
    
    Name.setCellValueFactory(new PropertyValueFactory<>("name"));
    Brand.setCellValueFactory(new PropertyValueFactory<>("brand"));
    Quantity.setCellValueFactory(new PropertyValueFactory<>("quantityInStock"));
    BarCode.setCellValueFactory(new PropertyValueFactory<>("barCode"));
    StockTable.setItems(products);
}
 
Example #20
Source File: GenericTransactionQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    movs= FXCollections.observableArrayList();
    ArrayList<Brand> brands = new ArrayList<>();
    brands.add(new Brand(1,"Nvidia"));
    ArrayList<Brand> brands2 = new ArrayList<>();
    brands2.add(new Brand(2,"Asus"));
    
    Product p1= new Product("111",brands , 3, "Placa de video");
    Product p2= new Product("222", brands2, 100, "Placa mãe");
    Movimentation m = new Movimentation(p1,"Compra",3,10);
    movs.add(m);
    
    Movimentation m2= new Movimentation(p2, "Venda", 5, 12);
    movs.add(m2);
    
    Code.setCellValueFactory(new PropertyValueFactory<>("id"));
    Description.setCellValueFactory(new PropertyValueFactory<>("Product"));
    Price.setCellValueFactory(new PropertyValueFactory<>("price"));
    MovimentationTable.setItems(movs);
}
 
Example #21
Source File: ServiceQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    services=FXCollections.observableArrayList();
    //Dummies
    Service s1 = new Service("Limpeza de CPU",120);
    s1.setCodServ(1);
    services.add(s1);
    
    Service s2= new Service("Troca de Peças", 200);
    s2.setCodServ(666);
    services.add(s2);
    
    Service s3 = new Service("Formatação", 80);
    s3.setCodServ(24);
    services.add(s3);
    //Dummies end
    Code.setCellValueFactory(new PropertyValueFactory<>("codServ"));
    Description.setCellValueFactory(new PropertyValueFactory<>("name"));
    Price.setCellValueFactory(new PropertyValueFactory<>("price"));
    ServiceTable.setItems(services);
}
 
Example #22
Source File: SupplierRegisterController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    brands= FXCollections.observableArrayList();
    brands.add(new Brand(1,"Nvidia"));
    brands.add(new Brand(2,"AMD"));
    brands.add(new Brand(3,"Intel"));
    brands.add(new Brand(4,"Corsair"));
    brands.add(new Brand(5,"XFX"));
    
    Brands.setCellValueFactory(new PropertyValueFactory<>("name"));
    brandTable.setItems(brands);
    ObservableList<String> cities = FXCollections.observableArrayList();
    ObservableList<String> states= FXCollections.observableArrayList();
    
    cities.add("Cornélio Procópio");
    cities.add("Londrina");
    cities.add("São Paulo");
    
    states.add("Paraná");
    states.add("São Paulo");
    
    City.setItems(cities);
    State.setItems(states);
}
 
Example #23
Source File: PersonQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    System.out.println("adasdasdas");
    customers= FXCollections.observableArrayList();
    
    Address address = new Address("32321", 0, "dsdas", "dsda", "dsadsa");
    ArrayList<String> telephones = new ArrayList<>();
    telephones.add("dsada");
    LegalPerson lp= new LegalPerson("32312312","batata",address,telephones,"312321");
    customers.add(lp);
    JuridicalPerson jp = new JuridicalPerson("batata2", address, telephones, "9031231212");
    customers.add(jp);
    
    Id.setCellValueFactory(new PropertyValueFactory<>("Id"));
    Name.setCellValueFactory(new PropertyValueFactory<>("name"));
    PersonTable.setItems(customers);
}
 
Example #24
Source File: StockQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    products=FXCollections.observableArrayList();
    
    ArrayList<Brand> brands = new ArrayList<>();
    brands.add(new Brand(1,"Nvidia"));
    brands.add(new Brand(2,"Asus"));
    ArrayList<Brand> brands2 = new ArrayList<>();
    brands2.add(new Brand(2,"Asus"));
    
    Product p1= new Product("111",brands, 3, "Placa de video");
    products.add(p1);
    Product p2= new Product("222", brands2, 100, "Placa mãe");
    products.add(p2);
    
    Name.setCellValueFactory(new PropertyValueFactory<>("name"));
    Brand.setCellValueFactory(new PropertyValueFactory<>("brand"));
    Quantity.setCellValueFactory(new PropertyValueFactory<>("quantityInStock"));
    BarCode.setCellValueFactory(new PropertyValueFactory<>("barCode"));
    StockTable.setItems(products);
}
 
Example #25
Source File: GenericTransactionQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    movs= FXCollections.observableArrayList();
    ArrayList<Brand> brands = new ArrayList<>();
    brands.add(new Brand(1,"Nvidia"));
    ArrayList<Brand> brands2 = new ArrayList<>();
    brands2.add(new Brand(2,"Asus"));
    
    Product p1= new Product("111",brands , 3, "Placa de video");
    Product p2= new Product("222", brands2, 100, "Placa mãe");
    Movimentation m = new Movimentation(p1,"Compra",3,10);
    movs.add(m);
    
    Movimentation m2= new Movimentation(p2, "Venda", 5, 12);
    movs.add(m2);
    
    Code.setCellValueFactory(new PropertyValueFactory<>("id"));
    Description.setCellValueFactory(new PropertyValueFactory<>("Product"));
    Price.setCellValueFactory(new PropertyValueFactory<>("price"));
    MovimentationTable.setItems(movs);
}
 
Example #26
Source File: ServiceQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    services=FXCollections.observableArrayList();
    //Dummies
    Service s1 = new Service("Limpeza de CPU",120);
    s1.setCodServ(1);
    services.add(s1);
    
    Service s2= new Service("Troca de Peças", 200);
    s2.setCodServ(666);
    services.add(s2);
    
    Service s3 = new Service("Formatação", 80);
    s3.setCodServ(24);
    services.add(s3);
    //Dummies end
    Code.setCellValueFactory(new PropertyValueFactory<>("codServ"));
    Description.setCellValueFactory(new PropertyValueFactory<>("name"));
    Price.setCellValueFactory(new PropertyValueFactory<>("price"));
    ServiceTable.setItems(services);
}
 
Example #27
Source File: SupplierRegisterController.java    From dctb-utfpr-2018-1 with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
    brands= FXCollections.observableArrayList();
    brands.add(new Brand(1,"Nvidia"));
    brands.add(new Brand(2,"AMD"));
    brands.add(new Brand(3,"Intel"));
    brands.add(new Brand(4,"Corsair"));
    brands.add(new Brand(5,"XFX"));
    
    Brands.setCellValueFactory(new PropertyValueFactory<>("name"));
    brandTable.setItems(brands);
    ObservableList<String> cities = FXCollections.observableArrayList();
    ObservableList<String> states= FXCollections.observableArrayList();
    
    cities.add("Cornélio Procópio");
    cities.add("Londrina");
    cities.add("São Paulo");
    
    states.add("Paraná");
    states.add("São Paulo");
    
    City.setItems(cities);
    State.setItems(states);
}
 
Example #28
Source File: ClusteringReportWindow.java    From mzmine3 with GNU General Public License v2.0 6 votes vote down vote up
public ClusteringReportWindow(String[] samplesOrVariables, Integer[] clusteringData,
    String title) {
  super();
  this.setTitle(title);

  SampleClusters[] data = new SampleClusters[samplesOrVariables.length];
  for (int i = 0; i < samplesOrVariables.length; i++) {
    data[i] = new SampleClusters(samplesOrVariables[i], clusteringData[i]);
  }

  ObservableList<SampleClusters> dataList = FXCollections.observableArrayList(data);
  tableView = new TableView<SampleClusters>(dataList);

  TableColumn sampleColumn = new TableColumn("Variables");
  sampleColumn.setCellValueFactory(new PropertyValueFactory<>("sampleOrVariable"));
  TableColumn clusterColumn = new TableColumn("Cluster number");
  clusterColumn.setCellValueFactory(new PropertyValueFactory<>("cluster"));

  tableView.getColumns().addAll(sampleColumn, clusterColumn);

  mainScene = new Scene(tableView);
  setScene(mainScene);
}
 
Example #29
Source File: BrandQueryController.java    From dctb-utfpr-2018-1 with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    brands =FXCollections.observableArrayList();
    
    Brand b= new Brand(1, "Nvidia");
    brands.add(b);
    Brand b1= new Brand(1, "AMD");
    brands.add(b1);
    Brand b2= new Brand(1, "Intel");
    brands.add(b2);
    Name.setCellValueFactory(new PropertyValueFactory<>("name"));
    TableBrand.setItems(brands);
    // TODO
}
 
Example #30
Source File: OverviewUserController.java    From Corendon-LostLuggage with MIT License 5 votes vote down vote up
@Override
public void initialize(URL location, ResourceBundle resources) {

    //Error in creating database User
    //MyJDBC.createLostLuggageDatabase("LostLuggage");
    try {
        if (MainApp.language.equals("dutch")) {
            MainViewController.getInstance().getTitle(headerDutch);
        } else {
            MainViewController.getInstance().getTitle(header);

        }
    } catch (IOException ex) {
        Logger.getLogger(OverviewUserController.class.getName()).log(Level.SEVERE, null, ex);
    }

    idColumn.setCellValueFactory(new PropertyValueFactory<User, String>("Id"));
    lastNameColumn.setCellValueFactory(new PropertyValueFactory<User, String>("LastName"));
    firstNameColumn.setCellValueFactory(new PropertyValueFactory<User, String>("FirstName"));
    locationColumn.setCellValueFactory(new PropertyValueFactory<User, String>("Location"));
    roleColumn.setCellValueFactory(new PropertyValueFactory<User, String>("Role"));
    statusColumn.setCellValueFactory(new PropertyValueFactory<User, String>("Status"));

    tableView.setItems(getUsers());

    mouseClickedOnRow();

    //To Previous Scene
    MainViewController.previousView = "/Views/Admin/HomeUserView.fxml";
    MainApp.currentView = "/Views/Admin/UserScene.fxml";

}