diff --git a/src/main/java/fr/inra/po2vocabmanager/utils/UITools.java b/src/main/java/fr/inra/po2vocabmanager/utils/UITools.java index f9d56cad969a14b24f2ce4d14db6fdecadfbe016..6e910325891a64537b6b9df7272e443c7b100596 100644 --- a/src/main/java/fr/inra/po2vocabmanager/utils/UITools.java +++ b/src/main/java/fr/inra/po2vocabmanager/utils/UITools.java @@ -34,11 +34,13 @@ import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.application.Platform; import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanBinding; +import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; -import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; +import javafx.collections.FXCollections; import javafx.collections.MapChangeListener; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; @@ -64,6 +66,7 @@ import javafx.stage.Window; import javafx.stage.WindowEvent; import javafx.util.Duration; import javafx.util.Pair; +import javafx.util.StringConverter; import org.apache.logging.log4j.LogManager; import org.controlsfx.control.textfield.AutoCompletionBinding; import org.controlsfx.control.textfield.TextFields; @@ -78,8 +81,6 @@ public class UITools { private static VBox listVBox; private static HashMap<ProgressPO2, VBox> listProgress; private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(UITools.class); - private static HashMap<TextField, ChangeListener> listListener = new HashMap<>(); - private UITools() {} @@ -525,9 +526,6 @@ public class UITools { tool.textProperty().bind(cField.getTooltip()); Tooltip.install(grid, tool); Label labFirst = new Label(); - logger.debug(cField.getUnit());; - logger.debug(cField.getValue());; - logger.debug(Tools.getPrettyUnit(cField.getUnit().getValue())); labFirst.textProperty().bind(Bindings.when(cField.getUnit().isEmpty()).then(cField.getValue()).otherwise(Bindings.concat(cField.getValue(), " (",Tools.getPrettyUnit(cField.getUnit().getValue()),")"))); grid.add(labFirst, 0,0); @@ -561,6 +559,60 @@ public class UITools { tField.styleProperty().bind(Bindings.when(cField.stateProperty().isEqualTo(FieldState.WARNING)).then("-fx-border-color: orange;").otherwise(Bindings.when(cField.stateProperty().isEqualTo(FieldState.ERROR)).then("-fx-border-color: red;").otherwise(""))); } + public static void bindComboBoxAgent(ObjectProperty<HashMap<KeyWords, ComplexField>> agentProp, ObservableList<HashMap<KeyWords, ComplexField>> list, ComboBox<HashMap<KeyWords, ComplexField>> comboField) { + comboField.setConverter(new StringConverter<HashMap<KeyWords, ComplexField>>() { + @Override + public String toString(HashMap<KeyWords, ComplexField> keyWordsComplexFieldHashMap) { + if (keyWordsComplexFieldHashMap == null){ + return null; + } else { + return Tools.agentToString(keyWordsComplexFieldHashMap); + } + } + + @Override + public HashMap<KeyWords, ComplexField> fromString(String s) { + HashMap<KeyWords, ComplexField> val = list.stream().filter(keyWordsComplexFieldHashMap -> { + return s.equalsIgnoreCase(Tools.agentToString(keyWordsComplexFieldHashMap)); + }).findFirst().orElse(null); + return val; + } + }); + comboField.setCellFactory(p -> { + return new ListCell<HashMap<KeyWords, ComplexField>>() { + + @Override + protected void updateItem(HashMap<KeyWords, ComplexField> item, boolean empty) { + super.updateItem(item, empty); + if (item == null || empty) { + setGraphic(null); + setText(""); + } else { + setGraphic(null); + setText(Tools.agentToString(item)); + } + } + }; + }); + + comboField.setValue(null); + ObservableList<HashMap<KeyWords, ComplexField>> listCopy = FXCollections.observableArrayList(); + listCopy.add(Tools.createFakeAgentFromString("")); + if(!list.contains(agentProp.getValue())) { + if(!Tools.agentToString(agentProp.getValue()).isBlank()) { + listCopy.add(agentProp.getValue()); + } + } + listCopy.addAll(list); + comboField.setItems(listCopy); + comboField.setValue(agentProp.getValue()); + agentProp.bind(comboField.valueProperty()); + + comboField.styleProperty().unbind(); + BooleanBinding containAgent = Bindings.createBooleanBinding( () -> list.contains( agentProp.getValue() ) || Tools.agentToString(agentProp.getValue()).isEmpty(), list, agentProp ); + comboField.styleProperty().bind(Bindings.when(containAgent).then("").otherwise("-fx-border-color: red;")); + } + public static void bindTable(GenericTable table, TableView tableView) { if(table instanceof SimpleTable) { bindSimpleTable((SimpleTable) table, tableView); diff --git a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ObservationOverviewController.java b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ObservationOverviewController.java index 99565ee9c13a54e2bc2f9dd04bfd40a27ea2527c..63275b603396c48543efe17704c22effc7cae052 100644 --- a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ObservationOverviewController.java +++ b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ObservationOverviewController.java @@ -23,6 +23,7 @@ import fr.inra.po2vocabmanager.model.DataNode; import fr.inra.po2vocabmanager.utils.UITools; import fr.inrae.po2engine.model.ComplexField; import fr.inrae.po2engine.model.dataModel.CompositionFile; +import fr.inrae.po2engine.model.dataModel.KeyWords; import fr.inrae.po2engine.model.dataModel.ObservationFile; import fr.inrae.po2engine.model.dataModel.StepFile; import fr.inrae.po2engine.model.partModel.TablePart; @@ -43,6 +44,7 @@ import javafx.stage.Modality; import org.apache.commons.lang3.tuple.MutablePair; import java.io.IOException; +import java.util.HashMap; import java.util.Optional; public class ObservationOverviewController { @@ -67,6 +69,8 @@ public class ObservationOverviewController { TextField observationScale; @FXML ListView listObjectObserved; + @FXML + ComboBox<HashMap<KeyWords, ComplexField>> orgAgent; ObservationFile file; ObservableList<MutablePair<String, MutablePair<String, SimpleBooleanProperty>>> listItem; @@ -91,6 +95,9 @@ public class ObservationOverviewController { observationRepet.editableProperty().bind(mainApp.getEditProperty()); observationScale.editableProperty().bind(mainApp.getEditProperty()); // listObjectObserved.disableProperty().bind(mainApp.getEditProperty().not()); + + orgAgent.setEditable(false); + orgAgent.disableProperty().bind(this.mainApp.getEditProperty().not()); } @@ -143,6 +150,7 @@ public class ObservationOverviewController { UITools.simpleBindValue(file.getCHeure(), observationTime); UITools.simpleBindValue(file.getCRepet(), observationRepet); UITools.simpleBindValue(file.getCScale(), observationScale); + UITools.bindComboBoxAgent(file.getAgentProperty(),file.getData().getProjectFile().getListAgent(), orgAgent); listItem = FXCollections.observableArrayList(); diff --git a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ProjectOverviewController.java b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ProjectOverviewController.java index e633e4cd553c68d9f5039cec6d9f0ef874254deb..4108522b71a85b2ed53ab32b55f2ef4201403a76 100644 --- a/src/main/java/fr/inra/po2vocabmanager/view/dataView/ProjectOverviewController.java +++ b/src/main/java/fr/inra/po2vocabmanager/view/dataView/ProjectOverviewController.java @@ -21,9 +21,13 @@ package fr.inra.po2vocabmanager.view.dataView; import fr.inra.po2vocabmanager.MainApp; import fr.inra.po2vocabmanager.utils.UITools; import fr.inra.po2vocabmanager.utils.XCell; +import fr.inrae.po2engine.model.ComplexField; import fr.inrae.po2engine.model.Data; +import fr.inrae.po2engine.model.dataModel.KeyWords; import fr.inrae.po2engine.model.dataModel.ProjectFile; +import fr.inrae.po2engine.model.partModel.ProjectAgentPart; import fr.inrae.po2engine.utils.DataPartType; +import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; @@ -31,10 +35,12 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.control.*; import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.stream.Collectors; public class ProjectOverviewController { @@ -48,11 +54,22 @@ public class ProjectOverviewController { @FXML TitledPane paneMethod; @FXML - TextField contactName; + TableView<HashMap<KeyWords, ComplexField>> tableOrgAgent; @FXML - TextField contactMail; + TableColumn<HashMap<KeyWords, ComplexField>, ComplexField> colOrg; @FXML - TextField funding; + TableColumn<HashMap<KeyWords, ComplexField>, ComplexField> colFamily; + @FXML + TableColumn<HashMap<KeyWords, ComplexField>, ComplexField> colGiven; + @FXML + TableColumn<HashMap<KeyWords, ComplexField>, ComplexField> colMail; + @FXML + TableColumn<HashMap<KeyWords, ComplexField>, ComplexField> colAction; + @FXML + ComboBox<HashMap<KeyWords, ComplexField>> contactAgent; + @FXML + ComboBox<HashMap<KeyWords, ComplexField>> fundingAgent; + @FXML TextArea description; @FXML @@ -77,6 +94,156 @@ public class ProjectOverviewController { public void setMainApp(MainApp mainApp) { this.mainApp = mainApp; ProjectFile projectFile = mainApp.getDataControler().getCurrentData().getProjectFile(); + tableOrgAgent.setDisable(false); + tableOrgAgent.editableProperty().bind(this.mainApp.getEditProperty()); + + Button addLine = new Button("New line "); + addLine.disableProperty().bind(this.mainApp.getEditProperty().not()); + addLine.setGraphic(new ImageView(UITools.getImage("resources/images/add_row-16.png"))); + addLine.setOnAction(actionEvent -> { + projectFile.addAgent(); + }); + + Label noContent = new Label("No content in table"); + noContent.setGraphic(addLine); + noContent.setContentDisplay(ContentDisplay.BOTTOM); + tableOrgAgent.setPlaceholder(noContent); + + colOrg.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().get(ProjectAgentPart.agentOrganisationK))); + colFamily.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().get(ProjectAgentPart.agentFamilyNameK))); + colGiven.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().get(ProjectAgentPart.agentGivenNameK))); + colMail.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().get(ProjectAgentPart.agentMailK))); + colAction.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().get(ProjectAgentPart.agentOrganisationK))); + + + colOrg.setCellFactory(col -> { + return new TableCell<HashMap<KeyWords, ComplexField>, ComplexField>() { + + @Override + protected void updateItem(ComplexField item, boolean empty) { + super.updateItem(item, empty); + if (item == null || empty) { + setText(null); + setStyle(null); + setGraphic(null); + } else { + TextField text = new TextField(); + text.editableProperty().bind(tableOrgAgent.editableProperty()); + text.styleProperty().bind(item.styleProperty()); + item.getValue().unbind(); + text.setText(item.getValue().get()); + item.getValue().bind(text.textProperty()); + + setGraphic(text); + } + } + }; + }); + colFamily.setCellFactory(col -> { + return new TableCell<HashMap<KeyWords, ComplexField>, ComplexField>() { + + @Override + protected void updateItem(ComplexField item, boolean empty) { + super.updateItem(item, empty); + if (item == null || empty) { + setText(null); + setStyle(null); + setGraphic(null); + } else { + TextField text = new TextField(); + text.editableProperty().bind(tableOrgAgent.editableProperty()); + text.styleProperty().bind(item.styleProperty()); + item.getValue().unbind(); + text.setText(item.getValue().get()); + item.getValue().bind(text.textProperty()); + + setGraphic(text); + } + } + }; + }); + colGiven.setCellFactory(col -> { + return new TableCell<HashMap<KeyWords, ComplexField>, ComplexField>() { + + @Override + protected void updateItem(ComplexField item, boolean empty) { + super.updateItem(item, empty); + if (item == null || empty) { + setText(null); + setStyle(null); + setGraphic(null); + } else { + TextField text = new TextField(); + text.editableProperty().bind(tableOrgAgent.editableProperty()); + text.styleProperty().bind(item.styleProperty()); + item.getValue().unbind(); + text.setText(item.getValue().get()); + item.getValue().bind(text.textProperty()); + + setGraphic(text); + } + } + }; + }); + colMail.setCellFactory(col -> { + return new TableCell<HashMap<KeyWords, ComplexField>, ComplexField>() { + + @Override + protected void updateItem(ComplexField item, boolean empty) { + super.updateItem(item, empty); + if (item == null || empty) { + setText(null); + setStyle(null); + setGraphic(null); + } else { + TextField text = new TextField(); + text.editableProperty().bind(tableOrgAgent.editableProperty()); + text.styleProperty().bind(item.styleProperty()); + item.getValue().unbind(); + text.setText(item.getValue().get()); + item.getValue().bind(text.textProperty()); + + setGraphic(text); + } + } + }; + }); + + colAction.setCellFactory(mapComplexFieldTableColumn -> { + return new TableCell<HashMap<KeyWords, ComplexField>, ComplexField>() { + + @Override + protected void updateItem(ComplexField complexField, boolean empty) { + super.updateItem(complexField, empty); + if (complexField != null && !empty) { + setText(null); + setStyle(null); + Button add = new Button(""); + add.setGraphic(new ImageView(UITools.getImage("resources/images/add_16.png"))); + add.setOnAction(event -> { + projectFile.addAgent(); + }); + add.disableProperty().bind(tableOrgAgent.editableProperty().not()); + + Button del = new Button(""); + del.setGraphic(new ImageView(UITools.getImage("resources/images/del_16.png"))); + del.setOnAction(event -> { + projectFile.removeAgent(tableOrgAgent.getItems().get(getIndex())); + }); + del.disableProperty().bind(tableOrgAgent.editableProperty().not()); + + HBox hb = new HBox(add, del); + setGraphic(hb); + } else { + setText(null); + setStyle(null); + setGraphic(null); + } + } + }; + }); + + tableOrgAgent.setItems(projectFile.getListAgent()); ArrayList<String> ls = projectFile.getExternalLinks(); String[] arrayLink = new String [ls.size()]; @@ -99,10 +266,13 @@ public class ProjectOverviewController { listLink.add("new link"); }); - contactName.editableProperty().bind(this.mainApp.getEditProperty()); - contactMail.editableProperty().bind(this.mainApp.getEditProperty()); + contactAgent.setEditable(false); + contactAgent.disableProperty().bind(this.mainApp.getEditProperty().not()); + + fundingAgent.setEditable(false); + fundingAgent.disableProperty().bind(this.mainApp.getEditProperty().not()); + description.editableProperty().bind(this.mainApp.getEditProperty()); - funding.editableProperty().bind(this.mainApp.getEditProperty()); // ne sera jamais éditable !!!!!! projectTitle.setEditable(false); @@ -111,10 +281,9 @@ public class ProjectOverviewController { projectTitle.setText(this.mainApp.getDataControler().getCurrentData().getProjectFile().getNameProperty().getValue()); this.mainApp.getDataControler().getCurrentData().getProjectFile().getNameProperty().bind(projectTitle.textProperty()); - UITools.simpleBindValue(projectFile.getCContactName(), contactName); - UITools.simpleBindValue(projectFile.getCContactMail(), contactMail); + UITools.bindComboBoxAgent(projectFile.getContactProperty(),projectFile.getListAgent(), contactAgent); + UITools.bindComboBoxAgent(projectFile.getFundingProperty(),projectFile.getListAgent(), fundingAgent); UITools.simpleBindValue(projectFile.getCDescription(), description); - UITools.simpleBindValue(projectFile.getCFunding(), funding); Data data = this.mainApp.getDataControler().getCurrentData(); try { diff --git a/src/main/java/fr/inra/po2vocabmanager/view/dataView/StepOverviewController.java b/src/main/java/fr/inra/po2vocabmanager/view/dataView/StepOverviewController.java index f726e07a4cb667210dcd084e8aa9daa09dbe9d5e..ac1dd94a50f15ba5800d3109e26963d6ffe2651c 100644 --- a/src/main/java/fr/inra/po2vocabmanager/view/dataView/StepOverviewController.java +++ b/src/main/java/fr/inra/po2vocabmanager/view/dataView/StepOverviewController.java @@ -21,7 +21,9 @@ package fr.inra.po2vocabmanager.view.dataView; import fr.inra.po2vocabmanager.MainApp; import fr.inra.po2vocabmanager.model.DataNode; import fr.inra.po2vocabmanager.utils.UITools; +import fr.inrae.po2engine.model.ComplexField; import fr.inrae.po2engine.model.dataModel.CompositionFile; +import fr.inrae.po2engine.model.dataModel.KeyWords; import fr.inrae.po2engine.model.dataModel.StepFile; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; @@ -37,6 +39,7 @@ import org.controlsfx.control.textfield.AutoCompletionBinding; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; import java.util.Optional; @@ -55,6 +58,8 @@ public class StepOverviewController { TextField time; @FXML TextField duree; + @FXML + ComboBox<HashMap<KeyWords, ComplexField>> orgAgent; @FXML TitledPane stepPanel; @@ -93,6 +98,9 @@ public class StepOverviewController { duree.editableProperty().bind(this.mainApp.getEditProperty()); duree.disableProperty().bind(this.mainApp.getEditProperty().not()); + + orgAgent.setEditable(false); + orgAgent.disableProperty().bind(this.mainApp.getEditProperty().not()); } public void showNodeDetails(DataNode node) { @@ -107,6 +115,7 @@ public class StepOverviewController { UITools.simpleBindValue(f.getCDate(), date); UITools.simpleBindValue(f.getCTime(), time); UITools.simpleBindValue(f.getCDuration(), duree); + UITools.bindComboBoxAgent(f.getAgentProperty(),f.getData().getProjectFile().getListAgent(), orgAgent); listAutoCompletion.add(UITools.addAutoComplete(stepTitle, f.getCType().getListConstraint())); // UITools.addPopOver(stepTitle, Ontology.Step); @@ -115,33 +124,6 @@ public class StepOverviewController { f.getCId().getValue().addListener(observable->MainApp.getDataControler().refreshTree()); -// Button importExcel = new Button(null, new ImageView(UITools.getImage("resources/images/file-import-16.png"))); -// importExcel.setTooltip(new Tooltip("Import Step")); -// importExcel.setOnMouseClicked(event -> { -// // Import des données. -// }); -// importExcel.disableProperty().bind(this.mainApp.getEditProperty().not()); -// -// Button exportExcel = new Button(null, new ImageView(UITools.getImage("resources/images/file-export-16.png"))); -// exportExcel.setTooltip(new Tooltip("Export Step")); -// exportExcel.setOnMouseClicked(event -> { -// // Export des données. -// -// }); - - -// Label titlePane = new Label("Ste"); -// titlePane.setAlignment(Pos.CENTER_LEFT); -// Label emptyLabelTitle = new Label(" "); -// emptyLabelTitle.setMaxWidth(Double.MAX_VALUE); -// HBox bbT = new HBox(); -// bbT.setAlignment(Pos.CENTER_RIGHT); -// bbT.getChildren().addAll(titlePane,emptyLabelTitle/*, exportExcel, importExcel*/); -// bbT.setHgrow(emptyLabelTitle, Priority.ALWAYS); -// bbT.setPadding(new Insets(0,3,0,0)); -// bbT.minWidthProperty().bind(stepPanel.widthProperty().subtract(25)); -// stepPanel.setGraphic(bbT); - boxContent.getChildren().retainAll(stepPanel); diff --git a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ObservationOverview.fxml b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ObservationOverview.fxml index cbc476282d5d0ac49d4ccfa003a4df6051ce7758..4e46d633c00b3ecd1be4273a1e23fd5906260e59 100644 --- a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ObservationOverview.fxml +++ b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ObservationOverview.fxml @@ -21,91 +21,97 @@ <?import javafx.geometry.Insets?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> -<ScrollPane xmlns:fx="http://javafx.com/fxml/1" fitToHeight="true" fitToWidth="true" maxHeight="Infinity" maxWidth="Infinity" prefHeight="222.0" prefWidth="799.0" xmlns="http://javafx.com/javafx/21.0.1" fx:controller="fr.inra.po2vocabmanager.view.dataView.ObservationOverviewController"> +<ScrollPane xmlns:fx="http://javafx.com/fxml/1" fitToHeight="true" fitToWidth="true" maxHeight="Infinity" maxWidth="Infinity" prefHeight="225.0" prefWidth="799.0" xmlns="http://javafx.com/javafx/21" fx:controller="fr.inra.po2vocabmanager.view.dataView.ObservationOverviewController"> <content> <VBox fx:id="boxContent" spacing="10.0"> <children> - <TitledPane fx:id="observationPanel" text="Observation"> - <content> - <BorderPane> - <center> - <GridPane hgap="5.0" BorderPane.alignment="TOP_LEFT"> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" percentWidth="33.3" /> - <ColumnConstraints hgrow="ALWAYS" percentWidth="33.3" /> - <ColumnConstraints hgrow="ALWAYS" percentWidth="33.3" /> - </columnConstraints> - <rowConstraints> - <RowConstraints vgrow="SOMETIMES" /> - </rowConstraints> + <TitledPane fx:id="observationPanel" prefHeight="303.0" prefWidth="797.0" text="Observation"> + <content> + <GridPane hgap="5.0"> + <columnConstraints> + <ColumnConstraints hgrow="ALWAYS" percentWidth="25.0" /> + <ColumnConstraints hgrow="ALWAYS" percentWidth="25.0" /> + <ColumnConstraints hgrow="ALWAYS" percentWidth="25.0" /> + <ColumnConstraints hgrow="ALWAYS" minWidth="10.0" percentWidth="25.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" percentHeight="25.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints percentHeight="25.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" percentHeight="25.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" percentHeight="25.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <VBox GridPane.rowIndex="1"> <children> - <VBox> - <children> - <Label text="Date (YYYY-MM-DD) :" /> - <TextField fx:id="observationDate" /> - <Label text="Time (hh:mm:ss) :" /> - <TextField fx:id="observationTime" /> - <Label text="Time duration (hh:mm:ss) :" /> - <TextField fx:id="observationTimeD" /> - </children> - </VBox> - <VBox prefWidth="171.0" GridPane.columnIndex="1"> - <children> - <Label alignment="TOP_LEFT" text="Scale :" /> - <TextField fx:id="observationScale" alignment="TOP_LEFT" /> - <Label text="Repetition :" /> - <TextField fx:id="observationRepet" /> - </children> - </VBox> - <VBox GridPane.columnIndex="2"> - <children> - <Label text="Objects observed :" /> - <ListView fx:id="listObjectObserved" prefHeight="111.0" prefWidth="171.0" /> - </children> - </VBox> + <Label text="Start date (YYYY-MM-DD) :" /> + <TextField fx:id="observationDate" /> </children> - </GridPane> - </center> - <top> - <GridPane hgap="5.0" BorderPane.alignment="TOP_LEFT"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" /> - </rowConstraints> + </VBox> + <VBox prefWidth="171.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> <children> - <VBox> - <children> - <Label text="Observation type :"> - <VBox.margin> - <Insets /> - </VBox.margin> - </Label> - <TextField fx:id="observationType" editable="false"> + <Label alignment="TOP_LEFT" text="Scale :" /> + <TextField fx:id="observationScale" alignment="TOP_LEFT" /> + </children> + </VBox> + <VBox GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="1" GridPane.rowSpan="3"> + <children> + <Label text="Objects observed :" /> + <ListView fx:id="listObjectObserved" prefHeight="111.0" prefWidth="171.0" /> + </children> + </VBox> + <VBox GridPane.columnSpan="2"> + <children> + <Label text="Observation type :"> + <VBox.margin> + <Insets /> + </VBox.margin> + </Label> + <TextField fx:id="observationType" editable="false"> </TextField> - </children> - </VBox> - <VBox GridPane.columnIndex="1"> - <children> - <Label text="Observation name :"> - <VBox.margin> - <Insets /> - </VBox.margin> - </Label> - <TextField fx:id="observationName" /> - </children> - </VBox> </children> - <padding> - <Insets bottom="10.0" /> - </padding> - </GridPane> - </top> - </BorderPane> - </content> + </VBox> + <VBox GridPane.columnIndex="1" /> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.columnSpan="2"> + <children> + <Label text="Observation name :"> + <VBox.margin> + <Insets /> + </VBox.margin> + </Label> + <TextField fx:id="observationName" /> + </children> + </VBox> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.rowIndex="2"> + <children> + <Label text="Start time (hh:mm:ss) :" /> + <TextField fx:id="observationTime" /> + </children> + </VBox> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.rowIndex="3"> + <children> + <Label text="Time duration (hh:mm:ss) :" /> + <TextField fx:id="observationTimeD" /> + </children> + </VBox> + <VBox prefHeight="200.0" prefWidth="100.0" /> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="3"> + <children> + <Label text="Repetition :" /> + <TextField fx:id="observationRepet" /> + </children> + </VBox> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.rowIndex="2" /> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.rowIndex="3" /> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> + <children> + <Label text="Organization / Agent :" /> + <ComboBox fx:id="orgAgent" /> + </children> + </VBox> + </children> + </GridPane> + </content> </TitledPane> </children> diff --git a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ProjectOverview.fxml b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ProjectOverview.fxml index 13d080d1d0f4f9b43acea6538949cc93f24506e9..99e258cb5f29164bd2a28f9bc0258c070d48cdc0 100644 --- a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ProjectOverview.fxml +++ b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/ProjectOverview.fxml @@ -20,29 +20,25 @@ <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> -<AnchorPane xmlns:fx="http://javafx.com/fxml/1" prefHeight="564.0" prefWidth="755.0" xmlns="http://javafx.com/javafx/21" fx:controller="fr.inra.po2vocabmanager.view.dataView.ProjectOverviewController"> +<AnchorPane xmlns:fx="http://javafx.com/fxml/1" prefHeight="524.0" prefWidth="647.0" xmlns="http://javafx.com/javafx/21" fx:controller="fr.inra.po2vocabmanager.view.dataView.ProjectOverviewController"> <children> - <BorderPane prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> - <top> - <TitledPane collapsible="false" maxHeight="208.0" prefHeight="210.0" prefWidth="755.0" text="Project" BorderPane.alignment="CENTER"> + <VBox spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <children> + <TitledPane text="Project" VBox.vgrow="SOMETIMES"> <content> <GridPane hgap="5.0" vgap="5.0"> <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="33.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="33.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> </columnConstraints> <rowConstraints> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> + <RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" /> + <RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" /> + <RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" /> </rowConstraints> <children> - <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnSpan="2"> + <VBox prefHeight="200.0" prefWidth="100.0"> <children> <Label prefHeight="30.0" prefWidth="300.0" text="Project name :" /> <TextField fx:id="projectTitle" prefHeight="30.0" prefWidth="400.0" /> @@ -50,54 +46,51 @@ </VBox> <VBox prefHeight="200.0" prefWidth="100.0" GridPane.rowIndex="1"> <children> - <Label text="Contact name :" /> - <TextField fx:id="contactName" /> + <Label text="Contact" /> + <ComboBox fx:id="contactAgent" prefWidth="10000.0" /> </children> </VBox> - <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> - <children> - <Label text="Funding :" /> - <TextField fx:id="funding" /> - </children> - </VBox> - <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowSpan="3"> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowSpan="3"> <children> <Label text="Description :" /> <TextArea fx:id="description" prefHeight="200.0" prefWidth="200.0" /> </children> </VBox> - <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="4" GridPane.columnSpan="2" GridPane.rowSpan="3"> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.rowSpan="3"> <children> <Label fx:id="linksLabel" contentDisplay="RIGHT" text="External links :" /> <ListView fx:id="listExternalLinks" /> </children> </VBox> - <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnSpan="2" GridPane.rowIndex="2"> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.rowIndex="2"> <children> - <Label text="Contact mail :" /> - <TextField fx:id="contactMail" /> + <Label text="Funding :" /> + <ComboBox fx:id="fundingAgent" prefWidth="10000.0" /> </children> </VBox> </children> </GridPane> </content> </TitledPane> - </top> - <center> - <GridPane BorderPane.alignment="CENTER"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints percentHeight="50.0" vgrow="SOMETIMES" /> - <RowConstraints percentHeight="50.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <TitledPane fx:id="paneMaterial" collapsible="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Materials" /> - <TitledPane fx:id="paneMethod" collapsible="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="350.0" prefWidth="755.0" text="Methods" GridPane.rowIndex="1" /> - </children> - </GridPane> - </center> - </BorderPane> + <TitledPane fx:id="paneMaterial" text="Materials" VBox.vgrow="SOMETIMES" /> + <TitledPane fx:id="paneMethod" text="Methods" VBox.vgrow="SOMETIMES" /> + <TitledPane text="Organizations / Agents" VBox.vgrow="SOMETIMES"> + <content> + <TableView fx:id="tableOrgAgent"> + <columns> + <TableColumn fx:id="colOrg" prefWidth="75.0" text="Organization" /> + <TableColumn fx:id="colFamily" prefWidth="75.0" text="Family name" /> + <TableColumn fx:id="colGiven" prefWidth="75.0" text="Given name" /> + <TableColumn fx:id="colMail" prefWidth="203.0" text="eMail" /> + <TableColumn fx:id="colAction" maxWidth="75.0" minWidth="75.0" prefWidth="75.0" /> + </columns> + <columnResizePolicy> + <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> + </columnResizePolicy> + </TableView> + </content> + </TitledPane> + </children> + </VBox> </children> </AnchorPane> diff --git a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/StepOverview.fxml b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/StepOverview.fxml index 5635ea2561011c462e0270c51aac71e44df61926..64483d5969beec76d3970e0b0f727afa074ea2e2 100644 --- a/src/main/resources/fr/inra/po2vocabmanager/view/dataView/StepOverview.fxml +++ b/src/main/resources/fr/inra/po2vocabmanager/view/dataView/StepOverview.fxml @@ -21,84 +21,78 @@ <?import javafx.geometry.Insets?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> -<ScrollPane xmlns:fx="http://javafx.com/fxml/1" fitToWidth="true" hbarPolicy="NEVER" style="-fx-background-color: grey;" xmlns="http://javafx.com/javafx/17" fx:controller="fr.inra.po2vocabmanager.view.dataView.StepOverviewController"> +<ScrollPane xmlns:fx="http://javafx.com/fxml/1" fitToWidth="true" hbarPolicy="NEVER" style="-fx-background-color: grey;" xmlns="http://javafx.com/javafx/21" fx:controller="fr.inra.po2vocabmanager.view.dataView.StepOverviewController"> <content> <VBox fx:id="boxContent" maxHeight="Infinity" maxWidth="Infinity" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <TitledPane fx:id="stepPanel" prefHeight="249.0" prefWidth="961.0" text="Step"> - <content> - <BorderPane prefHeight="282.0" prefWidth="959.0"> - <top> - <GridPane hgap="5.0" BorderPane.alignment="TOP_LEFT"> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" percentWidth="50.0" /> - <ColumnConstraints hgrow="ALWAYS" percentWidth="50.0" /> - </columnConstraints> - <VBox BorderPane.alignment="CENTER" GridPane.columnIndex="0"> - <children> - <Label prefWidth="300.0" text="Step type :"> - <VBox.margin> - <Insets /> - </VBox.margin> - </Label> - <TextField fx:id="stepTitle" prefWidth="400.0"> + <content> + <GridPane hgap="5.0" vgap="5.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="25.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="25.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="25.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="25.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" percentHeight="25.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" percentHeight="25.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <VBox GridPane.columnIndex="0" GridPane.columnSpan="2"> + <children> + <Label prefWidth="300.0" text="Step type :"> + <VBox.margin> + <Insets /> + </VBox.margin> + </Label> + <TextField fx:id="stepTitle" prefWidth="400.0"> </TextField> - </children> - </VBox> - <VBox prefHeight="75.0" BorderPane.alignment="CENTER" GridPane.columnIndex="1"> - <children> - <Label fx:id="stepIdLabel" contentDisplay="RIGHT" prefWidth="300.0" text="Step name :" /> - <TextField fx:id="stepID" prefWidth="400.0" /> - </children> - </VBox> - <rowConstraints> - <RowConstraints /> - </rowConstraints> - </GridPane> - </top> - <center> - <GridPane hgap="5.0" vgap="5.0" BorderPane.alignment="CENTER"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="33.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="33.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <VBox> - <children> - <Label prefHeight="30.0" text="Date (YYYY-MM-DD) :" /> - <TextField fx:id="date" /> - </children> - </VBox> - <VBox GridPane.rowIndex="1"> - <children> - <Label prefHeight="30.0" text="Time (hh:mm:ss) :" /> - <TextField fx:id="time" /> - </children> - </VBox> - <VBox GridPane.rowIndex="2"> - <children> - <Label prefHeight="30.0" text="Time duration (hh:mm:ss) :" /> - <TextField fx:id="duree" /> </children> </VBox> - <VBox GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowSpan="3"> + <VBox GridPane.columnIndex="2" GridPane.columnSpan="2"> <children> - <Label text="Description :" /> - <TextArea fx:id="description" prefWidth="874.0" /> + <Label fx:id="stepIdLabel" contentDisplay="RIGHT" prefWidth="300.0" text="Step name :" /> + <TextField fx:id="stepID" prefWidth="400.0" /> </children> </VBox> + <VBox GridPane.rowIndex="1"> + <children> + <Label prefHeight="30.0" text="Start date (YYYY-MM-DD) :" /> + <TextField fx:id="date" /> + </children> + </VBox> + <VBox GridPane.rowIndex="2"> + <children> + <Label prefHeight="30.0" text="Start time (hh:mm:ss) :" /> + <TextField fx:id="time" /> + </children> + </VBox> + <VBox GridPane.rowIndex="3"> + <children> + <Label prefHeight="30.0" text="Time duration (hh:mm:ss) :" /> + <TextField fx:id="duree" /> + </children> + </VBox> + <VBox GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="1" GridPane.rowSpan="3"> + <children> + <Label text="Description :" /> + <TextArea fx:id="description" /> + </children> + </VBox> + <VBox GridPane.columnIndex="1" GridPane.rowIndex="1"> + <children> + <Label text="Organization / Agent :" /> + <ComboBox fx:id="orgAgent" /> </children> - </GridPane> - </center> - </BorderPane> - </content> + </VBox> + <VBox GridPane.rowIndex="1" /> + </children> + </GridPane> + </content> </TitledPane> </children>