Class FontManagerImpl
- java.lang.Object
-
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
-
- com.inductiveautomation.perspective.gateway.assets.AbstractAssetManager<PerspectiveFont,byte[]>
-
- com.inductiveautomation.perspective.gateway.assets.fonts.FontManagerImpl
-
- All Implemented Interfaces:
FontManager
public class FontManagerImpl extends AbstractAssetManager<PerspectiveFont,byte[]> implements FontManager
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.perspective.gateway.assets.AbstractAssetManager
assetPath, cacheLock, perspectiveContext
-
-
Constructor Summary
Constructors Constructor Description FontManagerImpl(PerspectiveContext perspectiveContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<PerspectiveFont>generateKey(java.nio.file.Path path)Generate a cache key for the givenPathjava.util.Optional<java.io.InputStream>getFont(java.lang.String fontName, java.lang.String fontStyle, PerspectiveFontType fontType)Returns a stream of the raw font's bytes identified by the given name, style, and typejava.util.List<PerspectiveFont>getFonts()Returns a copy of the list of all of the managed fontsprotected java.util.Optional<byte[]>parseValue(java.nio.file.Path path)Parse the cache value for the givenPath-
Methods inherited from class com.inductiveautomation.perspective.gateway.assets.AbstractAssetManager
copyInputStreamToPath, copyInputStreamToPath, getCache, getCachedValue, getDigestCopy, getDigestFor, onCacheChanged, onShutdown, onStartup, setup
-
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
-
-
-
Constructor Detail
-
FontManagerImpl
public FontManagerImpl(@Nonnull PerspectiveContext perspectiveContext)
-
-
Method Detail
-
getFonts
@Nonnull public java.util.List<PerspectiveFont> getFonts()
Description copied from interface:FontManagerReturns a copy of the list of all of the managed fonts- Specified by:
getFontsin interfaceFontManager- Returns:
- A
Listof all managedfonts
-
getFont
@Nonnull public java.util.Optional<java.io.InputStream> getFont(java.lang.String fontName, java.lang.String fontStyle, PerspectiveFontType fontType)Description copied from interface:FontManagerReturns a stream of the raw font's bytes identified by the given name, style, and type- Specified by:
getFontin interfaceFontManager- Parameters:
fontName- The name of the font to fetchfontStyle- The style of the font to fetchfontType- Thetypeof the font to fetch- Returns:
- An
Optionalcontaining theInputStreamof 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
-
generateKey
@Nonnull public java.util.Optional<PerspectiveFont> generateKey(@Nonnull java.nio.file.Path path)
Description copied from class:AbstractAssetManagerGenerate a cache key for the givenPath- Specified by:
generateKeyin classAbstractAssetManager<PerspectiveFont,byte[]>- Parameters:
path- ThePathfor which we want to generate a cache key- Returns:
- An
Optionalcontaining the cache key or an empty Optional if the cache key could not be generated
-
parseValue
@Nonnull protected java.util.Optional<byte[]> parseValue(@Nonnull java.nio.file.Path path)Description copied from class:AbstractAssetManagerParse the cache value for the givenPath- Specified by:
parseValuein classAbstractAssetManager<PerspectiveFont,byte[]>- Parameters:
path- ThePathfor which we want to generate a cache value- Returns:
- An
Optionalcontaining the cache value or an empty Optional if the cache value could not be generated
-
-