Record Class BackendServices
- Record Components:
ui- the user-interface thread's runtime, bound to the thread that will run the looptextRuler- measures and shapes textfontCatalog- the font families the platform offersfontLoader- reads a font file the application names, and a family's faces ahead of their first useimageDecoder- decodes image filessvgRenderer- draws SVGgraphics3d- the 3D viewport's renderer, ornullfor nonevideoSurfaces- GPU surfaces a video view composites, ornullfor noneaudioEngine- plays sound, ornullfor no audio deviceaudioDecoder- decodes sound files, ornullwhen there is no audio at allglyphOutlines- the outlines of the glyphs the text ruler shapes, which a printed document writes as text, ornullfor none
Backend provides to the toolkit besides its windows, named in one place and
installed by one call.
Until 2026-09-22 a backend installed each of these through a static setter of its own, and
nothing on the SPI said which it owed: a backend that forgot the text ruler measured every string
as zero wide, with no error anywhere. A backend now builds this record in its constructor and calls
install(); the record's constructor refuses a missing required service on the spot.
Five services are required — nothing draws without them. Five are optional, and
null is how a backend says it has none: a machine with no audio device, a backend without
3D or without GPU video surfaces, one that cannot outline glyphs. The toolkit then reports the
capability as unavailable (Sounds.isAvailable(), Graphics3D, VideoSurfaces)
or degrades (a printed document draws text it cannot outline from nothing, with a warning) rather
than failing.
-
Constructor Summary
ConstructorsConstructorDescriptionBackendServices(UiRuntime ui, TextRuler textRuler, FontCatalog fontCatalog, FontLoader fontLoader, ImageDecoder imageDecoder, SvgRenderer svgRenderer, @Nullable Graphics3D.Provider graphics3d, @Nullable VideoSurfaces.Provider videoSurfaces, @Nullable AudioEngine audioEngine, @Nullable AudioDecoder audioDecoder) The services of a backend that outlines no glyph, as the record stood before glyph outlines were added.BackendServices(UiRuntime ui, TextRuler textRuler, FontCatalog fontCatalog, FontLoader fontLoader, ImageDecoder imageDecoder, SvgRenderer svgRenderer, @Nullable Graphics3D.Provider graphics3d, @Nullable VideoSurfaces.Provider videoSurfaces, @Nullable AudioEngine audioEngine, @Nullable AudioDecoder audioDecoder, @Nullable GlyphOutlines glyphOutlines) Creates an instance of aBackendServicesrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable AudioDecoderReturns the value of theaudioDecoderrecord component.@Nullable AudioEngineReturns the value of theaudioEnginerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefontCatalogrecord component.Returns the value of thefontLoaderrecord component.@Nullable GlyphOutlinesReturns the value of theglyphOutlinesrecord component.@Nullable Graphics3D.ProviderReturns the value of thegraphics3drecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theimageDecoderrecord component.voidinstall()Installs every service where the toolkit reads it.Returns the value of thesvgRendererrecord component.Returns the value of thetextRulerrecord component.final StringtoString()Returns a string representation of this record class.ui()Returns the value of theuirecord component.@Nullable VideoSurfaces.ProviderReturns the value of thevideoSurfacesrecord component.
-
Constructor Details
-
BackendServices
public BackendServices(UiRuntime ui, TextRuler textRuler, FontCatalog fontCatalog, FontLoader fontLoader, ImageDecoder imageDecoder, SvgRenderer svgRenderer, @Nullable Graphics3D.Provider graphics3d, @Nullable VideoSurfaces.Provider videoSurfaces, @Nullable AudioEngine audioEngine, @Nullable AudioDecoder audioDecoder, @Nullable GlyphOutlines glyphOutlines) Creates an instance of aBackendServicesrecord class.- Parameters:
ui- the value for theuirecord componenttextRuler- the value for thetextRulerrecord componentfontCatalog- the value for thefontCatalogrecord componentfontLoader- the value for thefontLoaderrecord componentimageDecoder- the value for theimageDecoderrecord componentsvgRenderer- the value for thesvgRendererrecord componentgraphics3d- the value for thegraphics3drecord componentvideoSurfaces- the value for thevideoSurfacesrecord componentaudioEngine- the value for theaudioEnginerecord componentaudioDecoder- the value for theaudioDecoderrecord componentglyphOutlines- the value for theglyphOutlinesrecord component
-
BackendServices
public BackendServices(UiRuntime ui, TextRuler textRuler, FontCatalog fontCatalog, FontLoader fontLoader, ImageDecoder imageDecoder, SvgRenderer svgRenderer, @Nullable Graphics3D.Provider graphics3d, @Nullable VideoSurfaces.Provider videoSurfaces, @Nullable AudioEngine audioEngine, @Nullable AudioDecoder audioDecoder) The services of a backend that outlines no glyph, as the record stood before glyph outlines were added.
-
-
Method Details
-
install
public void install()Installs every service where the toolkit reads it. Once, from the backend's constructor, on the thread the backend's loop will run on. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
ui
Returns the value of theuirecord component.- Returns:
- the value of the
uirecord component
-
textRuler
Returns the value of thetextRulerrecord component.- Returns:
- the value of the
textRulerrecord component
-
fontCatalog
Returns the value of thefontCatalogrecord component.- Returns:
- the value of the
fontCatalogrecord component
-
fontLoader
Returns the value of thefontLoaderrecord component.- Returns:
- the value of the
fontLoaderrecord component
-
imageDecoder
Returns the value of theimageDecoderrecord component.- Returns:
- the value of the
imageDecoderrecord component
-
svgRenderer
Returns the value of thesvgRendererrecord component.- Returns:
- the value of the
svgRendererrecord component
-
graphics3d
Returns the value of thegraphics3drecord component.- Returns:
- the value of the
graphics3drecord component
-
videoSurfaces
Returns the value of thevideoSurfacesrecord component.- Returns:
- the value of the
videoSurfacesrecord component
-
audioEngine
Returns the value of theaudioEnginerecord component.- Returns:
- the value of the
audioEnginerecord component
-
audioDecoder
Returns the value of theaudioDecoderrecord component.- Returns:
- the value of the
audioDecoderrecord component
-
glyphOutlines
Returns the value of theglyphOutlinesrecord component.- Returns:
- the value of the
glyphOutlinesrecord component
-