Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.theme

public Class ThemePreviewView

extends HBox
Class Inheritance
Annotations
@NullMarked
Imports
java.util.List, javafx.beans.value.ObservableValue, javafx.geometry.Insets, javafx.scene.image.Image, .ImageView, javafx.scene.layout.HBox, .StackPane, org.jspecify.annotations.NullMarked, .Nullable

Shows the bundled screenshot of a theme in the selected color scheme; when the color scheme follows the system, the dark and the light screenshot side by side.

Each screenshot sits in a frame of a fixed size, so that the surrounding form is laid out once and does not jump when an image -- loaded in the background -- arrives or is switched.

Field Summary

Modifier and TypeField and Description
private static final double
private static final double
PREVIEW_HEIGHT

The screenshots are roughly 16:10; a box slightly taller than that leaves a little air around the ones that differ by a few pixels instead of cropping them.

private static final double

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
private static StackPane
frame(ImageView preview)

private void
Inherited from javafx.scene.layout.HBox:
alignmentPropertyclearConstraintscomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthfillHeightPropertygetAlignmentgetBaselineOffsetgetClassCssMetaDatagetContentBiasgetCssMetaDatagetHgrowgetMargingetSpacingisFillHeightlayoutChildrenrequestLayoutsetAlignmentsetFillHeightsetHgrowsetMarginsetSpacingspacingProperty

Field Detail

FRAME_PADDINGback to summary
private static final double FRAME_PADDING
PREVIEW_HEIGHTback to summary
private static final double PREVIEW_HEIGHT

The screenshots are roughly 16:10; a box slightly taller than that leaves a little air around the ones that differ by a few pixels instead of cropping them.

PREVIEW_WIDTHback to summary
private static final double PREVIEW_WIDTH

Constructor Detail

ThemePreviewViewback to summary
public ThemePreviewView()

Method Detail

bindback to summary
public void bind(ObservableValue<ThemePreset> theme, ObservableValue<ThemeColorScheme> colorScheme)
frameback to summary
private static StackPane frame(ImageView preview)
showback to summary
private void show(@Nullable ThemePreset theme, @Nullable ThemeColorScheme colorScheme)