use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildAnnTableRow.
private TableView<AnnPredictionParser.AnnPrediction> buildAnnTableRow(final AnnPredictionParser parser) {
final TableView<AnnPredictionParser.AnnPrediction> table = new TableView<>();
if (parser.isValid()) {
table.getColumns().add(makeColumn("SO", P -> P.getSOTermsString()));
table.getColumns().add(makeColumn("Allele", P -> P.getAllele()));
table.getColumns().add(makeColumn("Impact", P -> P.getPutativeImpact()));
table.getColumns().add(makeColumn("GeneName", P -> P.getGeneName()));
table.getColumns().add(makeColumn("GeneId", P -> P.getGeneId()));
table.getColumns().add(makeColumn("Feature", P -> P.getFeatureType()));
table.getColumns().add(makeColumn("FeatureId", P -> P.getFeatureId()));
table.getColumns().add(makeColumn("Biotype", P -> P.getTranscriptBioType()));
table.getColumns().add(makeColumn("HGVsc", P -> P.getHGVSc()));
table.getColumns().add(makeColumn("Rank", P -> P.getRank()));
table.getColumns().add(makeColumn("cDNA-pos", P -> P.getCDNAPos()));
table.getColumns().add(makeColumn("CDS-pos", P -> P.getCDSPos()));
table.getColumns().add(makeColumn("AA-pos", P -> P.getAAPos()));
table.getColumns().add(makeColumn("Distance", P -> P.getDistance()));
table.getColumns().add(makeColumn("Msg", P -> P.getMessages()));
}
table.setPlaceholder(new Label("No ANN prediction available"));
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildFormatHeaderTab.
/**
* build a table describing the FORMAT column
*/
private Tab buildFormatHeaderTab(final VCFHeader header) {
final TableView<VCFFormatHeaderLine> table = new TableView<>(FXCollections.observableArrayList(header.getFormatHeaderLines()));
table.getColumns().add(makeColumn("ID", F -> F.getID()));
table.getColumns().add(makeColumn("Type", F -> F.getType() == null ? null : F.getType().name()));
table.getColumns().add(makeColumn("Count", F -> F.isFixedCount() ? F.getCount() : null));
table.getColumns().add(makeColumn("Description", F -> F.getDescription()));
final Tab tab = new Tab("FORMAT", table);
tab.setClosable(false);
table.setPlaceholder(new Label("No FORMAT defined."));
return tab;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildFilterHeaderTab.
/**
* build a table describing the INFO column
*/
private Tab buildFilterHeaderTab(final VCFHeader header) {
final TableView<VCFFilterHeaderLine> table = new TableView<>(FXCollections.observableArrayList(header.getFilterLines()));
table.getColumns().add(makeColumn("ID", F -> F.getID()));
table.getColumns().add(makeColumn("Description", F -> F.getDescription()));
final Tab tab = new Tab("FILTER", table);
tab.setClosable(false);
table.setPlaceholder(new Label("No FILTER defined."));
return tab;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildFilterTable.
/**
* build FILTER table
*/
private TableView<String> buildFilterTable() {
final TableView<String> table = new TableView<>();
final TableColumn<String, String> scol = new TableColumn<>("Filter");
scol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(CellDataFeatures<String, String> param) {
return new ReadOnlyObjectWrapper<String>(param.getValue());
}
});
table.getColumns().add(scol);
table.setPlaceholder(new Label("No Variant or Variant contains no Filter"));
return table;
}
use of javafx.scene.control.TableView in project Smartcity-Smarthouse by TechnionYP5777.
the class SendMessageController method addStringField.
private void addStringField(String fieldName) {
ObservableList<String> s = FXCollections.observableArrayList();
Label label = new Label(fieldName + ":");
TableView<String> table = new TableView<>(s);
TableColumn<String, String> valueCol = new TableColumn<String, String>("Value");
valueCol.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue()));
TableColumn<String, Boolean> deleteCol = new TableColumn<String, Boolean>();
deleteCol.setCellValueFactory(param -> new SimpleBooleanProperty(param.getValue() != null));
deleteCol.setCellFactory(p -> {
final ButtonCell $ = new ButtonCell();
$.setAction(__1 -> s.remove($.getTableView().getItems().get($.getIndex())));
$.setAlignment(Pos.CENTER);
return $;
});
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPrefSize(100, 100);
table.getColumns().setAll(Arrays.asList(valueCol, deleteCol));
Group group = new Group(table);
VBox.setVgrow(group, Priority.NEVER);
TextField addValue = new TextField();
Button addButton = new Button("Add");
addButton.setOnAction(__1 -> {
s.add(addValue.getText());
addValue.clear();
});
HBox hb = new HBox(addValue, addButton);
hb.setSpacing(3);
VBox vbox = new VBox(label, table, hb);
vbox.setSpacing(5);
vbox.setPadding(new Insets(10, 0, 0, 10));
mainPane.getChildren().add(vbox);
consumers.add(l -> {
if (!s.isEmpty())
l.put(fieldName, s);
else {
this.encounterdIssue = true;
issues.add("in " + fieldName + " must contain at least one String");
}
});
}
Aggregations