Verified Owner
Top Inners Fields Constructors Methods
org.jabref.gui.walkthrough

public Class WalkthroughHighlighter

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, javafx.scene.Node, .Scene, javafx.stage.Window, org.jabref.gui.walkthrough.declarative.WindowResolver, org.jabref.gui.walkthrough.declarative.effect.HighlightEffect, .WalkthroughEffect, org.jabref.gui.walkthrough.effects.FullScreenDarken, .Ping, .Spotlight, org.jspecify.annotations.NonNull, .Nullable, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private final Map<Window, Spotlight>
private final Map<Window, WalkthroughHighlighter.EffectState>
private final Map<Window, FullScreenDarken>
private static final Logger
private final Map<Window, Ping>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
public void
applyHighlight(@Nullable WalkthroughEffect
The highlight configuration to apply. Default to BackdropHighlight on the primary windows if null.
config
,
@NonNull Scene
The primary scene to apply the highlight to.
scene
,
@Nullable Node
The fallback target node to use if no highlight configuration is provided.
fallbackTarget
)

Applies the specified highlight configuration.

private void
private Map<Window, WalkthroughHighlighter.EffectState>
computeNewEffects(@Nullable WalkthroughEffect config, @NonNull Scene fallbackWindow, @Nullable Node fallbackTarget)

public void
detach(@NonNull Window window)

Sets a handler to be called when the user clicks on backdrop or darkened areas.

public void
detachAll()

Detaches all effects from all windows.

private void
private Spotlight
private FullScreenDarken
private Ping
private static void
logMissingPane(Window window)

A highlight is decoration: a window that cannot host the pane still gets its step, just without the effect.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backdropHighlightsback to summary
private final Map<Window, Spotlight> backdropHighlights
currentEffectsback to summary
private final Map<Window, WalkthroughHighlighter.EffectState> currentEffects
fullScreenDarkensback to summary
private final Map<Window, FullScreenDarken> fullScreenDarkens
LOGGERback to summary
private static final Logger LOGGER
pulseIndicatorsback to summary
private final Map<Window, Ping> pulseIndicators

Constructor Detail

WalkthroughHighlighterback to summary
public WalkthroughHighlighter()

Method Detail

applyBackdropHighlightback to summary
private void applyBackdropHighlight(@NonNull Window window, @NonNull Node targetNode)
applyEffectback to summary
private void applyEffect(@NonNull Window window, @NonNull HighlightEffect effect, @Nullable Node targetNode)
applyFullScreenDarkenback to summary
private void applyFullScreenDarken(@NonNull Window window)
applyHighlightback to summary
public void applyHighlight(@Nullable WalkthroughEffect config, @NonNull Scene scene, @Nullable Node fallbackTarget)

Applies the specified highlight configuration.

Parameters
config:@Nullable WalkthroughEffect

The highlight configuration to apply. Default to BackdropHighlight on the primary windows if null.

scene:@NonNull Scene

The primary scene to apply the highlight to.

fallbackTarget:@Nullable Node

The fallback target node to use if no highlight configuration is provided.

applyPulseAnimationback to summary
private void applyPulseAnimation(@NonNull Window window, @NonNull Node targetNode)
computeNewEffectsback to summary
private Map<Window, WalkthroughHighlighter.EffectState> computeNewEffects(@Nullable WalkthroughEffect config, @NonNull Scene fallbackWindow, @Nullable Node fallbackTarget)
detachback to summary
public void detach(@NonNull Window window)

Sets a handler to be called when the user clicks on backdrop or darkened areas.

detachAllback to summary
public void detachAll()

Detaches all effects from all windows. See WalkthroughHighlighter#detach.

diffEffectsback to summary
private void diffEffects(Map<Window, WalkthroughHighlighter.EffectState> current, Map<Window, WalkthroughHighlighter.EffectState> desired, Map<Window, WalkthroughHighlighter.EffectState> toUpdate, Map<Window, WalkthroughHighlighter.EffectState> toCreate, Map<Window, WalkthroughHighlighter.EffectState> toRemove)
getOrCreateBackdropHighlightback to summary
private Spotlight getOrCreateBackdropHighlight(@NonNull Window window, @NonNull WalkthroughPane pane)
getOrCreateFullScreenDarkenback to summary
private FullScreenDarken getOrCreateFullScreenDarken(@NonNull Window window, @NonNull WalkthroughPane pane)
getOrCreatePulseIndicatorback to summary
private Ping getOrCreatePulseIndicator(@NonNull Window window, @NonNull WalkthroughPane pane)
logMissingPaneback to summary
private static void logMissingPane(Window window)

A highlight is decoration: a window that cannot host the pane still gets its step, just without the effect.

updateExistingEffectback to summary
private void updateExistingEffect(@NonNull Window window, @NonNull WalkthroughHighlighter.EffectState newState)
org.jabref.gui.walkthrough back to summary

private final Record WalkthroughHighlighter.EffectState

extends Record
Class Inheritance
Record Components
effect:HighlightEffect 
targetNode:@Nullable Node 

Field Summary

Modifier and TypeField and Description
private final HighlightEffect
effect

Record Component accessed by effect().

private final @Nullable Node
targetNode

Record Component accessed by targetNode().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
public HighlightEffect
effect()

Record Component getter of effect.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public @Nullable Node
targetNode()

Record Component getter of targetNode.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

effectback to summary
private final HighlightEffect effect

Record Component accessed by effect().

targetNodeback to summary
private final @Nullable Node targetNode

Record Component accessed by targetNode().

Constructor Detail

EffectStateback to summary
private EffectState(HighlightEffect effect, @Nullable Node targetNode)

Method Detail

canTransitionToback to summary
pack-priv boolean canTransitionTo(WalkthroughHighlighter.EffectState other)
effectback to summary
public HighlightEffect effect()

Record Component getter of effect.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

targetNodeback to summary
public @Nullable Node targetNode()

Record Component getter of targetNode.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.