From ada26a89c3402518b87d6d95a0ada7f6cc07fb98 Mon Sep 17 00:00:00 2001 From: Eugen Zdrincu Date: Wed, 27 Mar 2024 20:39:21 +0100 Subject: [PATCH 001/100] added prototype for data source --- .../controller/TrackingDataController.java | 21 ++++++++++++++++++ src/main/java/inputOutput/AIDataSource.java | 22 +++++++++++++++++++ .../inputOutput/OIGTTrackingDataSource.java | 1 + src/main/resources/view/TrackingDataView.fxml | 2 ++ 4 files changed, 46 insertions(+) create mode 100644 src/main/java/inputOutput/AIDataSource.java diff --git a/src/main/java/controller/TrackingDataController.java b/src/main/java/controller/TrackingDataController.java index 1960d63c..d8f4fe98 100644 --- a/src/main/java/controller/TrackingDataController.java +++ b/src/main/java/controller/TrackingDataController.java @@ -12,6 +12,7 @@ import java.util.logging.Logger; import algorithm.*; +import inputOutput.AIDataSource; import inputOutput.CSVFileReader; import inputOutput.OIGTTrackingDataSource; import javafx.animation.Animation; @@ -122,6 +123,26 @@ public void loadCSVFile() { } } + @FXML + public void loadAIData() { + System.out.println("AI DATA LOADING"); + + AIDataSource newSource = new AIDataSource(); + + if (trackingService.getTrackingDataSource() != null) { + disconnectSource(); + } + + try { + trackingService.changeTrackingSource(newSource); + sourceConnected.setValue(true); + visualizationController.setSourceConnected(true); + } catch (Exception e) { + logger.log(Level.SEVERE, "Error loading AI DATA", e); + statusLabel.setText("Error loading AI DATA SOURCE"); + } + } + /** * Connect via OpenIGTLink. */ diff --git a/src/main/java/inputOutput/AIDataSource.java b/src/main/java/inputOutput/AIDataSource.java new file mode 100644 index 00000000..699dad2a --- /dev/null +++ b/src/main/java/inputOutput/AIDataSource.java @@ -0,0 +1,22 @@ +package inputOutput; + +import java.util.ArrayList; + +public class AIDataSource extends AbstractTrackingDataSource { + + public AIDataSource() { + tempToolList = new ArrayList<>(); + } + @Override + public ArrayList update() { + TempTool testTool1 = new TempTool(); + testTool1.setData(1, 1, 1, 1, 1, 1, 1, 1, 1, "testTool"); + tempToolList.add(testTool1); + return tempToolList; + } + + @Override + public void closeConnection() { + + } +} diff --git a/src/main/java/inputOutput/OIGTTrackingDataSource.java b/src/main/java/inputOutput/OIGTTrackingDataSource.java index 3f2148a5..8fb44d5d 100644 --- a/src/main/java/inputOutput/OIGTTrackingDataSource.java +++ b/src/main/java/inputOutput/OIGTTrackingDataSource.java @@ -81,6 +81,7 @@ public void setValues(String n, TransformNR t) { newTempTool.setData(timestamp, valid, coordinate_x, coordinate_y, coordinate_z, rotation_x, rotation_y, rotation_z, rotation_r, name); + this.tempToolList.add(newTempTool); } diff --git a/src/main/resources/view/TrackingDataView.fxml b/src/main/resources/view/TrackingDataView.fxml index 9ee47ab4..100d2386 100644 --- a/src/main/resources/view/TrackingDataView.fxml +++ b/src/main/resources/view/TrackingDataView.fxml @@ -100,6 +100,8 @@ + + + + + - + - - - + - - @@ -61,6 +82,7 @@ - + + From 41235acdfbdbbbc0fbcf5969d7c8feb0052165e5 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 14 Apr 2024 20:01:30 +0200 Subject: [PATCH 011/100] Next and previous button functionality added --- .../java/controller/AnnotationController.java | 64 ++++++++++++++++--- src/main/resources/view/AnnotationView.fxml | 6 +- 2 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index c1549050..304cbeae 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -1,8 +1,10 @@ package controller; +import java.util.ArrayList; import java.util.List; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; +import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; @@ -15,22 +17,28 @@ public class AnnotationController implements Controller { @FXML public VBox uploadedImages; + public Button uploadImagesButton; @FXML private ImageView selectedImageView; private ImageView currentSelectedImageView; + private List selectedImages; + @Override public void initialize(URL location, ResourceBundle resources) { // Initialization code goes here } + @FXML @Override public void close() { unregisterController(); } + @FXML public void Handle_Upload_Functionality(ActionEvent actionEvent) { try { + FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Select Images"); fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); @@ -38,9 +46,11 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { new FileChooser.ExtensionFilter("Image Files", "*.jpg", "*.png", "*.gif", "*.bmp") ); Stage currentStage = (Stage) ((javafx.scene.Node) actionEvent.getSource()).getScene().getWindow(); - List files = fileChooser.showOpenMultipleDialog(currentStage); - if (files != null) { - for (File file : files) { + + this.selectedImages = fileChooser.showOpenMultipleDialog(currentStage); + + if (selectedImages != null) { + for (File file : selectedImages) { displayImage(file); } } @@ -48,6 +58,7 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { e.printStackTrace(); } } + private void displayImage(File file) { Image image = new Image(file.toURI().toString()); ImageView imageView = new ImageView(image); @@ -56,21 +67,54 @@ private void displayImage(File file) { imageView.setPreserveRatio(true); imageView.setOnMouseClicked(event -> { - if (currentSelectedImageView != null) { - currentSelectedImageView.setStyle(""); - } - selectImage(image); - imageView.setStyle("-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);"); - currentSelectedImageView = imageView; + selectImage(image, imageView); }); uploadedImages.getChildren().add(imageView); } - private void selectImage(Image image) { + + private void selectImage(Image image, ImageView imageView) { + if (currentSelectedImageView != null) { + currentSelectedImageView.setStyle(""); + } + if (selectedImageView != null) { selectedImageView.setImage(image); selectedImageView.setFitWidth(selectedImageView.getScene().getWidth()); selectedImageView.setPreserveRatio(true); } + imageView.setStyle("-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);"); + currentSelectedImageView = imageView; + } + + public void Select_Next_Image(ActionEvent actionEvent) { + try { + if (currentSelectedImageView != null) { + int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); + if (currentIndex < uploadedImages.getChildren().size() - 1) { + ImageView nextImageView = (ImageView) uploadedImages.getChildren().get(currentIndex + 1); + Image image = nextImageView.getImage(); + selectImage(image, nextImageView); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void Select_Previous_Image(ActionEvent actionEvent) { + try { + if (currentSelectedImageView != null) { + int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); + if (currentIndex > 0) { + ImageView previousImageView = (ImageView) uploadedImages.getChildren().get(currentIndex - 1); + Image image = previousImageView.getImage(); + selectImage(image, previousImageView); + } + } + } + catch (Exception e) { + e.printStackTrace(); + } } } diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index b85de616..b9e8b57d 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -25,12 +25,12 @@ - - - + From c2651f88511a84603f9836732da994a4153cf62e Mon Sep 17 00:00:00 2001 From: VincentStriegel Date: Sun, 21 Apr 2024 16:49:23 +0200 Subject: [PATCH 026/100] clear marks --- src/main/java/controller/AnnotationController.java | 10 ++++++++++ src/main/java/util/AnnotationData.java | 4 +++- src/main/resources/view/AnnotationView.fxml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index a8160ff2..29e86c36 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -170,6 +170,16 @@ public void Select_Previous_Image(ActionEvent actionEvent) { } } + public void clearAnnotations(ActionEvent actionEvent) { + if(annotatedRectangle != null){ + annotationPane.getChildren().remove(annotatedRectangle); + annotationPane.getChildren().remove(middlePoint); + AnnotationData.getInstance().deleteAnnotation(selectedImageView.getImage().getUrl()); + middlePoint = null; + annotatedRectangle = null; + } + } + private void checkForExistingAnnotationData() { // Get Rectangle and 'unnormalize' the values annotationPane.getChildren().remove(annotatedRectangle); diff --git a/src/main/java/util/AnnotationData.java b/src/main/java/util/AnnotationData.java index 99b6e564..aa8fe4c6 100644 --- a/src/main/java/util/AnnotationData.java +++ b/src/main/java/util/AnnotationData.java @@ -76,7 +76,9 @@ public Rectangle getAnnotation(String path){ * @param path Image path (Key for the Map) */ public void deleteAnnotation(String path){ - //Todo + if(annotations.containsKey(path)){ + annotations.remove(path); + } } public static AnnotationData getInstance() { diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index e67d0158..52f7997a 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -57,7 +57,7 @@ ". + at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) + at java.xml/javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:84) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2620) + ... 17 more + +Apr 21, 2024 5:45:38 PM javafx.fxml.FXMLLoader$ValueElement processValue +WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 +Apr 21, 2024 5:45:38 PM mainMethod.App lambda$start$0 +SEVERE: Uncaught exception in thread main +java.lang.RuntimeException: Exception in Application start method + at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901) + at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196) + at java.base/java.lang.Thread.run(Thread.java:840) +Caused by: javafx.fxml.LoadException: +/C:/programming/Global_Computing/IGTPrototypingTool/build/resources/main/view/AnnotationView.fxml:72 +/C:/programming/Global_Computing/IGTPrototypingTool/build/resources/main/view/MainView.fxml:48 + + at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2707) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2650) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) + at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1153) + at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:757) + at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) + at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516) + at mainMethod.App.start(App.java:36) + at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847) + at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484) + at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457) + at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) + at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456) + at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) + at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) + at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) + ... 1 more +Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[72,18] +Message: The element type "Button" must be terminated by the matching end-tag "". + at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) + at java.xml/javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:84) + at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2620) + ... 17 more + +Apr 21, 2024 5:45:51 PM javafx.fxml.FXMLLoader$ValueElement processValue +WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 +Apr 21, 2024 5:45:52 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:45:52 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] +Apr 21, 2024 5:46:05 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:05 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:46:05 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=uploadImagesButton, styleClass=button]'Import' +Apr 21, 2024 5:46:06 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:46:14 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:46:15 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:46:15 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@46509f49[styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:15 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@46509f49[styleClass=scroll-pane] +Apr 21, 2024 5:46:16 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@46509f49[styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:16 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:46:16 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane@46509f49[styleClass=scroll-pane] to Button[id=demo, styleClass=button]'Export' +Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:46:17 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=demo, styleClass=button]'Export' to Button[id=ExportButton, styleClass=button]'Export' +Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button@26683389[styleClass=button]'OK', name: focused, value: true] focused=true +Apr 21, 2024 5:46:17 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from null to Button@26683389[styleClass=button]'OK' +Apr 21, 2024 5:46:18 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button@26683389[styleClass=button]'OK', name: focused, value: false] focused=false +Apr 21, 2024 5:46:18 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:46:19 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:46:19 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:19 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:21 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:21 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true +Apr 21, 2024 5:46:21 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' +Apr 21, 2024 5:46:22 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false +Apr 21, 2024 5:46:22 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:22 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:23 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:23 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:46:23 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=demo, styleClass=button]'Export' +Apr 21, 2024 5:46:24 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:46:38 PM javafx.fxml.FXMLLoader$ValueElement processValue +WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 +Apr 21, 2024 5:46:39 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:39 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] +Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:46:42 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=uploadImagesButton, styleClass=button]'Import' +Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:46:46 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@7863b5f5[styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:48 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@7863b5f5[styleClass=scroll-pane] +Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@7863b5f5[styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:48 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane@7863b5f5[styleClass=scroll-pane] to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:49 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:49 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:49 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to ScrollPane[id=annotation, styleClass=scroll-pane] +Apr 21, 2024 5:46:50 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:50 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=exampleButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true +Apr 21, 2024 5:46:50 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=annotation, styleClass=scroll-pane] to Button[id=exampleButton, styleClass=button]'Clear Marks' +Apr 21, 2024 5:46:53 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=exampleButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false +Apr 21, 2024 5:46:53 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:53 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=exampleButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true +Apr 21, 2024 5:46:54 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' +Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false +Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:54 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:56 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:56 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true +Apr 21, 2024 5:46:56 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' +Apr 21, 2024 5:46:57 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false +Apr 21, 2024 5:46:57 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:57 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:46:58 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to ScrollPane[id=annotation, styleClass=scroll-pane] +Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:46:58 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=annotation, styleClass=scroll-pane] to Button[id=ExportButton, styleClass=button]'Export' +Apr 21, 2024 5:46:59 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:47:00 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to ScrollPane[id=annotation, styleClass=scroll-pane] +Apr 21, 2024 5:47:01 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:47:28 PM javafx.fxml.FXMLLoader$ValueElement processValue +WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 +Apr 21, 2024 5:47:29 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:47:29 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] +Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:32 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=ExportButton, styleClass=button]'Export' +Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button@141f0d8[styleClass=button]'OK', name: focused, value: true] focused=true +Apr 21, 2024 5:47:32 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from null to Button@141f0d8[styleClass=button]'OK' +Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button@141f0d8[styleClass=button]'OK', name: focused, value: false] focused=false +Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:47:33 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to Button[id=uploadImagesButton, styleClass=button]'Import' +Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:47:38 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true +Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false +Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@dfd3d2d[styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:47:39 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@dfd3d2d[styleClass=scroll-pane] +Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane@dfd3d2d[styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:47:39 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane@dfd3d2d[styleClass=scroll-pane] to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:47:40 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:47:40 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true +Apr 21, 2024 5:47:40 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' +Apr 21, 2024 5:47:41 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false +Apr 21, 2024 5:47:41 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true +Apr 21, 2024 5:47:41 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] +Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false +Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:42 PM javafx.scene.Scene$12 invalidated +FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=ExportButton, styleClass=button]'Export' +Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:49 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:50 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false +Apr 21, 2024 5:47:50 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true +Apr 21, 2024 5:47:51 PM javafx.scene.Node$FocusedProperty markInvalid +FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false diff --git a/logging.log.1.lck b/logging.log.1.lck new file mode 100644 index 00000000..e69de29b diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index 4b299618..c19f3177 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -57,8 +57,6 @@ - - - + + + + @@ -62,7 +58,7 @@ - ". - at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) - at java.xml/javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:84) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2620) - ... 17 more - -Apr 21, 2024 5:45:38 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:45:38 PM mainMethod.App lambda$start$0 -SEVERE: Uncaught exception in thread main -java.lang.RuntimeException: Exception in Application start method - at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901) - at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196) - at java.base/java.lang.Thread.run(Thread.java:840) -Caused by: javafx.fxml.LoadException: -/C:/programming/Global_Computing/IGTPrototypingTool/build/resources/main/view/AnnotationView.fxml:72 -/C:/programming/Global_Computing/IGTPrototypingTool/build/resources/main/view/MainView.fxml:48 - - at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2707) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2650) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) - at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1153) - at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:757) - at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) - at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516) - at mainMethod.App.start(App.java:36) - at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847) - at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484) - at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457) - at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) - at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456) - at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) - at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) - at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) - ... 1 more -Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[72,18] -Message: The element type "Button" must be terminated by the matching end-tag "". - at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) - at java.xml/javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:84) - at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2620) - ... 17 more - -Apr 21, 2024 5:45:51 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:45:52 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:45:52 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] -Apr 21, 2024 5:46:05 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:05 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:46:05 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=uploadImagesButton, styleClass=button]'Import' -Apr 21, 2024 5:46:06 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:46:14 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:46:15 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:46:15 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@46509f49[styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:15 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@46509f49[styleClass=scroll-pane] -Apr 21, 2024 5:46:16 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@46509f49[styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:16 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:46:16 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane@46509f49[styleClass=scroll-pane] to Button[id=demo, styleClass=button]'Export' -Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:46:17 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=demo, styleClass=button]'Export' to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:46:17 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@26683389[styleClass=button]'OK', name: focused, value: true] focused=true -Apr 21, 2024 5:46:17 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to Button@26683389[styleClass=button]'OK' -Apr 21, 2024 5:46:18 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@26683389[styleClass=button]'OK', name: focused, value: false] focused=false -Apr 21, 2024 5:46:18 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:46:19 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:46:19 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:19 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:21 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:21 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:46:21 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:46:22 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:46:22 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:22 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:23 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:23 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:46:23 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=demo, styleClass=button]'Export' -Apr 21, 2024 5:46:24 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=demo, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:46:38 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:46:39 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:39 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] -Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:46:42 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=uploadImagesButton, styleClass=button]'Import' -Apr 21, 2024 5:46:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:46:46 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@7863b5f5[styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:48 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@7863b5f5[styleClass=scroll-pane] -Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@7863b5f5[styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:48 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:48 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane@7863b5f5[styleClass=scroll-pane] to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:49 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:49 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:49 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to ScrollPane[id=annotation, styleClass=scroll-pane] -Apr 21, 2024 5:46:50 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:50 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=exampleButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:46:50 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=annotation, styleClass=scroll-pane] to Button[id=exampleButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:46:53 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=exampleButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:46:53 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:53 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=exampleButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:46:54 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:46:54 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:54 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:56 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:56 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:46:56 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:46:57 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:46:57 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:57 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:46:58 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to ScrollPane[id=annotation, styleClass=scroll-pane] -Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:46:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:46:58 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=annotation, styleClass=scroll-pane] to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:46:59 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:00 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:47:00 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to ScrollPane[id=annotation, styleClass=scroll-pane] -Apr 21, 2024 5:47:01 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=annotation, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:47:28 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:47:29 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:47:29 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] -Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:32 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@141f0d8[styleClass=button]'OK', name: focused, value: true] focused=true -Apr 21, 2024 5:47:32 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to Button@141f0d8[styleClass=button]'OK' -Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@141f0d8[styleClass=button]'OK', name: focused, value: false] focused=false -Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:47:33 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to Button[id=uploadImagesButton, styleClass=button]'Import' -Apr 21, 2024 5:47:33 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:47:38 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@dfd3d2d[styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:47:39 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@dfd3d2d[styleClass=scroll-pane] -Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@dfd3d2d[styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:47:39 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:47:39 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane@dfd3d2d[styleClass=scroll-pane] to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:47:40 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:47:40 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:47:40 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:47:41 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:47:41 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:47:41 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:42 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:47:42 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:49 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:50 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:47:50 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:47:51 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:49:26 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:49:27 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:49:27 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] -Apr 21, 2024 5:49:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:49:32 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: true] focused=true -Apr 21, 2024 5:49:32 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode' -Apr 21, 2024 5:49:35 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: false] focused=false -Apr 21, 2024 5:49:53 PM javafx.fxml.FXMLLoader$ValueElement processValue -WARNING: Loading FXML document with JavaFX API of version 21 by JavaFX runtime of version 17 -Apr 21, 2024 5:49:54 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:49:54 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to TabPane[id=tabPane, styleClass=tab-pane] -Apr 21, 2024 5:49:56 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: TabPane[id=tabPane, styleClass=tab-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:49:56 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: true] focused=true -Apr 21, 2024 5:49:56 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from TabPane[id=tabPane, styleClass=tab-pane] to Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode' -Apr 21, 2024 5:49:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: false] focused=false -Apr 21, 2024 5:49:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:49:58 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode' to Button[id=uploadImagesButton, styleClass=button]'Import' -Apr 21, 2024 5:49:58 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:49:59 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:50:00 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:50:00 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: true] focused=true -Apr 21, 2024 5:50:00 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode' -Apr 21, 2024 5:50:01 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode', name: focused, value: false] focused=false -Apr 21, 2024 5:50:01 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:50:01 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=toggleThemeButton, styleClass=button]'Dark/Light-Mode' to Button[id=uploadImagesButton, styleClass=button]'Import' -Apr 21, 2024 5:50:01 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:50:07 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: true] focused=true -Apr 21, 2024 5:50:08 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=uploadImagesButton, styleClass=button]'Import', name: focused, value: false] focused=false -Apr 21, 2024 5:50:08 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@103c0396[styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:50:08 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=uploadImagesButton, styleClass=button]'Import' to ScrollPane@103c0396[styleClass=scroll-pane] -Apr 21, 2024 5:50:09 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane@103c0396[styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:50:09 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:50:09 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane@103c0396[styleClass=scroll-pane] to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:50:09 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:50:09 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:50:09 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:50:10 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:50:10 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:50:10 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: true] focused=true -Apr 21, 2024 5:50:11 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=clearMarksButton, styleClass=button]'Clear Marks' -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=clearMarksButton, styleClass=button]'Clear Marks', name: focused, value: false] focused=false -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:50:11 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=clearMarksButton, styleClass=button]'Clear Marks' to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:50:11 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@1d2f0cc5[styleClass=button]'OK', name: focused, value: true] focused=true -Apr 21, 2024 5:50:11 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from null to Button@1d2f0cc5[styleClass=button]'OK' -Apr 21, 2024 5:50:12 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button@1d2f0cc5[styleClass=button]'OK', name: focused, value: false] focused=false -Apr 21, 2024 5:50:12 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:50:13 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:50:13 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: true] focused=true -Apr 21, 2024 5:50:13 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from Button[id=ExportButton, styleClass=button]'Export' to ScrollPane[id=selectedImagePane, styleClass=scroll-pane] -Apr 21, 2024 5:50:14 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: ScrollPane[id=selectedImagePane, styleClass=scroll-pane], name: focused, value: false] focused=false -Apr 21, 2024 5:50:14 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:50:14 PM javafx.scene.Scene$12 invalidated -FINE: Changed focus from ScrollPane[id=selectedImagePane, styleClass=scroll-pane] to Button[id=ExportButton, styleClass=button]'Export' -Apr 21, 2024 5:50:14 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false -Apr 21, 2024 5:50:15 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: true] focused=true -Apr 21, 2024 5:50:18 PM javafx.scene.Node$FocusedProperty markInvalid -FINE: ReadOnlyBooleanProperty [bean: Button[id=ExportButton, styleClass=button]'Export', name: focused, value: false] focused=false From 346e8fe356cddc8ac7e15ad0f494c0e3916a2799 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Thu, 2 May 2024 17:33:01 +0200 Subject: [PATCH 041/100] Update AnnotationController.java Added a few conditions --- (Export All Check): 1. Handles now the case when there are no files in the directory 2. Handles now the case when there are some pictures that are not annotated a. Shows which pictures are not annotated --- .../java/controller/AnnotationController.java | 112 ++++++++++++------ 1 file changed, 76 insertions(+), 36 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index ce23fcc4..4204dc47 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -15,6 +15,7 @@ import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Rectangle; +import javafx.scene.text.Text; import javafx.scene.transform.Scale; import javafx.stage.FileChooser; import javafx.stage.Stage; @@ -25,10 +26,7 @@ import java.io.FileNotFoundException; import java.io.PrintWriter; import java.net.URL; -import java.util.HashSet; -import java.util.List; -import java.util.ResourceBundle; -import java.util.Set; +import java.util.*; public class AnnotationController implements Controller { @FXML @@ -316,33 +314,86 @@ private void handleExportAction(ActionEvent event) { } } - /** - * Handles Export All based Functionality - * @param event The Mouse Event - */ + + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + ///Export-All-Functionality----------START + @FXML private void handleExportAllAction(ActionEvent event) { - if (selectedImageView != null && annotatedRectangle != null) { - DirectoryChooser directoryChooser = new DirectoryChooser(); - directoryChooser.setTitle("Select Directory to Save Annotations"); - File selectedDirectory = directoryChooser.showDialog(((Node) event.getSource()).getScene().getWindow()); - - if (selectedDirectory != null) { - AnnotationData.getInstance().getAnnotations().forEach((path, annotation) -> { - try { - File file = new File(new URL(path).toURI()); - String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + "_annotations.txt"; - File annotationFile = new File(selectedDirectory, fileName); - - saveAnnotationsToFile(annotationFile, annotation); - } catch (Exception e) { - e.printStackTrace(); - } - }); + // Checking if there are no images uploaded + if (uploadedImages.getChildren().isEmpty()) { + showAlert("Export Error", "There are no images to export."); + return; + } + + List unannotatedImages = new ArrayList<>(); + for (Node node : uploadedImages.getChildren()) { + ImageView imageView = (ImageView) node; + if (AnnotationData.getInstance().getAnnotation(imageView.getImage().getUrl()) == null) { + unannotatedImages.add(new File(imageView.getImage().getUrl()).getName()); } } + + if (!unannotatedImages.isEmpty()) { + showUnannotatedImagesAlert(unannotatedImages); + return; + } + + DirectoryChooser directoryChooser = new DirectoryChooser(); + directoryChooser.setTitle("Select Directory to Save Annotations"); + File selectedDirectory = directoryChooser.showDialog(((Node) event.getSource()).getScene().getWindow()); + + if (selectedDirectory != null) { + AnnotationData.getInstance().getAnnotations().forEach((path, annotation) -> { + File file = null; + try { + file = new File(new URL(path).toURI()); + String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + "_annotations.txt"; + File annotationFile = new File(selectedDirectory, fileName); + saveAnnotationsToFile(annotationFile, annotation); + } catch (Exception e) { + showAlert("Error", "Failed to save annotations for " + file.getName()); + } + }); + } + } + + private void showAlert(String title, String content) { + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle(title); + alert.setHeaderText(null); + alert.setContentText(content); + alert.showAndWait(); + } + + private void showUnannotatedImagesAlert(List unannotatedImages) { + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle("Unannotated Images"); + alert.setHeaderText("The following images have no annotations:"); + + VBox vbox = new VBox(5); + for (String imageName : unannotatedImages) { + Text imageText = new Text(imageName); + vbox.getChildren().add(imageText); + } + + ScrollPane scrollPane = new ScrollPane(vbox); + scrollPane.setPrefSize(300, 150); + scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); + scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); + + alert.getDialogPane().setContent(scrollPane); + alert.setResizable(true); + alert.showAndWait(); } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + ///Export-All-Functionality----------END + + + /** * Handles the Saving of Annotations to a File * @param file The File to save the Annotations to @@ -416,15 +467,4 @@ public void deletionfunctionality(ActionEvent event) { showAlert("No Selection", "No image is currently selected to delete."); } } - - - private void showAlert(String title, String content) { - Alert alert = new Alert(Alert.AlertType.INFORMATION); - alert.setTitle(title); - alert.setHeaderText(null); - alert.setContentText(content); - alert.showAndWait(); - } - - } From 17a56cf3dbcc08760afafd3b6f29a3fc304d97b5 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Thu, 2 May 2024 17:43:35 +0200 Subject: [PATCH 042/100] Update AnnotationController.java File Names will be shown now in the sideview for a better user experience. --- .../java/controller/AnnotationController.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 4204dc47..7343cda6 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -25,9 +25,16 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import java.net.URL; import java.util.*; +import javafx.scene.control.Label; +import javafx.scene.layout.VBox; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; + + public class AnnotationController implements Controller { @FXML public VBox uploadedImages; //Where the users see the files @@ -90,20 +97,32 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { } } - private void displayImage(File file) { + private void displayImage(File file) throws UnsupportedEncodingException { Image image = new Image(file.toURI().toString()); ImageView imageView = new ImageView(image); imageView.setFitHeight(100); imageView.setFitWidth(100); imageView.setPreserveRatio(true); + // Decode the file name to handle URL-encoded spaces and other characters + String decodedFileName = URLDecoder.decode(file.getName(), StandardCharsets.UTF_8.toString()); + + // Create a label with the decoded file name + Label fileNameLabel = new Label(decodedFileName); + fileNameLabel.setStyle("-fx-text-fill: black; -fx-font-size: 12px;"); + + // Create a VBox to hold the label and the image view + VBox vbox = new VBox(5); // 5 is the spacing between the label and the image + vbox.getChildren().addAll(fileNameLabel, imageView); + imageView.setOnMouseClicked(event -> { selectImage(image, imageView); }); - uploadedImages.getChildren().add(imageView); + uploadedImages.getChildren().add(vbox); } + private void selectImage(Image image, ImageView imageView) { if (selectedImageView != null && currentSelectedImageView != imageView) { selectedImageView.setImage(image); @@ -402,8 +421,8 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { private void saveAnnotationsToFile(File file, AnnotationData.PublicAnnotation annotation) { try (PrintWriter writer = new PrintWriter(file)) { - String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); - writer.println(line); + String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); + writer.println(line); } catch (FileNotFoundException e) { e.printStackTrace(); } From 0f1cf27d9ffdf8333be6e00dfb2b3330afea14a5 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Thu, 2 May 2024 17:44:12 +0200 Subject: [PATCH 043/100] Update AnnotationController.java --- src/main/java/controller/AnnotationController.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 7343cda6..31ae5c62 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -104,15 +104,12 @@ private void displayImage(File file) throws UnsupportedEncodingException { imageView.setFitWidth(100); imageView.setPreserveRatio(true); - // Decode the file name to handle URL-encoded spaces and other characters String decodedFileName = URLDecoder.decode(file.getName(), StandardCharsets.UTF_8.toString()); - // Create a label with the decoded file name Label fileNameLabel = new Label(decodedFileName); fileNameLabel.setStyle("-fx-text-fill: black; -fx-font-size: 12px;"); - // Create a VBox to hold the label and the image view - VBox vbox = new VBox(5); // 5 is the spacing between the label and the image + VBox vbox = new VBox(5); vbox.getChildren().addAll(fileNameLabel, imageView); imageView.setOnMouseClicked(event -> { From 352e587a66b3ad0fa61f51082444928416bba24e Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Thu, 2 May 2024 17:48:15 +0200 Subject: [PATCH 044/100] Revert "Merge pull request #28 from zegLine/group-e-FileNames-SideView" This reverts commit 850ce1020708e32bca0e51e301cb6f1b1b8efcb0, reversing changes made to 3f9f9e248f7446b7bb594f3232b1e09b80e7c2f3. --- .../java/controller/AnnotationController.java | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 31ae5c62..4204dc47 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -25,16 +25,9 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; import java.net.URL; import java.util.*; -import javafx.scene.control.Label; -import javafx.scene.layout.VBox; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; - - public class AnnotationController implements Controller { @FXML public VBox uploadedImages; //Where the users see the files @@ -97,29 +90,20 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { } } - private void displayImage(File file) throws UnsupportedEncodingException { + private void displayImage(File file) { Image image = new Image(file.toURI().toString()); ImageView imageView = new ImageView(image); imageView.setFitHeight(100); imageView.setFitWidth(100); imageView.setPreserveRatio(true); - String decodedFileName = URLDecoder.decode(file.getName(), StandardCharsets.UTF_8.toString()); - - Label fileNameLabel = new Label(decodedFileName); - fileNameLabel.setStyle("-fx-text-fill: black; -fx-font-size: 12px;"); - - VBox vbox = new VBox(5); - vbox.getChildren().addAll(fileNameLabel, imageView); - imageView.setOnMouseClicked(event -> { selectImage(image, imageView); }); - uploadedImages.getChildren().add(vbox); + uploadedImages.getChildren().add(imageView); } - private void selectImage(Image image, ImageView imageView) { if (selectedImageView != null && currentSelectedImageView != imageView) { selectedImageView.setImage(image); @@ -418,8 +402,8 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { private void saveAnnotationsToFile(File file, AnnotationData.PublicAnnotation annotation) { try (PrintWriter writer = new PrintWriter(file)) { - String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); - writer.println(line); + String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); + writer.println(line); } catch (FileNotFoundException e) { e.printStackTrace(); } From 4d3fdc0d66189c86fc2cc23632a9d026fbef92de Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Thu, 2 May 2024 20:03:07 +0200 Subject: [PATCH 045/100] Theme Button (Placement Fix) --- .../java/controller/AnnotationController.java | 10 +++- src/main/java/controller/MainController.java | 49 +++++++++++++++++++ src/main/resources/view/AnnotationView.fxml | 5 -- src/main/resources/view/MainView.fxml | 3 ++ 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 4204dc47..e66b53de 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -417,14 +417,18 @@ private void showNoAnnotationAlert() { alert.showAndWait(); } + + + ///Below Code Now is part of the MainController Class, as it has been approved to be part of the main application /** * Handles Dark/Light-Mode based Functionality * @param event The Mouse Event */ + /* @FXML private void handleToggleTheme(ActionEvent event) { try { - Scene scene = ((Node) event.getSource()).getScene(); + Scene = ((Node) event.getSource()).getScene(); String lightModeUrl = getClass().getResource("/css/light-mode.css").toExternalForm(); String darkModeUrl = getClass().getResource("/css/dark-mode.css").toExternalForm(); @@ -443,6 +447,10 @@ private void handleToggleTheme(ActionEvent event) { showAlert("Error", "Failed to toggle theme."); } } + */ + + + @FXML public void deletionfunctionality(ActionEvent event) { if (currentSelectedImageView != null) { diff --git a/src/main/java/controller/MainController.java b/src/main/java/controller/MainController.java index f2445842..f16bb00e 100644 --- a/src/main/java/controller/MainController.java +++ b/src/main/java/controller/MainController.java @@ -2,14 +2,20 @@ import java.io.IOException; import java.net.URL; +import java.util.Objects; import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import algorithm.VisualizationManager; import javafx.application.Platform; +import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; +import javafx.scene.Node; import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.stage.Modality; +import javafx.stage.Stage; import javafx.scene.control.Alert; import javafx.scene.control.Label; import javafx.scene.control.Tab; @@ -176,4 +182,47 @@ public void openAboutView() { a.setContentText("This application was and currently is developed by students of THU.\nIt is actively supervised by Prof. Dr. Alfred Franz.\nThe source code can be found at https://github.com/Alfred-Franz/IGTPrototypingTool"); a.showAndWait(); } + + + + /* + This function has the implementation of dark and light mode for the whole application + */ + @FXML + private void handleToggleTheme(ActionEvent event) { + try { + // Accessing the Scene from the MenuItem indirectly + MenuItem menuItem = (MenuItem) event.getSource(); + Scene scene = menuItem.getParentPopup().getOwnerWindow().getScene(); + + String lightModeUrl = Objects.requireNonNull(getClass().getResource("/css/light-mode.css")).toExternalForm(); + String darkModeUrl = Objects.requireNonNull(getClass().getResource("/css/dark-mode.css")).toExternalForm(); + + System.out.println("Light Mode URL: " + lightModeUrl); + System.out.println("Dark Mode URL: " + darkModeUrl); + + if (lightModeUrl == null || darkModeUrl == null) { + throw new Exception("Theme CSS file(s) not found."); + } + + if (scene.getStylesheets().contains(darkModeUrl)) { + scene.getStylesheets().remove(darkModeUrl); + scene.getStylesheets().add(lightModeUrl); + } else { + scene.getStylesheets().remove(lightModeUrl); + scene.getStylesheets().add(darkModeUrl); + } + } catch (Exception e) { + e.printStackTrace(); + showAlert("Error", "Failed to toggle theme: " + e.getMessage()); + } + } + + private void showAlert(String title, String content) { + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle(title); + alert.setHeaderText(null); + alert.setContentText(content); + alert.showAndWait(); + } } diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index a33e7063..c307c991 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -63,11 +63,6 @@ - diff --git a/src/main/resources/view/MainView.fxml b/src/main/resources/view/MainView.fxml index d88b7bd6..2539d725 100644 --- a/src/main/resources/view/MainView.fxml +++ b/src/main/resources/view/MainView.fxml @@ -31,6 +31,9 @@ + + +
From cc8f9db0e5a08b7c924de13c3dcf7610d8ded04e Mon Sep 17 00:00:00 2001 From: Simon Engel Date: Thu, 2 May 2024 23:28:28 +0200 Subject: [PATCH 046/100] Select Multiple pictures in the Side View --- .../java/controller/AnnotationController.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 4204dc47..67f119e8 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -1,15 +1,19 @@ package controller; import javafx.event.ActionEvent; +import javafx.event.EventHandler; import javafx.fxml.FXML; +import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; import javafx.scene.control.ScrollPane; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; +import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; @@ -48,6 +52,8 @@ public class AnnotationController implements Controller { private List selectedImages; private Set uploadedFilePaths = new HashSet<>(); + // store the paths of the selected Image, so you can Export the data based on these keys + private Set selectedFilePaths = new HashSet<>(); @Override @@ -91,6 +97,15 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { } private void displayImage(File file) { + HBox hbox = new HBox(); + //Setting the space between the nodes of a HBox pane + hbox.setSpacing(10); + + CheckBox checkBox = new CheckBox(); + checkBox.setSelected(false); + + hbox.setMargin(checkBox, new Insets(10, 30, 10, 10)); + Image image = new Image(file.toURI().toString()); ImageView imageView = new ImageView(image); imageView.setFitHeight(100); @@ -101,7 +116,17 @@ private void displayImage(File file) { selectImage(image, imageView); }); - uploadedImages.getChildren().add(imageView); + checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { + if (newValue) { // Checkbox is now selected + selectedFilePaths.add(imageView.getImage().getUrl()); + } else { // Checkbox is now unselected + selectedFilePaths.remove(imageView.getImage().getUrl()); + } + }); + + hbox.getChildren().add(imageView); + hbox.getChildren().add(checkBox); + uploadedImages.getChildren().add(hbox); } private void selectImage(Image image, ImageView imageView) { From 3b16e9233970e0bb8a9ee29efd04be94e470b91b Mon Sep 17 00:00:00 2001 From: Simon Engel Date: Fri, 3 May 2024 08:28:28 +0200 Subject: [PATCH 047/100] Removed few Warnings --- .../java/controller/AnnotationController.java | 25 +++++++++---------- src/main/java/util/AnnotationData.java | 4 +-- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 67f119e8..1bf81da9 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -1,7 +1,6 @@ package controller; import javafx.event.ActionEvent; -import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.geometry.Insets; import javafx.scene.Node; @@ -50,7 +49,6 @@ public class AnnotationController implements Controller { private boolean dragged = false; private double annotationPointX, annotationPointY; - private List selectedImages; private Set uploadedFilePaths = new HashSet<>(); // store the paths of the selected Image, so you can Export the data based on these keys private Set selectedFilePaths = new HashSet<>(); @@ -78,7 +76,7 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { ); Stage currentStage = (Stage) ((javafx.scene.Node) actionEvent.getSource()).getScene().getWindow(); - this.selectedImages = fileChooser.showOpenMultipleDialog(currentStage); + List selectedImages = fileChooser.showOpenMultipleDialog(currentStage); if (selectedImages != null) { for (File file : selectedImages) { @@ -92,7 +90,7 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { } } } catch (Exception e) { - e.printStackTrace(); + System.err.println("Error while choosing File: " + e.getMessage()) ; } } @@ -115,7 +113,7 @@ private void displayImage(File file) { imageView.setOnMouseClicked(event -> { selectImage(image, imageView); }); - + // Add or Remove the selected file paths to the HasSet checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { // Checkbox is now selected selectedFilePaths.add(imageView.getImage().getUrl()); @@ -190,7 +188,7 @@ public void Select_Next_Image(ActionEvent actionEvent) { } } } catch (Exception e) { - e.printStackTrace(); + System.err.println("Error while selecting next Image: " + e.getMessage()) ; } } @@ -205,7 +203,7 @@ public void Select_Previous_Image(ActionEvent actionEvent) { } } } catch (Exception e) { - e.printStackTrace(); + System.err.println("Error while selecting previous Image: " + e.getMessage()) ; } } @@ -325,7 +323,7 @@ private void handleExportAction(ActionEvent event) { } catch (Exception e) { fileChooser.setInitialFileName("default_annotations.txt"); showAlert("Error", "There was an issue processing the image file name."); - e.printStackTrace(); + System.err.println("Error while Exporting: " + e.getMessage()) ; } fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Text Files", "*.txt")); @@ -378,7 +376,7 @@ private void handleExportAllAction(ActionEvent event) { File annotationFile = new File(selectedDirectory, fileName); saveAnnotationsToFile(annotationFile, annotation); } catch (Exception e) { - showAlert("Error", "Failed to save annotations for " + file.getName()); + showAlert("Error", "Failed to save annotations for " + path); } }); } @@ -430,7 +428,7 @@ private void saveAnnotationsToFile(File file, AnnotationData.PublicAnnotation an String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); writer.println(line); } catch (FileNotFoundException e) { - e.printStackTrace(); + System.err.println("Error while saving Annotation to File: " + e.getMessage()) ; } } @@ -464,7 +462,7 @@ private void handleToggleTheme(ActionEvent event) { scene.getStylesheets().add(darkModeUrl); } } catch (Exception e) { - e.printStackTrace(); + System.err.println("Error while changing Theme: " + e.getMessage()) ; showAlert("Error", "Failed to toggle theme."); } } @@ -476,12 +474,13 @@ public void deletionfunctionality(ActionEvent event) { imagePath = new File(new URL(currentSelectedImageView.getImage().getUrl()).toURI()).getAbsolutePath(); } catch (Exception e) { showAlert("Error", "Could not retrieve file path from the image."); - e.printStackTrace(); + System.err.println("Error while retrieving filepath during deletion: " + e.getMessage()) ; } uploadedImages.getChildren().remove(currentSelectedImageView); - if (imagePath != null && uploadedFilePaths.contains(imagePath)) { + if (imagePath != null) { uploadedFilePaths.remove(imagePath); + selectedFilePaths.remove(imagePath); } if (selectedImageView.getImage() == currentSelectedImageView.getImage()) { clearAnnotations(event); diff --git a/src/main/java/util/AnnotationData.java b/src/main/java/util/AnnotationData.java index 01df86f5..172db61c 100644 --- a/src/main/java/util/AnnotationData.java +++ b/src/main/java/util/AnnotationData.java @@ -82,9 +82,7 @@ public Rectangle getAnnotation(String path){ * @param path Image path (Key for the Map) */ public void deleteAnnotation(String path){ - if(annotations.containsKey(path)){ - annotations.remove(path); - } + annotations.remove(path); } public static AnnotationData getInstance() { From 704e38e079a02af344cd8264fe689e07e758f3ac Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sat, 4 May 2024 13:33:26 +0200 Subject: [PATCH 048/100] Default Color - Fix --- src/main/java/controller/MainController.java | 2 +- src/main/resources/css/light-mode.css | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 src/main/resources/css/light-mode.css diff --git a/src/main/java/controller/MainController.java b/src/main/java/controller/MainController.java index f16bb00e..530f4d91 100644 --- a/src/main/java/controller/MainController.java +++ b/src/main/java/controller/MainController.java @@ -195,7 +195,7 @@ private void handleToggleTheme(ActionEvent event) { MenuItem menuItem = (MenuItem) event.getSource(); Scene scene = menuItem.getParentPopup().getOwnerWindow().getScene(); - String lightModeUrl = Objects.requireNonNull(getClass().getResource("/css/light-mode.css")).toExternalForm(); + String lightModeUrl = Objects.requireNonNull(getClass().getResource("/css/customstyle.css")).toExternalForm(); String darkModeUrl = Objects.requireNonNull(getClass().getResource("/css/dark-mode.css")).toExternalForm(); System.out.println("Light Mode URL: " + lightModeUrl); diff --git a/src/main/resources/css/light-mode.css b/src/main/resources/css/light-mode.css deleted file mode 100644 index c6085861..00000000 --- a/src/main/resources/css/light-mode.css +++ /dev/null @@ -1,9 +0,0 @@ -.root { - -fx-background-color: white; - -fx-text-fill: black; -} - -.button { - -fx-background-color: #E0E0E0; - -fx-text-fill: black; -} From 2b951cd3f4b78e6b311b9ade7db10f1c3284f7e1 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sat, 4 May 2024 13:42:38 +0200 Subject: [PATCH 049/100] Update AnnotationController.java --- src/main/java/controller/AnnotationController.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index e3961d33..e30da4c9 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -352,12 +352,18 @@ private void handleExportAllAction(ActionEvent event) { List unannotatedImages = new ArrayList<>(); for (Node node : uploadedImages.getChildren()) { - ImageView imageView = (ImageView) node; - if (AnnotationData.getInstance().getAnnotation(imageView.getImage().getUrl()) == null) { - unannotatedImages.add(new File(imageView.getImage().getUrl()).getName()); + if (node instanceof HBox) { + HBox hbox = (HBox) node; + for (Node child : hbox.getChildren()) { + if (child instanceof ImageView) { + ImageView imageView = (ImageView) child; + if (AnnotationData.getInstance().getAnnotation(imageView.getImage().getUrl()) == null) { + unannotatedImages.add(new File(imageView.getImage().getUrl()).getName()); + } + } + } } } - if (!unannotatedImages.isEmpty()) { showUnannotatedImagesAlert(unannotatedImages); return; From 6ea68073deaeb46f472b1e8fe02e0243862aea58 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sat, 4 May 2024 13:53:41 +0200 Subject: [PATCH 050/100] Update AnnotationController.java --- .../java/controller/AnnotationController.java | 84 ++++++++++++------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index e30da4c9..eb9e82b6 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -90,7 +90,7 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { } } } catch (Exception e) { - System.err.println("Error while choosing File: " + e.getMessage()) ; + System.err.println("Error while choosing File: " + e.getMessage()); } } @@ -188,7 +188,7 @@ public void Select_Next_Image(ActionEvent actionEvent) { } } } catch (Exception e) { - System.err.println("Error while selecting next Image: " + e.getMessage()) ; + System.err.println("Error while selecting next Image: " + e.getMessage()); } } @@ -203,12 +203,12 @@ public void Select_Previous_Image(ActionEvent actionEvent) { } } } catch (Exception e) { - System.err.println("Error while selecting previous Image: " + e.getMessage()) ; + System.err.println("Error while selecting previous Image: " + e.getMessage()); } } public void clearAnnotations(ActionEvent actionEvent) { - if(annotatedRectangle != null){ + if (annotatedRectangle != null) { annotationPane.getChildren().remove(annotatedRectangle); annotationPane.getChildren().remove(middlePoint); AnnotationData.getInstance().deleteAnnotation(selectedImageView.getImage().getUrl()); @@ -305,8 +305,10 @@ private void releasedAnnotationEvent(MouseEvent event) { ); } + /** * Handles Export based Functionality + * * @param event The Mouse Event */ @FXML @@ -323,7 +325,7 @@ private void handleExportAction(ActionEvent event) { } catch (Exception e) { fileChooser.setInitialFileName("default_annotations.txt"); showAlert("Error", "There was an issue processing the image file name."); - System.err.println("Error while Exporting: " + e.getMessage()) ; + System.err.println("Error while Exporting: " + e.getMessage()); } fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Text Files", "*.txt")); @@ -338,7 +340,6 @@ private void handleExportAction(ActionEvent event) { } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///Export-All-Functionality----------START @@ -422,19 +423,19 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { ///Export-All-Functionality----------END - /** * Handles the Saving of Annotations to a File - * @param file The File to save the Annotations to + * + * @param file The File to save the Annotations to * @param annotation The Annotation Data to save */ private void saveAnnotationsToFile(File file, AnnotationData.PublicAnnotation annotation) { try (PrintWriter writer = new PrintWriter(file)) { - String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); - writer.println(line); + String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); + writer.println(line); } catch (FileNotFoundException e) { - System.err.println("Error while saving Annotation to File: " + e.getMessage()) ; + System.err.println("Error while saving Annotation to File: " + e.getMessage()); } } @@ -447,10 +448,11 @@ private void showNoAnnotationAlert() { } - ///Below Code Now is part of the MainController Class, as it has been approved to be part of the main application + /** * Handles Dark/Light-Mode based Functionality + * * @param event The Mouse Event */ /* @@ -478,31 +480,49 @@ private void handleToggleTheme(ActionEvent event) { } */ - - + /** + * Handles Deleting Functionality - Multiple Deletion Functionality has been also implemented + * + * @param event The Mouse Event + */ @FXML public void deletionfunctionality(ActionEvent event) { - if (currentSelectedImageView != null) { - String imagePath = null; - try { - imagePath = new File(new URL(currentSelectedImageView.getImage().getUrl()).toURI()).getAbsolutePath(); - } catch (Exception e) { - showAlert("Error", "Could not retrieve file path from the image."); - System.err.println("Error while retrieving filepath during deletion: " + e.getMessage()) ; - } + List toRemove = new ArrayList<>(); + boolean currentDisplayedRemoved = false; - uploadedImages.getChildren().remove(currentSelectedImageView); - if (imagePath != null) { - uploadedFilePaths.remove(imagePath); - selectedFilePaths.remove(imagePath); - } - if (selectedImageView.getImage() == currentSelectedImageView.getImage()) { - clearAnnotations(event); - selectedImageView.setImage(null); + for (Node node : uploadedImages.getChildren()) { + if (node instanceof HBox) { + HBox hbox = (HBox) node; + ImageView imageView = (ImageView) hbox.getChildren().get(0); + CheckBox checkBox = (CheckBox) hbox.getChildren().get(1); + if (checkBox.isSelected()) { + String imagePath = null; + try { + imagePath = new File(new URL(imageView.getImage().getUrl()).toURI()).getAbsolutePath(); + toRemove.add(node); // Mark for removal + uploadedFilePaths.remove(imagePath); + selectedFilePaths.remove(imagePath); + AnnotationData.getInstance().deleteAnnotation(imageView.getImage().getUrl()); + if (imageView.equals(currentSelectedImageView)) { + currentDisplayedRemoved = true; + } + } catch (Exception e) { + showAlert("Error", "Could not retrieve file path from the image."); + System.err.println("Error while retrieving filepath during deletion: " + e.getMessage()); + } + } } + } + + uploadedImages.getChildren().removeAll(toRemove); // Removing from the UI + + if (currentDisplayedRemoved) { + selectedImageView.setImage(null); currentSelectedImageView = null; - } else { - showAlert("No Selection", "No image is currently selected to delete."); + } + + if (uploadedImages.getChildren().isEmpty()) { + showAlert("Notice", "All images have been deleted."); } } } From 8337e690bc8f7f58c48a10184ded23978d3fcfe5 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 17:25:29 +0200 Subject: [PATCH 051/100] Deleting Annotation Data Annotation Data Gets Deleted Now --- .../java/controller/AnnotationController.java | 32 +++++++++++++------ src/main/java/util/AnnotationData.java | 5 ++- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index eb9e82b6..a2dc0e49 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -489,40 +489,52 @@ private void handleToggleTheme(ActionEvent event) { public void deletionfunctionality(ActionEvent event) { List toRemove = new ArrayList<>(); boolean currentDisplayedRemoved = false; - + boolean atLeastOneSelected = false; + // Iterate over each node in the uploadedImages VBox for (Node node : uploadedImages.getChildren()) { if (node instanceof HBox) { HBox hbox = (HBox) node; ImageView imageView = (ImageView) hbox.getChildren().get(0); CheckBox checkBox = (CheckBox) hbox.getChildren().get(1); + // Check if the CheckBox is selected for deletion if (checkBox.isSelected()) { + atLeastOneSelected = true; String imagePath = null; try { imagePath = new File(new URL(imageView.getImage().getUrl()).toURI()).getAbsolutePath(); - toRemove.add(node); // Mark for removal + // Delete annotation from AnnotationData + if (AnnotationData.getInstance().deleteAnnotation(imageView.getImage().getUrl())) { + System.out.println("Annotation deleted for image: " + imagePath); + } else { + System.out.println("No annotation found or error deleting annotation for image: " + imagePath); + } + toRemove.add(node); uploadedFilePaths.remove(imagePath); selectedFilePaths.remove(imagePath); - AnnotationData.getInstance().deleteAnnotation(imageView.getImage().getUrl()); if (imageView.equals(currentSelectedImageView)) { currentDisplayedRemoved = true; } } catch (Exception e) { - showAlert("Error", "Could not retrieve file path from the image."); + showAlert("Error", "Could not retrieve file path from the image: " + e.getMessage()); System.err.println("Error while retrieving filepath during deletion: " + e.getMessage()); } } } } - - uploadedImages.getChildren().removeAll(toRemove); // Removing from the UI - - if (currentDisplayedRemoved) { - selectedImageView.setImage(null); - currentSelectedImageView = null; + if (atLeastOneSelected) { + uploadedImages.getChildren().removeAll(toRemove); + if (currentDisplayedRemoved) { + selectedImageView.setImage(null); + currentSelectedImageView = null; + } + } else { + showAlert("Notice", "No images selected for deletion."); } + // Notify if all images have been deleted if (uploadedImages.getChildren().isEmpty()) { showAlert("Notice", "All images have been deleted."); } } + } diff --git a/src/main/java/util/AnnotationData.java b/src/main/java/util/AnnotationData.java index 172db61c..980107ec 100644 --- a/src/main/java/util/AnnotationData.java +++ b/src/main/java/util/AnnotationData.java @@ -79,10 +79,13 @@ public Rectangle getAnnotation(String path){ /** * Function to delete the Annotation of one Image + * * @param path Image path (Key for the Map) + * @return */ - public void deleteAnnotation(String path){ + public boolean deleteAnnotation(String path){ annotations.remove(path); + return false; } public static AnnotationData getInstance() { From 134e5e4c5309499577e4a97a40c32e6a149b1aa4 Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 17:39:40 +0200 Subject: [PATCH 052/100] Update AnnotationController.java Requirements from Group A and C --- src/main/java/controller/AnnotationController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index a2dc0e49..332b2d35 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -320,7 +320,7 @@ private void handleExportAction(ActionEvent event) { try { String currentImageUrl = selectedImageView.getImage().getUrl(); String currentImageName = new File(new URL(currentImageUrl).toURI().getPath()).getName(); - String initialFileName = currentImageName.substring(0, currentImageName.lastIndexOf('.')) + "_annotations.txt"; + String initialFileName = currentImageName.substring(0, currentImageName.lastIndexOf('.')) + ".txt"; fileChooser.setInitialFileName(initialFileName); } catch (Exception e) { fileChooser.setInitialFileName("default_annotations.txt"); @@ -379,7 +379,7 @@ private void handleExportAllAction(ActionEvent event) { File file = null; try { file = new File(new URL(path).toURI()); - String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + "_annotations.txt"; + String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + ".txt"; File annotationFile = new File(selectedDirectory, fileName); saveAnnotationsToFile(annotationFile, annotation); } catch (Exception e) { From 2951d6ef8366f656f85cc375f4fb53e9fb65098f Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 17:55:13 +0200 Subject: [PATCH 053/100] Update AnnotationController.java Code Optimization --- .../java/controller/AnnotationController.java | 55 ++++--------------- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 332b2d35..7dfbe6af 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -4,7 +4,6 @@ import javafx.fxml.FXML; import javafx.geometry.Insets; import javafx.scene.Node; -import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; @@ -49,9 +48,9 @@ public class AnnotationController implements Controller { private boolean dragged = false; private double annotationPointX, annotationPointY; - private Set uploadedFilePaths = new HashSet<>(); + private final Set uploadedFilePaths = new HashSet<>(); // store the paths of the selected Image, so you can Export the data based on these keys - private Set selectedFilePaths = new HashSet<>(); + private final Set selectedFilePaths = new HashSet<>(); @Override @@ -102,7 +101,7 @@ private void displayImage(File file) { CheckBox checkBox = new CheckBox(); checkBox.setSelected(false); - hbox.setMargin(checkBox, new Insets(10, 30, 10, 10)); + HBox.setMargin(checkBox, new Insets(10, 30, 10, 10)); Image image = new Image(file.toURI().toString()); ImageView imageView = new ImageView(image); @@ -177,7 +176,7 @@ private void selectImage(Image image, ImageView imageView) { } } - public void Select_Next_Image(ActionEvent actionEvent) { + public void Select_Next_Image() { try { if (currentSelectedImageView != null) { int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); @@ -192,7 +191,7 @@ public void Select_Next_Image(ActionEvent actionEvent) { } } - public void Select_Previous_Image(ActionEvent actionEvent) { + public void Select_Previous_Image() { try { if (currentSelectedImageView != null) { int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); @@ -207,7 +206,7 @@ public void Select_Previous_Image(ActionEvent actionEvent) { } } - public void clearAnnotations(ActionEvent actionEvent) { + public void clearAnnotations() { if (annotatedRectangle != null) { annotationPane.getChildren().remove(annotatedRectangle); annotationPane.getChildren().remove(middlePoint); @@ -353,11 +352,9 @@ private void handleExportAllAction(ActionEvent event) { List unannotatedImages = new ArrayList<>(); for (Node node : uploadedImages.getChildren()) { - if (node instanceof HBox) { - HBox hbox = (HBox) node; + if (node instanceof HBox hbox) { for (Node child : hbox.getChildren()) { - if (child instanceof ImageView) { - ImageView imageView = (ImageView) child; + if (child instanceof ImageView imageView) { if (AnnotationData.getInstance().getAnnotation(imageView.getImage().getUrl()) == null) { unannotatedImages.add(new File(imageView.getImage().getUrl()).getName()); } @@ -450,50 +447,18 @@ private void showNoAnnotationAlert() { ///Below Code Now is part of the MainController Class, as it has been approved to be part of the main application - /** - * Handles Dark/Light-Mode based Functionality - * - * @param event The Mouse Event - */ - /* - @FXML - private void handleToggleTheme(ActionEvent event) { - try { - Scene = ((Node) event.getSource()).getScene(); - String lightModeUrl = getClass().getResource("/css/light-mode.css").toExternalForm(); - String darkModeUrl = getClass().getResource("/css/dark-mode.css").toExternalForm(); - - System.out.println("Light Mode URL: " + lightModeUrl); - System.out.println("Dark Mode URL: " + darkModeUrl); - - if (scene.getStylesheets().contains(darkModeUrl)) { - scene.getStylesheets().remove(darkModeUrl); - scene.getStylesheets().add(lightModeUrl); - } else { - scene.getStylesheets().remove(lightModeUrl); - scene.getStylesheets().add(darkModeUrl); - } - } catch (Exception e) { - System.err.println("Error while changing Theme: " + e.getMessage()) ; - showAlert("Error", "Failed to toggle theme."); - } - } - */ - /** * Handles Deleting Functionality - Multiple Deletion Functionality has been also implemented * - * @param event The Mouse Event */ @FXML - public void deletionfunctionality(ActionEvent event) { + public void deletionfunctionality() { List toRemove = new ArrayList<>(); boolean currentDisplayedRemoved = false; boolean atLeastOneSelected = false; // Iterate over each node in the uploadedImages VBox for (Node node : uploadedImages.getChildren()) { - if (node instanceof HBox) { - HBox hbox = (HBox) node; + if (node instanceof HBox hbox) { ImageView imageView = (ImageView) hbox.getChildren().get(0); CheckBox checkBox = (CheckBox) hbox.getChildren().get(1); // Check if the CheckBox is selected for deletion From 2383c5b64f14ba907bde6f60c75daa18a405a84d Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 18:26:41 +0200 Subject: [PATCH 054/100] Update AnnotationController.java --- src/main/java/controller/AnnotationController.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 7dfbe6af..373f4b47 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -83,7 +83,6 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { displayImage(file); uploadedFilePaths.add(file.getAbsolutePath()); } else { - // Optionally, alert the user that the file has already been uploaded showAlert("Duplicate File", "The file " + file.getName() + " has already been uploaded."); } } @@ -95,7 +94,6 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { private void displayImage(File file) { HBox hbox = new HBox(); - //Setting the space between the nodes of a HBox pane hbox.setSpacing(10); CheckBox checkBox = new CheckBox(); @@ -445,7 +443,6 @@ private void showNoAnnotationAlert() { } - ///Below Code Now is part of the MainController Class, as it has been approved to be part of the main application /** * Handles Deleting Functionality - Multiple Deletion Functionality has been also implemented From d1e17a4dbc517ba02e195c2acfb5be921be01d2b Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 18:36:50 +0200 Subject: [PATCH 055/100] Update AnnotationController.java --- .../java/controller/AnnotationController.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 373f4b47..909d743d 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -47,17 +47,13 @@ public class AnnotationController implements Controller { private Circle middlePoint; private boolean dragged = false; private double annotationPointX, annotationPointY; - private final Set uploadedFilePaths = new HashSet<>(); // store the paths of the selected Image, so you can Export the data based on these keys private final Set selectedFilePaths = new HashSet<>(); - - @Override public void initialize(URL location, ResourceBundle resources) { // Initialization code goes here } - @FXML @Override public void close() { @@ -215,7 +211,7 @@ public void clearAnnotations() { } private void checkForExistingAnnotationData() { - // Get Rectangle and 'unnormalize' the values + // Get Rectangle and 'normalize' the values annotationPane.getChildren().remove(annotatedRectangle); annotationPane.getChildren().remove(middlePoint); annotatedRectangle = AnnotationData.getInstance().getAnnotation(selectedImageView.getImage().getUrl()); @@ -277,6 +273,7 @@ private void pressedAnnotationEvent(MouseEvent event) { * * @param event The Mouse Event */ + private void releasedAnnotationEvent(MouseEvent event) { if (!dragged) { annotatedRectangle.setX(annotationPointX - 10); @@ -308,6 +305,7 @@ private void releasedAnnotationEvent(MouseEvent event) { * * @param event The Mouse Event */ + @FXML private void handleExportAction(ActionEvent event) { if (selectedImageView != null && annotatedRectangle != null) { @@ -336,7 +334,6 @@ private void handleExportAction(ActionEvent event) { } } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///Export-All-Functionality----------START @@ -347,7 +344,6 @@ private void handleExportAllAction(ActionEvent event) { showAlert("Export Error", "There are no images to export."); return; } - List unannotatedImages = new ArrayList<>(); for (Node node : uploadedImages.getChildren()) { if (node instanceof HBox hbox) { @@ -364,11 +360,9 @@ private void handleExportAllAction(ActionEvent event) { showUnannotatedImagesAlert(unannotatedImages); return; } - DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Select Directory to Save Annotations"); File selectedDirectory = directoryChooser.showDialog(((Node) event.getSource()).getScene().getWindow()); - if (selectedDirectory != null) { AnnotationData.getInstance().getAnnotations().forEach((path, annotation) -> { File file = null; @@ -413,7 +407,6 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { alert.showAndWait(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///Export-All-Functionality----------END @@ -442,12 +435,11 @@ private void showNoAnnotationAlert() { alert.showAndWait(); } - - /** * Handles Deleting Functionality - Multiple Deletion Functionality has been also implemented * */ + @FXML public void deletionfunctionality() { List toRemove = new ArrayList<>(); @@ -499,4 +491,9 @@ public void deletionfunctionality() { } } + + + + + } From 7e3e08bd2a6476007b517426ddffa513bd6b440f Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 18:39:10 +0200 Subject: [PATCH 056/100] Update AnnotationController.java --- src/main/java/controller/AnnotationController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 909d743d..d30a08f7 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -460,7 +460,7 @@ public void deletionfunctionality() { if (AnnotationData.getInstance().deleteAnnotation(imageView.getImage().getUrl())) { System.out.println("Annotation deleted for image: " + imagePath); } else { - System.out.println("No annotation found or error deleting annotation for image: " + imagePath); + //System.out.println("No annotation found or error deleting annotation for image: " + imagePath); } toRemove.add(node); uploadedFilePaths.remove(imagePath); @@ -495,5 +495,5 @@ public void deletionfunctionality() { - + } From b6a2d2d1070753f98107bc0262f2830e0995ee9a Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Sun, 5 May 2024 20:27:10 +0200 Subject: [PATCH 057/100] Fix-ClearBox-After all of the pictures get deleted --- src/main/java/controller/AnnotationController.java | 1 + src/main/resources/css/dark-mode.css | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index d30a08f7..04629e5b 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -489,6 +489,7 @@ public void deletionfunctionality() { if (uploadedImages.getChildren().isEmpty()) { showAlert("Notice", "All images have been deleted."); } + clearAnnotations(); } diff --git a/src/main/resources/css/dark-mode.css b/src/main/resources/css/dark-mode.css index 1c79e39c..93bad55f 100644 --- a/src/main/resources/css/dark-mode.css +++ b/src/main/resources/css/dark-mode.css @@ -42,3 +42,7 @@ -fx-background-insets: 2; -fx-background-radius: 5; } + +.red-green-checkbox{ + -fx-border-color: red; +} \ No newline at end of file From e362f0f790249f1af36aa6a875a743e38856916c Mon Sep 17 00:00:00 2001 From: osama Date: Tue, 7 May 2024 15:33:17 +0200 Subject: [PATCH 058/100] Removed refrence point checkbox (eugense work) and added choice box (our work(me and friends(yassine and c(ceasar))))) --- src/main/resources/view/AiView.fxml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/resources/view/AiView.fxml b/src/main/resources/view/AiView.fxml index 0a84b3b7..90f7e306 100644 --- a/src/main/resources/view/AiView.fxml +++ b/src/main/resources/view/AiView.fxml @@ -1,11 +1,12 @@ + - + - + @@ -60,12 +61,19 @@ - - - - - + + From 084ab895aa53a6fcb4ac9661e4a10483d05a1c93 Mon Sep 17 00:00:00 2001 From: osama Date: Tue, 7 May 2024 16:24:31 +0200 Subject: [PATCH 059/100] added functionlity to choicebox to allows single point mode --- src/main/java/controller/AiController.java | 36 ++++++++++++++-------- src/main/resources/view/AiView.fxml | 2 +- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/main/java/controller/AiController.java b/src/main/java/controller/AiController.java index 08aeaa2b..9fc83ad8 100644 --- a/src/main/java/controller/AiController.java +++ b/src/main/java/controller/AiController.java @@ -1,8 +1,6 @@ package controller; import algorithm.*; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import inputOutput.ExportMeasurement; import inputOutput.TransformationMatrix; import inputOutput.VideoSource; @@ -17,7 +15,6 @@ import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.scene.control.*; -import javafx.scene.control.Label; import javafx.util.Duration; import org.opencv.core.Core; import org.opencv.core.CvType; @@ -28,7 +25,6 @@ import java.awt.image.BufferedImage; import java.net.URL; import java.util.*; -import java.util.List; import java.util.prefs.Preferences; public class AiController implements Controller { @@ -46,9 +42,9 @@ public class AiController implements Controller { @FXML public PlottableImage videoImagePlot; @FXML - public CheckBox inSetReferenceMode; - @FXML public LineChart lineChart; + @FXML + public ChoiceBox ModeSelection; private Label statusLabel; private Timeline videoTimeline; @@ -68,6 +64,7 @@ public class AiController implements Controller { private Mat cachedTransformMatrix = null; private final XYChart.Series referencePoint = new XYChart.Series(); + private final XYChart.Series referencePoint2 = new XYChart.Series(); private final ObservableList> lineDataSeries = FXCollections.observableArrayList(); NumberAxis xAxis = new NumberAxis(-500, 500, 100); @@ -84,10 +81,6 @@ public void initialize(URL location, ResourceBundle resources) { sourceChoiceBox.getSelectionModel().selectedItemProperty().addListener(x -> changeVideoView()); sourceChoiceBox.setTooltip(new Tooltip("If you have multiple cameras connected, enable \"Search for more videos\" in the settings view to see all available devices")); - referencePoint.setName("reference point"); - referencePoint.getData().add(new XYChart.Data<>(100,100)); - dataSeries.add(referencePoint); - videoImagePlot.setData(dataSeries); videoImagePlot.registerImageClickedHandler(this::onImageClicked); videoImagePlot.registerImageClickedHandler(this::onSRM); @@ -106,13 +99,30 @@ public void initialize(URL location, ResourceBundle resources) { lineChart.setVerticalGridLinesVisible(false); lineChart.lookup(".chart-plot-background").setStyle("-fx-background-color: transparent;"); lineChart.setData(lineDataSeries); + + ModeSelection.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { + dataSeries.clear(); + if (Objects.equals(newValue, "Single Point Mode")) { + dataSeries.add(referencePoint); + } + System.out.println("Selected item: " + newValue ); + // Add your custom code here... + }); } private void onSRM(double v, double v1) { - if (inSetReferenceMode.isSelected()) { - System.out.println("Set reference point to "+v+" "+v1); - referencePoint.setData(FXCollections.observableArrayList(new XYChart.Data<>(v,v1))); + switch (ModeSelection.getValue()){ + case "Single Point Mode": + System.out.println("Set reference point to "+v+" "+v1); + referencePoint.setData(FXCollections.observableArrayList(new XYChart.Data<>(v,v1))); + break; + case "Path Mode": + System.out.println("Pathmmode wow"); + referencePoint.setData(null); + //Add the section here chatgpt + break; } + } @Override diff --git a/src/main/resources/view/AiView.fxml b/src/main/resources/view/AiView.fxml index 90f7e306..f560be5e 100644 --- a/src/main/resources/view/AiView.fxml +++ b/src/main/resources/view/AiView.fxml @@ -63,7 +63,7 @@ - + + + + + + From d75def3a958116ce5a60a38a786fc2571bf7aafa Mon Sep 17 00:00:00 2001 From: muazzamaqeel <128594910+muazzamaqeel@users.noreply.github.com> Date: Fri, 10 May 2024 00:23:29 +0200 Subject: [PATCH 062/100] Update AnnotationController.java --- .../java/controller/AnnotationController.java | 132 ++++++++++-------- 1 file changed, 71 insertions(+), 61 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 04629e5b..a5be9a6e 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -23,7 +23,6 @@ import javafx.stage.Stage; import javafx.stage.DirectoryChooser; import util.AnnotationData; - import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; @@ -50,9 +49,18 @@ public class AnnotationController implements Controller { private final Set uploadedFilePaths = new HashSet<>(); // store the paths of the selected Image, so you can Export the data based on these keys private final Set selectedFilePaths = new HashSet<>(); + private int currentImageIndex = 0; // Default to the first image + private final List imageList = new ArrayList<>(); // Store all loaded images + @Override public void initialize(URL location, ResourceBundle resources) { - // Initialization code goes here + System.out.println("Initializing Controller"); + if (selectedImageView == null) { + System.out.println("Error: selectedImageView is null"); + } + if (uploadedImages == null) { + System.out.println("Error: uploadedImages is null"); + } } @FXML @Override @@ -98,6 +106,7 @@ private void displayImage(File file) { HBox.setMargin(checkBox, new Insets(10, 30, 10, 10)); Image image = new Image(file.toURI().toString()); + imageList.add(image); // Adding the image to the list ImageView imageView = new ImageView(image); imageView.setFitHeight(100); imageView.setFitWidth(100); @@ -121,85 +130,86 @@ private void displayImage(File file) { } private void selectImage(Image image, ImageView imageView) { - if (selectedImageView != null && currentSelectedImageView != imageView) { + try { + // Check if the necessary UI components are available + if (selectedImageView == null) { + System.out.println("Error: selectedImageView is not initialized."); + return; + } + + // Update the display image selectedImageView.setImage(image); selectedImageView.setFitWidth(selectedImageView.getScene().getWidth()); selectedImageView.setPreserveRatio(true); - annotationPane.getTransforms().clear(); - // Create a new Scale transformation for the ImageView - Scale scale = new Scale(); - annotationPane.getTransforms().add(scale); - - // Add a ScrollEvent handler to the ScrollPane - annotationPane.setOnScroll(event -> { - if (event.isControlDown()) { - - - // Adjust the pivot points to the mouse's current position - scale.setPivotX(event.getX()); - scale.setPivotY(event.getY()); + // Reset style of previously selected image if it exists + if (currentSelectedImageView != null && currentSelectedImageView != imageView) { + currentSelectedImageView.setStyle(""); // Remove any special styling + } - double zoomFactor = 1.05; + // Highlight the new selected image view if it's not null + if (imageView != null) { + currentSelectedImageView = imageView; + imageView.setStyle("-fx-effect: dropshadow(three-pass-box, deepskyblue, 10, 0, 0, 0); -fx-border-color: blue; -fx-border-width: 2;"); + } - if (event.getDeltaY() > 0) { - // Zoom in - scale.setX(scale.getX() * zoomFactor); - scale.setY(scale.getY() * zoomFactor); - } else { - // Zoom out, but do not go below a certain minimum value - if (scale.getX() > 1.0 && scale.getY() > 1.0) { + // Scroll to the selected image + scrollToSelectedImage(); + + // Update annotation pane if necessary + if (annotationPane != null) { + annotationPane.getTransforms().clear(); + Scale scale = new Scale(); + annotationPane.getTransforms().add(scale); + + // Handle scroll events for zooming + annotationPane.setOnScroll(event -> { + if (event.isControlDown()) { + double zoomFactor = 1.05; + scale.setPivotX(event.getX()); + scale.setPivotY(event.getY()); + + if (event.getDeltaY() > 0) { + scale.setX(scale.getX() * zoomFactor); + scale.setY(scale.getY() * zoomFactor); + } else if (scale.getX() > 1.0 && scale.getY() > 1.0) { scale.setX(scale.getX() / zoomFactor); scale.setY(scale.getY() / zoomFactor); } + event.consume(); } - - event.consume(); - } - }); - - if (currentSelectedImageView != null) { - currentSelectedImageView.setStyle(""); + }); } - imageView.setStyle("-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);"); - currentSelectedImageView = imageView; + + // Check and load existing annotation data checkForExistingAnnotationData(); - selectedImageView.setOnMouseDragged(this::dragAnnotationEvent); - selectedImageView.setOnMousePressed(this::pressedAnnotationEvent); - selectedImageView.setOnMouseReleased(this::releasedAnnotationEvent); + + } catch (Exception e) { + System.out.println("Exception in selectImage: " + e.getMessage()); + e.printStackTrace(); + } + } + private void scrollToSelectedImage() { + if (currentSelectedImageView != null && selectedImagePane != null) { + double viewportHeight = selectedImagePane.getHeight(); + double imageY = currentSelectedImageView.localToScene(currentSelectedImageView.getBoundsInLocal()).getMinY(); + double offsetY = imageY - selectedImagePane.getScene().getY() - viewportHeight / 2 + currentSelectedImageView.getBoundsInLocal().getHeight() / 2; + double vValue = offsetY / (uploadedImages.getHeight() - viewportHeight); + selectedImagePane.setVvalue(Math.max(0, Math.min(vValue, 1))); // Clamp vValue to be between 0 and 1 } } - public void Select_Next_Image() { - try { - if (currentSelectedImageView != null) { - int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); - if (currentIndex < uploadedImages.getChildren().size() - 1) { - ImageView nextImageView = (ImageView) uploadedImages.getChildren().get(currentIndex + 1); - Image image = nextImageView.getImage(); - selectImage(image, nextImageView); - } - } - } catch (Exception e) { - System.err.println("Error while selecting next Image: " + e.getMessage()); + if (currentImageIndex < imageList.size() - 1) { + currentImageIndex++; + selectImage(imageList.get(currentImageIndex), null); // Update the image display } } - public void Select_Previous_Image() { - try { - if (currentSelectedImageView != null) { - int currentIndex = uploadedImages.getChildren().indexOf(currentSelectedImageView); - if (currentIndex > 0) { - ImageView previousImageView = (ImageView) uploadedImages.getChildren().get(currentIndex - 1); - Image image = previousImageView.getImage(); - selectImage(image, previousImageView); - } - } - } catch (Exception e) { - System.err.println("Error while selecting previous Image: " + e.getMessage()); + if (currentImageIndex > 0) { + currentImageIndex--; + selectImage(imageList.get(currentImageIndex), null); // Update the image display } } - public void clearAnnotations() { if (annotatedRectangle != null) { annotationPane.getChildren().remove(annotatedRectangle); From 84c1df98f9df04c21805228857033bb5956c7ca5 Mon Sep 17 00:00:00 2001 From: muazzamaqeel Date: Mon, 13 May 2024 00:11:06 +0200 Subject: [PATCH 063/100] Left-Right Button Fix + Annotation Code adjustment a lot of refracting had to be done, because there is a lot of dependency problems generally with the code but now most of the bugs have been fixed for example: 1. Export All functionality 2. Undeleted Pictures (With respect to the arrow key buttons) --- .../java/controller/AnnotationController.java | 230 ++++++++++++------ src/main/resources/view/AnnotationView.fxml | 4 +- 2 files changed, 162 insertions(+), 72 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index a5be9a6e..f5f0b929 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -28,6 +28,7 @@ import java.io.PrintWriter; import java.net.URL; import java.util.*; +import java.util.stream.Collectors; public class AnnotationController implements Controller { @FXML @@ -51,16 +52,66 @@ public class AnnotationController implements Controller { private final Set selectedFilePaths = new HashSet<>(); private int currentImageIndex = 0; // Default to the first image private final List imageList = new ArrayList<>(); // Store all loaded images - @Override public void initialize(URL location, ResourceBundle resources) { System.out.println("Initializing Controller"); - if (selectedImageView == null) { - System.out.println("Error: selectedImageView is null"); + if (annotationPane != null) { + setupAnnotationHandlers(); + } + + uploadedImages.setFocusTraversable(true); + uploadedImages.setOnKeyPressed(event -> { + switch (event.getCode()) { + case RIGHT: + selectNextImage(); + break; + case LEFT: + selectPreviousImage(); + break; + default: + break; + } + }); + } + private void setupAnnotationHandlers() { + annotationPane.setOnMousePressed(this::pressedAnnotationEvent); + annotationPane.setOnMouseDragged(this::dragAnnotationEvent); + annotationPane.setOnMouseReleased(this::releasedAnnotationEvent); + } + public void selectNextImage() { + // Check if there's a next image in the list + if (currentImageIndex < imageList.size() - 1) { + currentImageIndex++; + Image nextImage = imageList.get(currentImageIndex); + ImageView nextImageView = findImageViewForImage(nextImage); + selectImage(nextImage, nextImageView); + } else { + System.out.println("No next image available."); + } + } + + public void selectPreviousImage() { + // Check if there's a previous image in the list + if (currentImageIndex > 0) { + currentImageIndex--; + Image prevImage = imageList.get(currentImageIndex); + ImageView prevImageView = findImageViewForImage(prevImage); + selectImage(prevImage, prevImageView); + } else { + System.out.println("No previous image available."); } - if (uploadedImages == null) { - System.out.println("Error: uploadedImages is null"); + } + + private ImageView findImageViewForImage(Image image) { + for (Node node : uploadedImages.getChildren()) { + if (node instanceof HBox) { + ImageView imageView = (ImageView) ((HBox) node).getChildren().get(0); + if (imageView.getImage().equals(image)) { + return imageView; + } + } } + return null; // Not found } @FXML @Override @@ -68,6 +119,16 @@ public void close() { unregisterController(); } + + + + + + + + + + @FXML public void Handle_Upload_Functionality(ActionEvent actionEvent) { try { @@ -95,7 +156,6 @@ public void Handle_Upload_Functionality(ActionEvent actionEvent) { System.err.println("Error while choosing File: " + e.getMessage()); } } - private void displayImage(File file) { HBox hbox = new HBox(); hbox.setSpacing(10); @@ -131,6 +191,20 @@ private void displayImage(File file) { private void selectImage(Image image, ImageView imageView) { try { + // Ensure there are images in the list before attempting to select one + if (imageList.isEmpty()) { + selectedImageView.setImage(null); + System.out.println("No images to display."); + return; + } + + // Update the current image index to the selected image's index in the list + currentImageIndex = imageList.indexOf(image); + if (currentImageIndex == -1) { // If the image is not found in the list, log an error + System.out.println("Selected image is not in the image list."); + return; + } + // Check if the necessary UI components are available if (selectedImageView == null) { System.out.println("Error: selectedImageView is not initialized."); @@ -142,7 +216,7 @@ private void selectImage(Image image, ImageView imageView) { selectedImageView.setFitWidth(selectedImageView.getScene().getWidth()); selectedImageView.setPreserveRatio(true); - // Reset style of previously selected image if it exists + // Reset style of previously selected image view, if it exists if (currentSelectedImageView != null && currentSelectedImageView != imageView) { currentSelectedImageView.setStyle(""); // Remove any special styling } @@ -153,7 +227,7 @@ private void selectImage(Image image, ImageView imageView) { imageView.setStyle("-fx-effect: dropshadow(three-pass-box, deepskyblue, 10, 0, 0, 0); -fx-border-color: blue; -fx-border-width: 2;"); } - // Scroll to the selected image + // Scroll to the selected image in the scroll pane scrollToSelectedImage(); // Update annotation pane if necessary @@ -181,7 +255,7 @@ private void selectImage(Image image, ImageView imageView) { }); } - // Check and load existing annotation data + // Check and load existing annotation data if available checkForExistingAnnotationData(); } catch (Exception e) { @@ -198,18 +272,6 @@ private void scrollToSelectedImage() { selectedImagePane.setVvalue(Math.max(0, Math.min(vValue, 1))); // Clamp vValue to be between 0 and 1 } } - public void Select_Next_Image() { - if (currentImageIndex < imageList.size() - 1) { - currentImageIndex++; - selectImage(imageList.get(currentImageIndex), null); // Update the image display - } - } - public void Select_Previous_Image() { - if (currentImageIndex > 0) { - currentImageIndex--; - selectImage(imageList.get(currentImageIndex), null); // Update the image display - } - } public void clearAnnotations() { if (annotatedRectangle != null) { annotationPane.getChildren().remove(annotatedRectangle); @@ -221,25 +283,32 @@ public void clearAnnotations() { } private void checkForExistingAnnotationData() { - // Get Rectangle and 'normalize' the values - annotationPane.getChildren().remove(annotatedRectangle); - annotationPane.getChildren().remove(middlePoint); - annotatedRectangle = AnnotationData.getInstance().getAnnotation(selectedImageView.getImage().getUrl()); + // Clear existing annotations if any + if (annotatedRectangle != null) { + annotationPane.getChildren().remove(annotatedRectangle); + annotatedRectangle = null; + } if (middlePoint != null) { + annotationPane.getChildren().remove(middlePoint); middlePoint = null; } + + // Reload annotation if it exists + annotatedRectangle = AnnotationData.getInstance().getAnnotation(selectedImageView.getImage().getUrl()); if (annotatedRectangle != null) { + // Apply the transformations to the rectangle to match the image dimensions annotatedRectangle.setX(annotatedRectangle.getX() * selectedImageView.getImage().getWidth()); annotatedRectangle.setY(annotatedRectangle.getY() * selectedImageView.getImage().getHeight()); annotatedRectangle.setWidth(annotatedRectangle.getWidth() * selectedImageView.getImage().getWidth()); annotatedRectangle.setHeight(annotatedRectangle.getHeight() * selectedImageView.getImage().getHeight()); + annotationPane.getChildren().add(annotatedRectangle); + middlePoint = new Circle(0, 0, 2); middlePoint.setFill(Color.rgb(6, 207, 236)); middlePoint.setCenterX(annotatedRectangle.getX() + (annotatedRectangle.getWidth() / 2)); middlePoint.setCenterY(annotatedRectangle.getY() + (annotatedRectangle.getHeight() / 2)); annotationPane.getChildren().add(middlePoint); - } } @@ -283,7 +352,6 @@ private void pressedAnnotationEvent(MouseEvent event) { * * @param event The Mouse Event */ - private void releasedAnnotationEvent(MouseEvent event) { if (!dragged) { annotatedRectangle.setX(annotationPointX - 10); @@ -315,7 +383,6 @@ private void releasedAnnotationEvent(MouseEvent event) { * * @param event The Mouse Event */ - @FXML private void handleExportAction(ActionEvent event) { if (selectedImageView != null && annotatedRectangle != null) { @@ -344,47 +411,60 @@ private void handleExportAction(ActionEvent event) { } } + + + + + + + + + + + + + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///Export-All-Functionality----------START @FXML private void handleExportAllAction(ActionEvent event) { - // Checking if there are no images uploaded + // Check if there are no images uploaded if (uploadedImages.getChildren().isEmpty()) { showAlert("Export Error", "There are no images to export."); return; } - List unannotatedImages = new ArrayList<>(); - for (Node node : uploadedImages.getChildren()) { - if (node instanceof HBox hbox) { - for (Node child : hbox.getChildren()) { - if (child instanceof ImageView imageView) { - if (AnnotationData.getInstance().getAnnotation(imageView.getImage().getUrl()) == null) { - unannotatedImages.add(new File(imageView.getImage().getUrl()).getName()); - } - } - } - } - } - if (!unannotatedImages.isEmpty()) { - showUnannotatedImagesAlert(unannotatedImages); - return; - } + + // Collect currently displayed images' URLs + Set displayedImagesUrls = uploadedImages.getChildren().stream() + .filter(node -> node instanceof HBox) + .map(node -> (HBox) node) + .map(hbox -> (ImageView) hbox.getChildren().get(0)) + .map(ImageView::getImage) + .map(Image::getUrl) + .collect(Collectors.toSet()); + + // Directory chooser for user to select where to save annotations DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Select Directory to Save Annotations"); File selectedDirectory = directoryChooser.showDialog(((Node) event.getSource()).getScene().getWindow()); + if (selectedDirectory != null) { - AnnotationData.getInstance().getAnnotations().forEach((path, annotation) -> { - File file = null; - try { - file = new File(new URL(path).toURI()); - String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + ".txt"; - File annotationFile = new File(selectedDirectory, fileName); - saveAnnotationsToFile(annotationFile, annotation); - } catch (Exception e) { - showAlert("Error", "Failed to save annotations for " + path); - } - }); + // Iterate over each annotation and save only those that match the displayed images + AnnotationData.getInstance().getAnnotations().entrySet().stream() + .filter(entry -> displayedImagesUrls.contains(entry.getKey())) + .forEach(entry -> { + try { + String path = entry.getKey(); + File file = new File(new URL(path).toURI()); + String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')) + ".txt"; + File annotationFile = new File(selectedDirectory, fileName); + saveAnnotationsToFile(annotationFile, entry.getValue()); + } catch (Exception e) { + showAlert("Error", "Failed to save annotations for " + entry.getKey()); + } + }); } } @@ -421,6 +501,23 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { ///Export-All-Functionality----------END + + + + + + + + + + + + + + + + + /** * Handles the Saving of Annotations to a File * @@ -430,7 +527,9 @@ private void showUnannotatedImagesAlert(List unannotatedImages) { private void saveAnnotationsToFile(File file, AnnotationData.PublicAnnotation annotation) { try (PrintWriter writer = new PrintWriter(file)) { - String line = String.format("%d %.5f %.5f %.5f %.5f", 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); + String line = String.format("%d %.5f %.5f %.5f %.5f", + 0, annotation.getMiddlePointX(), annotation.getMiddlePointY(), + annotation.getBoundingBoxWidth(), annotation.getBoundingBoxHeight()); writer.println(line); } catch (FileNotFoundException e) { System.err.println("Error while saving Annotation to File: " + e.getMessage()); @@ -453,25 +552,19 @@ private void showNoAnnotationAlert() { @FXML public void deletionfunctionality() { List toRemove = new ArrayList<>(); + List imagesToRemove = new ArrayList<>(); boolean currentDisplayedRemoved = false; boolean atLeastOneSelected = false; - // Iterate over each node in the uploadedImages VBox for (Node node : uploadedImages.getChildren()) { if (node instanceof HBox hbox) { ImageView imageView = (ImageView) hbox.getChildren().get(0); CheckBox checkBox = (CheckBox) hbox.getChildren().get(1); - // Check if the CheckBox is selected for deletion if (checkBox.isSelected()) { atLeastOneSelected = true; String imagePath = null; try { imagePath = new File(new URL(imageView.getImage().getUrl()).toURI()).getAbsolutePath(); - // Delete annotation from AnnotationData - if (AnnotationData.getInstance().deleteAnnotation(imageView.getImage().getUrl())) { - System.out.println("Annotation deleted for image: " + imagePath); - } else { - //System.out.println("No annotation found or error deleting annotation for image: " + imagePath); - } + imagesToRemove.add(imageView.getImage()); toRemove.add(node); uploadedFilePaths.remove(imagePath); selectedFilePaths.remove(imagePath); @@ -487,9 +580,11 @@ public void deletionfunctionality() { } if (atLeastOneSelected) { uploadedImages.getChildren().removeAll(toRemove); + imageList.removeAll(imagesToRemove); if (currentDisplayedRemoved) { selectedImageView.setImage(null); currentSelectedImageView = null; + currentImageIndex = Math.min(currentImageIndex, imageList.size() - 1); } } else { showAlert("Notice", "No images selected for deletion."); @@ -502,9 +597,4 @@ public void deletionfunctionality() { clearAnnotations(); } - - - - - } diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index c307c991..e9608517 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -24,12 +24,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - + + + + + + + + + + + + + + + + + + +
- - + + + + + + + + + + + + +
+ + + + + + + + + + +
+ From 68105fdee1af11ca6b1a07871ee5828f0d95ad20 Mon Sep 17 00:00:00 2001 From: muazzamaqeel Date: Tue, 14 May 2024 00:15:46 +0200 Subject: [PATCH 074/100] Update AnnotationController.java --- src/main/java/controller/AnnotationController.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 9ddbabf8..9b55fd39 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -342,7 +342,6 @@ private void releasedAnnotationEvent(MouseEvent event) { ); } - ///Export-Functionality---------- START @FXML private void handleExportAction(ActionEvent event) { if (uploadedImages.getChildren().isEmpty()) { @@ -455,8 +454,6 @@ private void showAlert(String title, String content) { alert.setContentText(content); alert.showAndWait(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ///Export-Functionality----------END /** * Handles the Saving of Annotations to a File * From 0dbeb97622642b5682804e0817a730fc7f3fa6c4 Mon Sep 17 00:00:00 2001 From: muazzamaqeel Date: Tue, 14 May 2024 11:37:58 +0200 Subject: [PATCH 075/100] Help Section - Full Functionality --- .../java/controller/AnnotationController.java | 68 ++++++++++++++++++- src/main/resources/view/AnnotationView.fxml | 10 ++- 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 9b55fd39..e11ce33e 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -1,8 +1,12 @@ package controller; + +import javafx.animation.FadeTransition; import javafx.event.ActionEvent; import javafx.fxml.FXML; +import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.scene.Node; +import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; @@ -10,17 +14,22 @@ import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; +import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Rectangle; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; import javafx.scene.text.Text; import javafx.scene.transform.Scale; +import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; +import javafx.stage.Modality; import javafx.stage.Stage; -import javafx.stage.DirectoryChooser; +import javafx.util.Duration; import util.AnnotationData; import java.io.File; import java.io.FileNotFoundException; @@ -38,6 +47,7 @@ public class AnnotationController implements Controller { public Button ExportButtonAll; public Button ExportButton; public Button clearMarksButton; + public Button helpButton; @FXML private ImageView selectedImageView; private ImageView currentSelectedImageView; @@ -516,4 +526,60 @@ public void deletionfunctionality() { } clearAnnotations(); } + @FXML + public void handleHelpButtonAction() { + try { + Stage helpStage = new Stage(); + helpStage.initModality(Modality.APPLICATION_MODAL); + helpStage.setTitle("Help"); + VBox helpContent = new VBox(); + helpContent.setPadding(new Insets(10)); + helpContent.setSpacing(10); + helpContent.setStyle("-fx-background-color: #f0f0f0; -fx-border-radius: 10; -fx-background-radius: 10;"); + GridPane helpGrid = getHelpGrid(); + helpGrid.setPadding(new Insets(10)); + helpGrid.setVgap(10); + helpGrid.setHgap(10); + helpGrid.setStyle("-fx-background-color: #ffffff; -fx-border-radius: 10; -fx-background-radius: 10; -fx-border-color: #cccccc; -fx-border-width: 1;"); + helpContent.getChildren().add(helpGrid); + Scene helpScene = new Scene(helpContent); + FadeTransition fadeIn = new FadeTransition(Duration.millis(500), helpContent); + fadeIn.setFromValue(0.0); + fadeIn.setToValue(1.0); + fadeIn.play(); + helpStage.setScene(helpScene); + helpStage.sizeToScene(); + helpStage.showAndWait(); + } catch (Exception e) { + System.err.println("Error while opening Help window: " + e.getMessage()); + } + } + private static GridPane getHelpGrid() { + String[][] helpTextArray = { + {"Import", "Click this button to import images into the tool."}, + {"Clear Marks", "Click this button to clear all annotation marks from the currently displayed image."}, + {"Delete", "Click this button to delete the selected images from the tool."}, + {"Specific Export", "Click this button to export annotations for the selected images."}, + {"Export All", "Click this button to export annotations for all images."}, + {"Next", "Click this button to navigate to the next image."}, + {"Previous", "Click this button to navigate to the previous image."}, + {"", "To annotate an image, click and drag to create a bounding box. Hold down the Ctrl key to resize the bounding box."} + }; + GridPane gridPane = new GridPane(); + gridPane.setPadding(new Insets(10)); + gridPane.setVgap(10); + gridPane.setHgap(10); + for (int i = 0; i < helpTextArray.length; i++) { + String[] helpEntry = helpTextArray[i]; + Text buttonName = new Text(helpEntry[0]); + buttonName.setFont(Font.font("Arial", FontWeight.BOLD, 16)); + GridPane.setHalignment(buttonName, HPos.LEFT); + Text description = new Text(helpEntry[1]); + description.setFont(Font.font("Arial", 16)); + GridPane.setHalignment(description, HPos.LEFT); + gridPane.add(buttonName, 0, i); + gridPane.add(description, 1, i); + } + return gridPane; + } } diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index 858f3d94..e44ccd05 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -7,8 +7,8 @@ - + @@ -33,7 +33,7 @@ - +
From 09bc8613c7ddbc70adc4b6f2b231f6d5656380c4 Mon Sep 17 00:00:00 2001 From: Simon Engel Date: Wed, 15 May 2024 10:39:01 +0200 Subject: [PATCH 078/100] Added Keybinding toHelp Window --- src/main/java/controller/AnnotationController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index e11ce33e..00767e6c 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -563,7 +563,12 @@ private static GridPane getHelpGrid() { {"Export All", "Click this button to export annotations for all images."}, {"Next", "Click this button to navigate to the next image."}, {"Previous", "Click this button to navigate to the previous image."}, - {"", "To annotate an image, click and drag to create a bounding box. Hold down the Ctrl key to resize the bounding box."} + {"", "To annotate an image, click and drag to create a bounding box. Hold down the Ctrl key to resize the bounding box."}, + {"Special Keybindnings:", ""}, + {"Ctrl + Mousewheel (on an image): ", "Zoom"}, + {"Ctrl + Mouse drag (on an image): ", "Custom sized annotation box"}, + {"Arrows: ", "Move zoomed images"} + }; GridPane gridPane = new GridPane(); gridPane.setPadding(new Insets(10)); From e66fcc262730acea1f29cca10623f45f014a8d5c Mon Sep 17 00:00:00 2001 From: Simon Engel Date: Wed, 15 May 2024 10:39:56 +0200 Subject: [PATCH 079/100] Added Keybinding toHelp Window --- src/main/java/controller/AnnotationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/controller/AnnotationController.java b/src/main/java/controller/AnnotationController.java index 00767e6c..ece8ce47 100644 --- a/src/main/java/controller/AnnotationController.java +++ b/src/main/java/controller/AnnotationController.java @@ -564,7 +564,7 @@ private static GridPane getHelpGrid() { {"Next", "Click this button to navigate to the next image."}, {"Previous", "Click this button to navigate to the previous image."}, {"", "To annotate an image, click and drag to create a bounding box. Hold down the Ctrl key to resize the bounding box."}, - {"Special Keybindnings:", ""}, + {"Special Keybindings:", ""}, {"Ctrl + Mousewheel (on an image): ", "Zoom"}, {"Ctrl + Mouse drag (on an image): ", "Custom sized annotation box"}, {"Arrows: ", "Move zoomed images"} From cc511e544ddb9bd44876cf179d27230aee32a1f3 Mon Sep 17 00:00:00 2001 From: muazzamaqeel Date: Wed, 15 May 2024 11:12:57 +0200 Subject: [PATCH 080/100] Update AnnotationView.fxml --- src/main/resources/view/AnnotationView.fxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/view/AnnotationView.fxml b/src/main/resources/view/AnnotationView.fxml index e44ccd05..a4033b79 100644 --- a/src/main/resources/view/AnnotationView.fxml +++ b/src/main/resources/view/AnnotationView.fxml @@ -53,7 +53,7 @@ - + + - - - - +