Skip to content

Commit

Permalink
added javadoc for the functions that we have written
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhnguyen123-dev committed Oct 20, 2024
1 parent 4053378 commit 492017d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ public void showAndEdit(BibEntry entry) {
}

/**
* A5 tests - this is meant to show the book cover next to the MainTable with all the citations
* Show the book cover of the given entry.
*
* @param entry
* @param entry the entry to show the book cover for
*/
public void showBookCover(BibEntry entry) {
if (!splitPaneUpper.getItems().contains(bookCover)) {
Expand All @@ -626,7 +626,7 @@ public void showBookCover(BibEntry entry) {
);
} catch (Exception e) {
LOGGER.error("Failed to load default image", e);
bookCover.setBackground(null); // Set a fallback background or handle the error appropriately
bookCover.setBackground(null);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public MainTable(MainTableDataModel model,
new ViewModelTableRowFactory<BibEntryTableViewModel>()
.withOnMouseClickedEvent((entry, event) -> {
if (event.getClickCount() == 1) {
// test
libraryTab.showBookCover(entry.getEntry());
}
if (event.getClickCount() == 2) {
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/jabref/model/entry/BibEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,9 @@ public Optional<ISBN> getISBN() {
}

/**
* A5 tests
* Returns a newly made Image object, made using the path to the cover image stored in the
* Files field
* @return
* Files field. If an image has a "cover" description, it is returned as the first priority.
* @return optional image
*/
public Optional<Image> getCoverImage() {
Optional<Image> firstImage = Optional.empty();
Expand All @@ -795,8 +794,7 @@ public Optional<Image> getCoverImage() {

/**
* checks if the file is an image
* @param file
* @return
* @return true if the file is an image
*/
private boolean isImage(LinkedFile file) {
return "jpg".equalsIgnoreCase(file.getFileType()) || "png".equalsIgnoreCase(file.getFileType())
Expand Down

0 comments on commit 492017d

Please sign in to comment.