use of qupath.lib.gui.panes.WorkflowCommandLogView in project qupath by qupath.
the class QuPathGUI method initializeAnalysisPanel.
private void initializeAnalysisPanel() {
analysisPanel.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
projectBrowser = new ProjectBrowser(this);
analysisPanel.getTabs().add(new Tab("Project", projectBrowser.getPane()));
ImageDetailsPane pathImageDetailsPanel = new ImageDetailsPane(this);
analysisPanel.getTabs().add(new Tab("Image", pathImageDetailsPanel.getPane()));
/*
* Create tabs.
* Note that we don't want ImageData/hierarchy events to be triggered for tabs that aren't visible,
* since these can be quite expensive.
* For that reason, we create new bindings.
*
* TODO: Handle analysis pane being entirely hidden.
*/
// Create annotation tab
var tabAnnotations = new Tab("Annotations");
var annotationTabImageData = Bindings.createObjectBinding(() -> {
return tabAnnotations.isSelected() ? imageDataProperty.get() : null;
}, tabAnnotations.selectedProperty(), imageDataProperty());
var annotationMeasurementsTable = new SelectedMeasurementTableView(annotationTabImageData).getTable();
SplitPane splitAnnotations = new SplitPane();
splitAnnotations.setOrientation(Orientation.VERTICAL);
var annotationPane = new AnnotationPane(this, imageDataProperty());
annotationPane.disableUpdatesProperty().bind(tabAnnotations.selectedProperty().not());
splitAnnotations.getItems().addAll(annotationPane.getPane(), annotationMeasurementsTable);
tabAnnotations.setContent(splitAnnotations);
analysisPanel.getTabs().add(tabAnnotations);
// analysisPanel.getSelectionModel().selectedItemProperty()
// Create hierarchy tab
var tabHierarchy = new Tab("Hierarchy");
var hierarchyTabImageData = Bindings.createObjectBinding(() -> {
return tabHierarchy.isSelected() ? imageDataProperty.get() : null;
}, imageDataProperty(), tabHierarchy.selectedProperty());
final PathObjectHierarchyView paneHierarchy = new PathObjectHierarchyView(this, imageDataProperty());
paneHierarchy.disableUpdatesProperty().bind(tabHierarchy.selectedProperty().not());
SplitPane splitHierarchy = new SplitPane();
splitHierarchy.setOrientation(Orientation.VERTICAL);
splitHierarchy.getItems().addAll(paneHierarchy.getPane(), new SelectedMeasurementTableView(hierarchyTabImageData).getTable());
tabHierarchy.setContent(splitHierarchy);
analysisPanel.getTabs().add(tabHierarchy);
// Bind the split pane dividers to create a more consistent appearance
splitAnnotations.getDividers().get(0).positionProperty().bindBidirectional(splitHierarchy.getDividers().get(0).positionProperty());
var commandLogView = new WorkflowCommandLogView(this);
TitledPane titledLog = new TitledPane("Command history", commandLogView.getPane());
titledLog.setCollapsible(false);
titledLog.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
var pane = new BorderPane(titledLog);
analysisPanel.getTabs().add(new Tab("Workflow", pane));
}
use of qupath.lib.gui.panes.WorkflowCommandLogView in project qupath by qupath.
the class Commands method createWorkflowDisplayDialog.
/**
* Create a dialog to show the workflow history for the current image data.
* @param qupath the QuPath instance
* @return a workflow display dialog
*/
public static Stage createWorkflowDisplayDialog(QuPathGUI qupath) {
var view = new WorkflowCommandLogView(qupath);
Stage dialog = new Stage();
dialog.initOwner(qupath.getStage());
dialog.setTitle("Workflow viewer");
Pane pane = view.getPane();
dialog.setScene(new Scene(pane, 400, 400));
return dialog;
}
Aggregations