Package qupath.ext.training.ui.tour
Class MarkdownTourItem
java.lang.Object
qupath.ext.training.ui.tour.MarkdownTourItem
- All Implemented Interfaces:
TourItem
An implementation of
TourItem that uses resource bundles, markdown and WebViews to display content.
This implementation takes a resource bundle key, and uses it to look up the title and text to display. The text is assumed to be markdown, and is rendered as HTML.
The item can also provide an image, which can optionally be generated on demand.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TourItemcreate(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes) Create a new tour item.javafx.scene.NodeCreate a content page to display for this item.static TourItemcreateWithImage(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes, Supplier<javafx.scene.image.Image> imageSupplier) Create a new tour item with a lazily-generated image.static TourItemcreateWithImage(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes, javafx.scene.image.Image image) Create a new tour item with a specific (static) image.List<javafx.scene.Node> Get an unmodifiable list of nodes to display.javafx.scene.image.ImagegetImage()Get a static image to display, or null if no static image is stored.getText()Get the main text to display, formatted as markdown.getTitle()Get the title to display.toString()
-
Method Details
-
create
public static TourItem create(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes) Create a new tour item. If nodes are provided, this will lazily generate a snapshot image of the nodes for display.- Parameters:
bundle- the resource bundle to usekey- the resource bundle key for the itemnodes- the nodes to highlight; may be null, if no nodes should be highlighted- Returns:
- the new tour item
-
createWithImage
public static TourItem createWithImage(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes, javafx.scene.image.Image image) Create a new tour item with a specific (static) image.- Parameters:
bundle- the resource bundle to usekey- the resource bundle key for the itemnodes- the nodes to highlight; may be null, if no nodes should be highlightedimage- the image to display; may be null, if no image should be used- Returns:
- the new tour item
-
createWithImage
public static TourItem createWithImage(ResourceBundle bundle, String key, Collection<? extends javafx.scene.Node> nodes, Supplier<javafx.scene.image.Image> imageSupplier) Create a new tour item with a lazily-generated image.- Parameters:
bundle- the resource bundle to usekey- the resource bundle key for the itemnodes- the nodes to highlight; may be null, if no nodes should be highlightedimageSupplier- the supplier that generates the image to display; may be null, if no image should be used- Returns:
- the new tour item
-
getTitle
Get the title to display. -
getText
Get the main text to display, formatted as markdown.- Returns:
-
getImage
public javafx.scene.image.Image getImage()Get a static image to display, or null if no static image is stored.- Returns:
-
getHighlightNodes
Get an unmodifiable list of nodes to display.- Specified by:
getHighlightNodesin interfaceTourItem- Returns:
-
createPage
public javafx.scene.Node createPage()Description copied from interface:TourItemCreate a content page to display for this item.- Specified by:
createPagein interfaceTourItem- Returns:
-
toString
-