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

public final Class SvgIcon

extends Object
implements JabRefIcon
Class Inheritance
All Implemented Interfaces
org.jabref.gui.icon.JabRefIcon
Annotations
@NullMarked
Imports
javafx.scene.Node, javafx.scene.paint.Color, org.jspecify.annotations.NullMarked, .Nullable

Field Summary

Modifier and TypeField and Description
private final @Nullable Color
private static final int
private final String
private final int
private final String

Constructor Summary

AccessConstructor and Description
public
SvgIcon(String name, String svgPath)

private
SvgIcon(String name, String svgPath, int size, @Nullable Color color)

Method Summary

Modifier and TypeMethod and Description
public JabRefIcon
public Node
public boolean
public String
public JabRefIcon
public JabRefIcon
withSize(int size)

Implements org.jabref.gui.icon.JabRefIcon.withSize.

Returns a copy of this icon rendered at size pixels.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorback to summary
private final @Nullable Color color
DEFAULT_SIZEback to summary
private static final int DEFAULT_SIZE
nameback to summary
private final String name
sizeback to summary
private final int size
svgPathback to summary
private final String svgPath

Constructor Detail

SvgIconback to summary
public SvgIcon(String name, String svgPath)
SvgIconback to summary
private SvgIcon(String name, String svgPath, int size, @Nullable Color color)

Method Detail

disabledback to summary
public JabRefIcon disabled()

Implements org.jabref.gui.icon.JabRefIcon.disabled.

Annotations
@Override
getGraphicNodeback to summary
public Node getGraphicNode()

Implements org.jabref.gui.icon.JabRefIcon.getGraphicNode.

Annotations
@Override
matchesback to summary
public boolean matches(Node graphicNode)

Implements org.jabref.gui.icon.JabRefIcon.matches.

Annotations
@Override
nameback to summary
public String name()

Implements org.jabref.gui.icon.JabRefIcon.name.

Annotations
@Override
withColorback to summary
public JabRefIcon withColor(Color color)

Implements org.jabref.gui.icon.JabRefIcon.withColor.

Annotations
@Override
withSizeback to summary
public JabRefIcon withSize(int size)

Implements org.jabref.gui.icon.JabRefIcon.withSize.

Doc from org.jabref.gui.icon.JabRefIcon.withSize.

Returns a copy of this icon rendered at size pixels. Each implementation applies the size to its own backing node type, so callers (e.g. JabRefIconView) need not know whether it is a font or SVG node.

Note the unit differs by backing type: for a font glyph size is the em/font size, so the glyph sits inside that box with the font's intrinsic padding; for an SVG the path is fitted edge-to-edge into a size×size square. The same size can thus render an SVG slightly larger than the font glyph.

Annotations
@Override