Class MarkdownTourItem

java.lang.Object
qupath.ext.training.ui.tour.MarkdownTourItem
All Implemented Interfaces:
TourItem

public class MarkdownTourItem extends Object implements 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 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 use
      key - the resource bundle key for the item
      nodes - 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 use
      key - the resource bundle key for the item
      nodes - the nodes to highlight; may be null, if no nodes should be highlighted
      image - 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 use
      key - the resource bundle key for the item
      nodes - the nodes to highlight; may be null, if no nodes should be highlighted
      imageSupplier - the supplier that generates the image to display; may be null, if no image should be used
      Returns:
      the new tour item
    • getTitle

      public String getTitle()
      Get the title to display.
      Specified by:
      getTitle in interface TourItem
      Returns:
    • getText

      public String 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

      public List<javafx.scene.Node> getHighlightNodes()
      Get an unmodifiable list of nodes to display.
      Specified by:
      getHighlightNodes in interface TourItem
      Returns:
    • createPage

      public javafx.scene.Node createPage()
      Description copied from interface: TourItem
      Create a content page to display for this item.
      Specified by:
      createPage in interface TourItem
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object