From 7de8e831d2a0147a9576c7b746b65569e3cdea5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ko=C5=BEusznik?= <jan@kozusznik.cz> Date: Tue, 27 Feb 2018 15:19:41 +0100 Subject: [PATCH] improve table design --- .../ui/SPIMPipelineProgressView.fxml | 2 +- .../ui/SPIMPipelineProgressViewController.java | 11 ++++++----- .../cz/it4i/fiji/haas_spim_benchmark/ui/style.css | 7 +++++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/style.css 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 bfa3ebbe..b765d90c 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 @@ -12,7 +12,7 @@ <HBox> <children> - <TableView fx:id="tasks" HBox.hgrow="ALWAYS"> + <TableView fx:id="tasks" stylesheets="@style.css" HBox.hgrow="ALWAYS"> <columns> <TableColumn prefWidth="179.0" text="Task name" /> </columns> diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java index 4c8f2337..c88cc697 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java @@ -32,13 +32,13 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl private static final String EMPTY_VALUE = "\u2007\u2007\u2007"; private static final int PREFERRED_WIDTH = 900; - + private static final Map<JobState, Color> taskExecutionState2Color = new HashMap<>(); static { - taskExecutionState2Color.put(JobState.Running, Color.YELLOW); - taskExecutionState2Color.put(JobState.Finished, Color.GREEN); - taskExecutionState2Color.put(JobState.Failed, Color.RED); - taskExecutionState2Color.put(JobState.Queued, Color.AZURE); + taskExecutionState2Color.put(JobState.Running, Color.rgb(0xF2, 0xD5, 0x39)); + taskExecutionState2Color.put(JobState.Finished, Color.rgb(0x41, 0xB2, 0x80)); + taskExecutionState2Color.put(JobState.Failed, Color.rgb(0xFF, 0x51, 0x3D)); + taskExecutionState2Color.put(JobState.Queued, Color.rgb(0x30, 0xA2, 0xCC)); taskExecutionState2Color.put(JobState.Unknown, Color.GRAY); } @@ -157,6 +157,7 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl cell.setStyle(""); } else { cell.setText(EMPTY_VALUE); + cell.getStyleClass().add("bordered-class"); cell.setStyle("-fx-background-color: " + getColorTaskExecState(val.getState())); } })); diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/style.css b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/style.css new file mode 100644 index 00000000..e5bc5bca --- /dev/null +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/style.css @@ -0,0 +1,7 @@ +.table-row-cell { + -fx-table-cell-border-color: #909090; +} + +.bordered-class { + -fx-background-insets:1 1 1 1; +} \ No newline at end of file -- GitLab