diff --git a/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java index d3cc427f4a70084dc0d8cb339bc99a298cf5fe11..499b4555a4b14ad8cd4d3cd429e92d7a61ed868b 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java +++ b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java @@ -47,7 +47,7 @@ public class ViewAlbum implements Initializable { public Text album_descField; public Pane metadata_pane; - public Button create_album_pdf; + public Button create_album_document; public ImageView main_picture; @@ -368,15 +368,15 @@ public class ViewAlbum implements Initializable { } /** - * Create and save album pdf to users downloads directory. + * Retrieve and display album document. * * @param actionEvent */ - public void createPdf(ActionEvent actionEvent) { + public void createDocument(ActionEvent actionEvent) { Long currentAlbumId = App.ex.getChosenAlbumId(); ImageAlbumDocument document = imageAlbumService.getDocument(currentAlbumId); - displayPdfLink(document.getDocument()); + displayDocumentLink(document.getDocument()); } /** @@ -384,9 +384,9 @@ public class ViewAlbum implements Initializable { * * @param pdfDocument the pdf document to be opened */ - private void displayPdfLink(File pdfDocument) { - create_album_pdf.setText("Open PDF"); - create_album_pdf.setOnAction(actionEvent -> openPdfDocument(actionEvent, pdfDocument)); + private void displayDocumentLink(File pdfDocument) { + create_album_document.setText("Open PDF"); + create_album_document.setOnAction(actionEvent -> openDocument(actionEvent, pdfDocument)); } /** @@ -395,7 +395,7 @@ public class ViewAlbum implements Initializable { * @param actionEvent * @param file the file to open */ - private void openPdfDocument(ActionEvent actionEvent, File file) { + private void openDocument(ActionEvent actionEvent, File file) { HostServices hostServices = App.ex.getHostServices(); hostServices.showDocument(file.getAbsolutePath()); } diff --git a/src/main/resources/NTNU/IDATT1002/view_album.fxml b/src/main/resources/NTNU/IDATT1002/view_album.fxml index 2a31bec933c22565f328130c2abb6ccfc924fede..08871ee0b36cc45e29224fde86003f6f37086b4c 100644 --- a/src/main/resources/NTNU/IDATT1002/view_album.fxml +++ b/src/main/resources/NTNU/IDATT1002/view_album.fxml @@ -104,7 +104,7 @@ </font> </Text> <Pane fx:id="metadata_pane" layoutX="76.0" layoutY="371.0" prefHeight="391.0" prefWidth="822.0" style="-fx-background-color: #ffffff;" /> - <Button fx:id="create_album_pdf" layoutX="394.0" layoutY="810.0" mnemonicParsing="false" onAction="#createPdf" text="CREATE ALBUM PDF"> + <Button fx:id="create_album_document" layoutX="394.0" layoutY="810.0" mnemonicParsing="false" onAction="#createDocument" text="CREATE ALBUM PDF"> <font> <Font size="18.0" /> </font>