Record Class GuidedTutorial.Step

java.lang.Object
java.lang.Record
sc.fiji.snt.gui.GuidedTutorial.Step
Record Components:
message - the (HTML-capable) callout text
roi - world-coordinate region to fly the camera to before showing the callout (null keeps the current view, e.g. for a step that reuses the previous one's framing)
isDone - checked once the user dismisses this step's callout; true advances to the next step, false re-shows retryIndex()
retryIndex - the (0-based) step index to fall back to when isDone fails; a negative value retries this same step (see of(java.lang.String, sc.fiji.snt.util.BoundingBox, java.util.function.BooleanSupplier))
calloutTarget - resolves a real on-screen control to anchor the callout to instead of the roi's on-screen center (see pointingAt(java.util.function.Function<sc.fiji.snt.viewer.AbstractBigViewer, java.awt.Component>)); null (the common case) keeps the default canvas-center anchor. roi, if any, still just frames the camera either way
Enclosing class:
GuidedTutorial

public static record GuidedTutorial.Step(String message, BoundingBox roi, BooleanSupplier isDone, int retryIndex, Consumer<AbstractBigViewer> cameraAction, Function<AbstractBigViewer,Component> calloutTarget) extends Record
One step of a GuidedTutorial.
  • Constructor Details

  • Method Details

    • of

      public static GuidedTutorial.Step of(String message, BoundingBox roi, BooleanSupplier isDone)
      A step that, on failure, simply retries itself (the common case), with no camera action
    • of

      public static GuidedTutorial.Step of(String message, BoundingBox roi, BooleanSupplier isDone, Consumer<AbstractBigViewer> cameraAction)
      Same as of(String, BoundingBox, BooleanSupplier), but also runs cameraAction (e.g. GuidedTutorial.rotate(int, double, long)) right after roi is flown to.
    • pointingAt

      public GuidedTutorial.Step pointingAt(Function<AbstractBigViewer,Component> calloutTarget)
      Same step, but anchoring the callout to a real on-screen control - e.g. v -> v.getNavigationModeButton() - instead of the roi's on-screen center. Useful for a step that explains a UI control rather than a location in the 3D scene; roi (if any) still just frames the camera as usual. A resolver that returns null (the control not built/showing yet) falls back to the default canvas-center anchor.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • roi

      public BoundingBox roi()
      Returns the value of the roi record component.
      Returns:
      the value of the roi record component
    • isDone

      public BooleanSupplier isDone()
      Returns the value of the isDone record component.
      Returns:
      the value of the isDone record component
    • retryIndex

      public int retryIndex()
      Returns the value of the retryIndex record component.
      Returns:
      the value of the retryIndex record component
    • cameraAction

      public Consumer<AbstractBigViewer> cameraAction()
      Returns the value of the cameraAction record component.
      Returns:
      the value of the cameraAction record component
    • calloutTarget

      public Function<AbstractBigViewer,Component> calloutTarget()
      Returns the value of the calloutTarget record component.
      Returns:
      the value of the calloutTarget record component