Skip to content
Snippets Groups Projects
Commit dc1f37dd authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

UI modifications

parent bfce76a0
No related branches found
No related tags found
1 merge request!14Iss1026
package cz.it4i.fiji.haas.ui;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.function.Consumer;
......@@ -29,7 +29,7 @@ public class ObservableValueRegistry<T> {
}
private Map<T,UpdatableObservableValue<T>> map = new HashMap<>();
private Map<T,UpdatableObservableValue<T>> map = new LinkedHashMap<>();
public ObservableValue<T> addIfAbsent(T value) {
UpdatableObservableValue<T> uov = map.computeIfAbsent(value, v-> new UpdatableObservableValue<T>(v, updateFunction, stateProvider));
......
......@@ -3,9 +3,10 @@ package cz.it4i.fiji.haas_spim_benchmark.ui;
import java.awt.Desktop;
import java.awt.Window;
import java.io.IOException;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
......@@ -177,8 +178,8 @@ public class BenchmarkSPIMController extends BorderPane implements CloseableCont
: new DummyProgress();
try {
Collection<BenchmarkJob> jobs = manager.getJobs();
//jobs.forEach(bj->bj.getStateAsync(executorServiceJobState));
List<BenchmarkJob> jobs = new LinkedList<>(manager.getJobs());
jobs.sort((bj1, bj2) -> (int) (bj1.getId() - bj2.getId()));
Set<ObservableValue<BenchmarkJob>> actual = new HashSet<>(this.jobs.getItems());
for (BenchmarkJob bj : jobs) {
registry.addIfAbsent(bj);
......@@ -200,13 +201,13 @@ public class BenchmarkSPIMController extends BorderPane implements CloseableCont
}
private void initTable() {
registry = new ObservableBenchmarkJobRegistry(bj -> remove(bj),executorServiceJobState);
registry = new ObservableBenchmarkJobRegistry(bj -> remove(bj), executorServiceJobState);
setCellValueFactory(0, j -> j.getId() + "");
setCellValueFactoryCompletable(1,
j -> j.getStateAsync(executorServiceJobState).thenApply(state -> "" + state));
setCellValueFactoryCompletable(1, j -> j.getStateAsync(executorServiceJobState).thenApply(state -> "" + state));
setCellValueFactory(2, j -> j.getCreationTime().toString());
setCellValueFactory(3, j -> j.getStartTime().toString());
setCellValueFactory(4, j -> j.getEndTime().toString());
// jobs.getSortOrder().add(jobs.getColumns().get(0));
}
private void remove(BenchmarkJob bj) {
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.geometry.Insets?>
<fx:root type="BorderPane" xmlns="http://javafx.com/javafx/8.0.65"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="cz.it4i.fiji.haas_spim_benchmark.ui.SPIMPipelineProgressViewController">
<fx:root type="BorderPane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="cz.it4i.fiji.haas_spim_benchmark.ui.SPIMPipelineProgressViewController">
<center>
<HBox>
<children>
<TableView fx:id="tasks" HBox.hgrow="ALWAYS">
<TableView fx:id="tasks" HBox.hgrow="ALWAYS">
<columns>
<TableColumn prefWidth="101.0" text="Task name" />
<TableColumn prefWidth="179.0" text="Task name" />
</columns>
</TableView>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment