Class GuideFlow
java.lang.Object
com.j3d.engine.react.events.EventEmitter
com.j3d.engine.react.events.EventEmitterAndListener
com.j3d.gen.guide.GuideFlow
- All Implemented Interfaces:
EventEmitterInterface, EventListener
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Supplier<GuidePanelAdapter> (package private) LinkedHashSet<GuideInfo> private final intThe debounce period in seconds to prevent rapid guide closing events.private LocalTimeThe last time a guide closing event was processed, used for debouncing.private intFields inherited from class EventEmitter
registered -
Constructor Summary
ConstructorsConstructorDescriptionGuideFlow(Supplier<GuidePanelAdapter> adapterSupplier) Constructs a new GuideFlow with the given adapter supplier. -
Method Summary
Modifier and TypeMethodDescriptionAdds aGuideInfoto the flow.voidback()booleanfinished()Checks if all guides in the flow have been processed.intReturns the index of a givenGuideInfowithin the set of all guides ever processed.<K> voidonEvent(EventType event, EventPayload<K> properties) Handles events, specificallyEventType.GUIDE_CLOSINGto advance the guide flow.voidstart()Starts the guide flow by displaying the first guide in the queue.intReturns the total number of guides that were initially added to this flow.Methods inherited from class EventEmitter
attachListener, broadcast, detachAll, detachListener, genericAttach, genericBroadcast, genericDetach, genericDetachAll, isAttached
-
Field Details
-
guides
-
totalSize
private int totalSize -
allGuides
LinkedHashSet<GuideInfo> allGuides -
adapterSupplier
Supplier<GuidePanelAdapter> adapterSupplier -
DEB
private final int DEBThe debounce period in seconds to prevent rapid guide closing events.- See Also:
-
lastTime
The last time a guide closing event was processed, used for debouncing.
-
-
Constructor Details
-
GuideFlow
Constructs a new GuideFlow with the given adapter supplier.- Parameters:
adapterSupplier- A supplier that provides instances ofGuidePanelAdapter.
-
-
Method Details
-
add
-
back
public void back() -
start
public void start()Starts the guide flow by displaying the first guide in the queue. If no guides are present, it shows a message dialog. It attaches listeners to the current guide and builds its UI. -
finished
public boolean finished()Checks if all guides in the flow have been processed.- Returns:
trueif there are no more guides to show,falseotherwise.
-
indexOf
-
totalSize
public int totalSize()Returns the total number of guides that were initially added to this flow.- Returns:
- The total count of guides.
-
onEvent
Handles events, specificallyEventType.GUIDE_CLOSINGto advance the guide flow.- Type Parameters:
K- The type of the emitter of this event- Parameters:
event- The type of the event.properties- The payload containing event-specific data.
-