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

public Class JabRefIconView

extends Group
Class Inheritance
Annotations
@NullMarked
Imports
java.util.ArrayList, .Collections, .List, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, javafx.css.CssMetaData, .SimpleStyleableObjectProperty, .Size, .SizeUnits, .Styleable, .StyleableObjectProperty, .StyleableProperty, javafx.css.converter.PaintConverter, javafx.scene.Group, .Node, javafx.scene.paint.Paint, javafx.scene.text.Font, org.jabref.gui.icon.IconTheme.JabRefIcons, com.tobiasdiez.easybind.EasyBind, org.jspecify.annotations.NullMarked

View for a JabRefIcons usable in FXML (e.g. <JabRefIconView glyph="REFRESH"/>).

Hosts the backing node produced by JabRefIcons#getGraphicNode() instead of being a FontIcon itself, so it renders both Ikonli-font-backed glyphs (as a FontIcon) and SVG-backed glyphs (see SvgIcon, rendered as a JabRefSvgIcon).

Theme coloring is handled by the hosted child itself (a FontIcon or JabRefSvgIcon, both of which carry the icon style classes), so this view stays unclassed to avoid double-theming. The styleable -fx-icon-color here is an explicit override knob — e.g. an inline style="-fx-icon-color: ..." in FXML — and, when set, is forwarded to an SVG child as a color (overriding theme CSS).

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<JabRefIconView, Paint>
private final StyleableObjectProperty<Paint>
color

CSS-styleable color, fed by -fx-icon-color rules (e.g. an inline style="-fx-icon-color: ...").

private static final List<CssMetaData<? extends Styleable, ?>>
private final ObjectProperty<IconTheme.JabRefIcons>
glyph

This property is only needed to get proper IDE support in FXML files (e.g. validation that parameter passed to "icon" is indeed of type IconTheme.JabRefIcons).

private final ObjectProperty<Number>

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
private void
applyColor()

Forwards an explicit color override to an SVG child.

public static List<CssMetaData<? extends Styleable, ?>>
getClassCssMetaData()

Hides javafx.scene.Node.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.Node.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

public IconTheme.JabRefIcons
public Number
public ObjectProperty<IconTheme.JabRefIcons>
public ObjectProperty<Number>
private void
public void
public void
private void
updateGraphic()

Rebuilds the hosted node from the current glyph, sized to the current glyph size.

Inherited from javafx.scene.Group:
autoSizeChildrenPropertygetChildrenisAutoSizeChildrenlayoutChildrenminHeightminWidthprefHeightprefWidthsetAutoSizeChildren

Field Detail

COLORback to summary
private static final CssMetaData<JabRefIconView, Paint> COLOR
colorback to summary
private final StyleableObjectProperty<Paint> color

CSS-styleable color, fed by -fx-icon-color rules (e.g. an inline style="-fx-icon-color: ..."). Forwarded to an SVG child as a fixed color.

CSS_META_DATAback to summary
private static final List<CssMetaData<? extends Styleable, ?>> CSS_META_DATA
glyphback to summary
private final ObjectProperty<IconTheme.JabRefIcons> glyph

This property is only needed to get proper IDE support in FXML files (e.g. validation that parameter passed to "icon" is indeed of type IconTheme.JabRefIcons).

glyphSizeback to summary
private final ObjectProperty<Number> glyphSize

Constructor Detail

JabRefIconViewback to summary
public JabRefIconView(IconTheme.JabRefIcons icon, int size)
JabRefIconViewback to summary
public JabRefIconView(IconTheme.JabRefIcons icon)
JabRefIconViewback to summary
public JabRefIconView()

Method Detail

applyColorback to summary
private void applyColor()

Forwards an explicit color override to an SVG child. JabRefSvgIcon#setColor(Paint) fixes the color there, so it beats the author .ikonli-font-icon { -fx-icon-color } theme rule the child also matches. When unset (the common case) the child colors itself from theme CSS, so it is left untouched.

getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.Node.getClassCssMetaData.

Doc from javafx.scene.Node.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.Node.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.Node.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

Annotations
@Override
getGlyphback to summary
public IconTheme.JabRefIcons getGlyph()
getGlyphSizeback to summary
public Number getGlyphSize()
glyphPropertyback to summary
public ObjectProperty<IconTheme.JabRefIcons> glyphProperty()
glyphSizePropertyback to summary
public ObjectProperty<Number> glyphSizeProperty()
initializeback to summary
private void initialize()
setGlyphback to summary
public void setGlyph(IconTheme.JabRefIcons icon)
setGlyphSizeback to summary
public void setGlyphSize(Number value)
updateGraphicback to summary
private void updateGraphic()

Rebuilds the hosted node from the current glyph, sized to the current glyph size. The icon applies the size to its own backing node type (font or SVG), so this view stays agnostic to which one it is.