Skip to content

Commit

Permalink
Merge pull request #5 from qupath/stylesheet-in-command
Browse files Browse the repository at this point in the history
Added stylesheet property to viewer command
  • Loading branch information
Rylern authored May 24, 2024
2 parents 4f6b1ee + de76250 commit 699c007
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class JavadocViewer extends BorderPane {
* Create the javadoc viewer.
*
* @param stylesheet a property containing a link to a stylesheet which should
* be applied by this viewer. Can be null
* be applied to this viewer. Can be null
* @param urisToSearch URIs to search for Javadocs. See {@link JavadocsFinder#findJavadocs(URI...)}
* @throws IOException when the window creation fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@
public class JavadocViewerCommand implements Runnable {

private final Stage owner;
private final ReadOnlyStringProperty stylesheet;
private final URI[] urisToSearch;
private Stage stage;

/**
* Create the command. This will not create the viewer yet.
*
* @param owner the stage that should own the viewer window. Can be null
* @param stylesheet a property containing a link to a stylesheet which should
* be applied to the viewer. Can be null
* @param urisToSearch URIs to search for Javadocs. See {@link JavadocViewer#JavadocViewer(ReadOnlyStringProperty, URI...)}
*/
public JavadocViewerCommand(Stage owner, URI... urisToSearch) {
public JavadocViewerCommand(Stage owner, ReadOnlyStringProperty stylesheet, URI... urisToSearch) {
this.owner = owner;
this.stylesheet = stylesheet;
this.urisToSearch = urisToSearch;
}

Expand All @@ -37,7 +41,7 @@ public void run() {
stage.initOwner(owner);
}

JavadocViewer javadocViewer = new JavadocViewer(null, urisToSearch);
JavadocViewer javadocViewer = new JavadocViewer(stylesheet, urisToSearch);

Scene scene = new Scene(javadocViewer);
stage.setScene(scene);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.category-text {
-fx-fill: -fx-text-background-color;
-fx-font-family: "Arial";
-fx-font-weight: bold;
}

Expand All @@ -10,6 +9,5 @@

.highlighted-text {
-fx-fill: orange;
-fx-font-family: "Arial";
-fx-font-weight: bold;
}

0 comments on commit 699c007

Please sign in to comment.