-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2692 from JabRef/pdfViewer
Add PDF Viewer
- Loading branch information
Showing
59 changed files
with
1,215 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/org/jabref/gui/documentviewer/DocumentPageViewModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jabref.gui.documentviewer; | ||
|
||
import javafx.scene.image.Image; | ||
|
||
/** | ||
* Represents the view model for a page in the document viewer. | ||
*/ | ||
public abstract class DocumentPageViewModel { | ||
|
||
/** | ||
* Renders this page and returns an image representation of itself. | ||
* @param width | ||
* @param height | ||
*/ | ||
public abstract Image render(int width, int height); | ||
|
||
/** | ||
* Get the page number of the current page in the document. | ||
*/ | ||
public abstract int getPageNumber(); | ||
|
||
/** | ||
* Calculates the aspect ratio (width / height) of the page. | ||
*/ | ||
public abstract double getAspectRatio(); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/org/jabref/gui/documentviewer/DocumentViewModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jabref.gui.documentviewer; | ||
|
||
import javafx.beans.property.IntegerProperty; | ||
import javafx.beans.property.SimpleIntegerProperty; | ||
import javafx.collections.ObservableList; | ||
|
||
public abstract class DocumentViewModel { | ||
private IntegerProperty maxPages = new SimpleIntegerProperty(); | ||
|
||
public abstract ObservableList<DocumentPageViewModel> getPages(); | ||
|
||
public int getMaxPages() { | ||
return maxPages.get(); | ||
} | ||
|
||
public IntegerProperty maxPagesProperty() { | ||
return maxPages; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/jabref/gui/documentviewer/DocumentViewer.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#mainPane { | ||
-fx-background-color: -fx-accented-background; | ||
-fx-padding: 0; | ||
} | ||
|
||
.document-viewer .page { | ||
-fx-padding: 0em 0em 1em 0em; | ||
-fx-background-insets: 0; | ||
} | ||
|
Oops, something went wrong.