Class FontManagerImpl
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.ignition.gateway.config.NamedResourceHandler<FontConfig>
com.inductiveautomation.perspective.gateway.assets.fonts.FontManagerImpl
- All Implemented Interfaces:
Lifecycle
,FontManager
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
NamedResourceHandler.Builder<R>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceType
static final ResourceTypeMeta<FontConfig>
Fields inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
configManager, logger, meta
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFont
(String fontName, String fontStyle, PerspectiveFontType fontType) Returns a stream of the raw font's bytes identified by the given name, style, and typegetFonts()
Returns a copy of the list of all of the managed fontsvoid
migrate()
protected void
onInitialResources
(List<DecodedResource<FontConfig>> decodedResources) Called once at startup with the resource that are already present in the configuration collection.protected void
Called once per each resource that is added.protected void
onResourceRemoved
(DecodedResource<FontConfig> removedResource) Called for resources that are removed (or updated and then fail to parse).protected void
onResourcesUpdated
(List<DecodedResource<FontConfig>> decodedResources) Called each time the overall set of resources changes in any way.protected void
Called once per each resource that is updated.void
setup()
Methods inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
create, create, create, decode, delete, delete, filter, findResource, getResources, isCaseSensitive, isRenameAware, modify, modify, modify, newBuilder, newUuid, onShutdown, onStartup, renameAndModify, renameAndModify, renameAndModify, renameAndModify
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Field Details
-
RESOURCE_TYPE
-
RESOURCE_TYPE_META
-
-
Constructor Details
-
FontManagerImpl
-
-
Method Details
-
migrate
- Throws:
MigrationException
-
setup
public void setup() -
getFonts
Description copied from interface:FontManager
Returns a copy of the list of all of the managed fonts- Specified by:
getFonts
in interfaceFontManager
- Returns:
- A
List
of all managedfonts
-
getFont
@Nonnull public Optional<InputStream> getFont(String fontName, String fontStyle, PerspectiveFontType fontType) Description copied from interface:FontManager
Returns a stream of the raw font's bytes identified by the given name, style, and type- Specified by:
getFont
in interfaceFontManager
- Parameters:
fontName
- The name of the font to fetchfontStyle
- The style of the font to fetchfontType
- Thetype
of the font to fetch- Returns:
- An
Optional
containing theInputStream
of raw bytes for the font with the given name, style, and type or an empty Optional of no such font is managed with the given name, style, and type
-
onInitialResources
Description copied from class:NamedResourceHandler
Called once at startup with the resource that are already present in the configuration collection.- Overrides:
onInitialResources
in classNamedResourceHandler<FontConfig>
-
onResourceAdded
Description copied from class:NamedResourceHandler
Called once per each resource that is added.- Overrides:
onResourceAdded
in classNamedResourceHandler<FontConfig>
-
onResourceUpdated
Description copied from class:NamedResourceHandler
Called once per each resource that is updated.Note that whether "rename" events are considered "updates" or "removes" and "adds" is determined by
NamedResourceHandler.isRenameAware()
.- Overrides:
onResourceUpdated
in classNamedResourceHandler<FontConfig>
-
onResourceRemoved
Description copied from class:NamedResourceHandler
Called for resources that are removed (or updated and then fail to parse).- Overrides:
onResourceRemoved
in classNamedResourceHandler<FontConfig>
-
onResourcesUpdated
Description copied from class:NamedResourceHandler
Called each time the overall set of resources changes in any way. Called after added, updated, and removed are called.- Overrides:
onResourcesUpdated
in classNamedResourceHandler<FontConfig>
-