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

iss1026: TaskComputationView

parent c42340ef
No related branches found
No related tags found
1 merge request!14Iss1026
package cz.it4i.fiji.haas_spim_benchmark.ui;
import java.awt.Window;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import cz.it4i.fiji.haas.ui.CloseableControl;
import cz.it4i.fiji.haas.ui.InitiableControl;
import cz.it4i.fiji.haas.ui.JavaFXRoutines;
import cz.it4i.fiji.haas_spim_benchmark.core.TaskComputation;
import cz.it4i.fiji.haas_spim_benchmark.ui.TaskComputationAdapter.ObservableLog;
import javafx.scene.Node;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
public class TaskComputationControl extends TabPane implements CloseableControl, InitiableControl {
@SuppressWarnings("unused")
private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.TaskComputationControl.class);
private final TaskComputationAdapter adapter;
public TaskComputationControl(TaskComputation computation) {
JavaFXRoutines.initRootAndController("TaskComputationView.fxml", this);
adapter = new TaskComputationAdapter(computation);
}
@Override
public void init(Window parameter) {
RemoteFilesInfoControl infoControl= new RemoteFilesInfoControl(adapter.getOutputs());
infoControl.init(parameter);
addTab("Output files", infoControl);
for (ObservableLog log: adapter.getLogs()) {
LogViewControl logViewControl = new LogViewControl();
logViewControl.setObservable(log.getContent());
addTab(log.getName(), logViewControl);
}
}
private void addTab(String title, Node control) {
Tab t = new Tab(title);
t.setClosable(false);
HBox hbox = new HBox();
HBox.setHgrow(control, Priority.ALWAYS);
hbox.getChildren().add(control);
t.setContent(hbox);
getTabs().add(t);
}
@Override
public void close() {
adapter.close();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import cz.it4i.fiji.haas_spim_benchmark.ui.LogViewControl?>
<?import cz.it4i.fiji.haas_spim_benchmark.ui.SPIMPipelineProgressViewController?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<fx:root type="TabPane" xmlns:fx="http://javafx.com/fxml/1"
xmlns="http://javafx.com/javafx/8.0.65" fx:controller="cz.it4i.fiji.haas_spim_benchmark.ui.TaskComputationControl">
<tabs>
<Tab closable="false" text="Progress">
<content>
<HBox>
<SPIMPipelineProgressViewController fx:id="progressView"
HBox.hgrow="ALWAYS" />
</HBox>
</content>
</Tab>
<Tab closable="false" text="Snakemake output">
<content>
<HBox>
<LogViewControl fx:id="errorOutput" HBox.hgrow="ALWAYS" />
</HBox>
</content>
</Tab>
<Tab closable="false" text="Other output">
<content>
<HBox>
<LogViewControl fx:id="standardOutput" HBox.hgrow="ALWAYS" />
</HBox>
</content>
</Tab>
</tabs>
</fx:root>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment