diff --git a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ItineraryOverviewController.java b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ItineraryOverviewController.java index 53e212bb1ab71cba602a4d74d65f826b36eec7c8..a36098b8debfeacd6cea24d1082a2f131676f2e9 100644 --- a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ItineraryOverviewController.java +++ b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ItineraryOverviewController.java @@ -36,9 +36,11 @@ import guru.nidi.graphviz.model.Factory; import guru.nidi.graphviz.model.MutableGraph; import guru.nidi.graphviz.model.MutableNode; import javafx.application.Platform; +import javafx.beans.binding.Bindings; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; @@ -50,10 +52,7 @@ import javafx.geometry.Pos; import javafx.scene.control.*; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; -import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.HBox; -import javafx.scene.layout.Priority; -import javafx.scene.layout.VBox; +import javafx.scene.layout.*; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.FileChooser; @@ -190,11 +189,18 @@ public class ItineraryOverviewController { } } ); Label separator = new Label(""); + Label connectedComponent = new Label( ""); + connectedComponent.visibleProperty().bind(file.connectedComposant.greaterThan(1)); + connectedComponent.textProperty().bind(new SimpleStringProperty(" -- ").concat(file.connectedComposant.asString().concat(" connected components"))); separator.setMaxWidth(Double.MAX_VALUE); HBox bb = new HBox(); + Background warn = new Background(new BackgroundFill(javafx.scene.paint.Color.DARKORANGE,null,null)); + Background norm = new Background(new BackgroundFill(null,null,null)); + bb.backgroundProperty().bind(Bindings.when(file.connectedComposant.greaterThan(1)).then(warn).otherwise(norm)); + bb.setAlignment(Pos.CENTER_RIGHT); bb.setHgrow(separator, Priority.ALWAYS); - bb.getChildren().addAll(lnum,lname, itiName, separator); + bb.getChildren().addAll(lnum,lname, itiName, connectedComponent, separator); bb.setPadding(new Insets(0,3,0,0)); bb.minWidthProperty().bind(itineraryPane.widthProperty().subtract(25)); itineraryPane.setGraphic(bb);