Package sc.fiji.snt.gui
Record Class GuidedTutorial.Step
java.lang.Object
java.lang.Record
sc.fiji.snt.gui.GuidedTutorial.Step
- Record Components:
message- the (HTML-capable) callout textroi- world-coordinate region to fly the camera to before showing the callout (nullkeeps 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;trueadvances to the next step,falsere-showsretryIndex()retryIndex- the (0-based) step index to fall back to whenisDonefails; a negative value retries this same step (seeof(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 (seepointingAt(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 Summary
ConstructorsConstructorDescriptionStep(String message, BoundingBox roi, BooleanSupplier isDone, int retryIndex, Consumer<AbstractBigViewer> cameraAction, Function<AbstractBigViewer, Component> calloutTarget) Creates an instance of aSteprecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecalloutTargetrecord component.Returns the value of thecameraActionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.isDone()Returns the value of theisDonerecord component.message()Returns the value of themessagerecord component.static GuidedTutorial.Stepof(String message, BoundingBox roi, BooleanSupplier isDone) A step that, on failure, simply retries itself (the common case), with no camera actionstatic GuidedTutorial.Stepof(String message, BoundingBox roi, BooleanSupplier isDone, Consumer<AbstractBigViewer> cameraAction) Same asof(String, BoundingBox, BooleanSupplier), but also runscameraAction(e.g.pointingAt(Function<AbstractBigViewer, Component> calloutTarget) Same step, but anchoring the callout to a real on-screen control - e.g.intReturns the value of theretryIndexrecord component.roi()Returns the value of theroirecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Step
public Step(String message, BoundingBox roi, BooleanSupplier isDone, int retryIndex, Consumer<AbstractBigViewer> cameraAction, Function<AbstractBigViewer, Component> calloutTarget) Creates an instance of aSteprecord class.- Parameters:
message- the value for themessagerecord componentroi- the value for theroirecord componentisDone- the value for theisDonerecord componentretryIndex- the value for theretryIndexrecord componentcameraAction- the value for thecameraActionrecord componentcalloutTarget- the value for thecalloutTargetrecord component
-
-
Method Details
-
of
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 asof(String, BoundingBox, BooleanSupplier), but also runscameraAction(e.g.GuidedTutorial.rotate(int, double, long)) right afterroiis flown to. -
pointingAt
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 returnsnull(the control not built/showing yet) falls back to the default canvas-center anchor. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
roi
Returns the value of theroirecord component.- Returns:
- the value of the
roirecord component
-
isDone
Returns the value of theisDonerecord component.- Returns:
- the value of the
isDonerecord component
-
retryIndex
public int retryIndex()Returns the value of theretryIndexrecord component.- Returns:
- the value of the
retryIndexrecord component
-
cameraAction
Returns the value of thecameraActionrecord component.- Returns:
- the value of the
cameraActionrecord component
-
calloutTarget
Returns the value of thecalloutTargetrecord component.- Returns:
- the value of the
calloutTargetrecord component
-