diff --git a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/ObservableValueRegistry.java b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/ObservableValueRegistry.java index 355ab32036a370e82100599234f44316e57fbe9b..b47f0739cd6a60e14d2649f977a18334101d68a2 100644 --- a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/ObservableValueRegistry.java +++ b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/ObservableValueRegistry.java @@ -1,7 +1,7 @@ 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)); diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMController.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMController.java index 8a87a53eae487ac55ea9b21a7dd22e0b4b502dd6..c27c53b274d8fdf0ed347785abd5d7f007257830 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMController.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMController.java @@ -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) { diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressView.fxml b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressView.fxml index 294e40a69f10160d5ed436a4855a311c3d5c9a02..bfa3ebbe06b9ec67a540f18a6463f2a7b514553f 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressView.fxml +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressView.fxml @@ -1,22 +1,20 @@ <?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>