Package com.iizix.prop.font
Class FontFiles
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.font.FontFiles
- All Implemented Interfaces:
EventListener
,IClientCachePreload
,IClientCacheResource
,IGProp<GProp<?>[]>
,IPropCnr
,java.lang.Cloneable
- Direct Known Subclasses:
EditorFontFiles
public class FontFiles extends PropCnr implements IClientCachePreload, IClientCacheResource
Container for all font files used in a FontIconsDefintion.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADDITIONAL
Additional styles, e.g.static java.lang.String
FONT_FACE_CSS
Definition: @font-face CSS, i.e.static java.lang.String
LOCAL
The local name of the font, comma separated list.static java.lang.String[]
STANDARD_FONTS
The list of standard fonts that are installed in the system by default.static int
STYLE_DEFAULT
Default STYLE index.static java.lang.String[]
STYLES
Possible values for font-style.static java.lang.String
UNDEFINED
The undefined font family string.static int
WEIGHT_BOLD
Bold WEIGHT index.static int
WEIGHT_DEFAULT
Default (normal) WEIGHT index.static java.lang.String[]
WEIGHTS
Possible values for font-weight.static java.lang.String[]
WEIGHTS_DESCR
Possible values for font-weight with description, e.g.Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IClientCacheResource
CACHES
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FontFiles
clone()
Clones the font files.int
getCacheOperation()
Gets the cache value.java.lang.String
getDescriptiveFontWeight()
Gets the descriptive font-weight as e.g.java.lang.String
getFontFaceBaseDeclaration()
Gets the font-face base declaration without the 'src' and 'font-family' definitions.java.lang.String
getFontFamily()
Gets the font family name to use.FontFile
getFontFile(EnvProps env)
Returns the font file that is used for the client session in question.FontFile
getFontFile(BrowserFontFormat browserFontFormat)
Returns the font file that is used for the client session in question.FontFile[]
getFontFiles()
Gets the font files.java.lang.String
getFontIdentification()
Gets the font identification much like the "Font Variation Description" (FVD).java.lang.String
getFontStyle()
Gets the font-style.int
getFontStyleIndex()
Gets the font-style index value.java.lang.String
getFontWeight()
Gets the font-weight.int
getFontWeightIndex()
Gets the font-weight index value.java.lang.String
getLocalNames()
Gets the local name(s) specified.PreloadClientCacheResource[]
getPreloadClientCacheResources(IClientSessionGyro clientGyro)
Returns the list of resources that are required on the client side in the preload-to-cache mechanism.boolean
isCachedOnClient()
Returns if the resource (font, image, etc) is to be cached on the client side or not.boolean
isCachePreloaded()
Returns if the resource (font, image, etc) is to be cached on the client side when the application starts or not.protected boolean
isPropPrivateAtCreation()
The font files container is private and not transported to the client.static boolean
isStandardFontFamily(java.lang.String fontFamily)
Verifies of the font name is a standard font.void
onEventSelf(GEvent event)
Overridden to check for cache clearing...boolean
usesPropIndex()
Font files container uses property index because it's priority based.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, doVirtualizePropCnr, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getReferences, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, onVirtualizationCompleted, onVirtualized, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, verifyHasPropertyItem, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Detail
UNDEFINED
public static final java.lang.String UNDEFINED
The undefined font family string.- See Also:
- Constant Field Values
LOCAL
public static final java.lang.String LOCAL
The local name of the font, comma separated list.- See Also:
- Constant Field Values
ADDITIONAL
public static final java.lang.String ADDITIONAL
Additional styles, e.g. font-variant, font-feature-settings.- See Also:
- Constant Field Values
FONT_FACE_CSS
public static final java.lang.String FONT_FACE_CSS
Definition: @font-face CSS, i.e. the original imported font face declaration.- See Also:
- Constant Field Values
STYLES
public static final java.lang.String[] STYLES
Possible values for font-style. Defines how the font should be styled. Default value is "normal".
STYLE_DEFAULT
public static final int STYLE_DEFAULT
Default STYLE index.- See Also:
- Constant Field Values
WEIGHTS
public static final java.lang.String[] WEIGHTS
Possible values for font-weight. Defines the boldness of the font. Default value is "400" (normal).
WEIGHTS_DESCR
public static final java.lang.String[] WEIGHTS_DESCR
Possible values for font-weight with description, e.g. "100 - thin (hairline)".
WEIGHT_DEFAULT
public static final int WEIGHT_DEFAULT
Default (normal) WEIGHT index.- See Also:
- Constant Field Values
WEIGHT_BOLD
public static final int WEIGHT_BOLD
Bold WEIGHT index.- See Also:
- Constant Field Values
STANDARD_FONTS
public static final java.lang.String[] STANDARD_FONTS
The list of standard fonts that are installed in the system by default.
Constructor Detail
FontFiles
public FontFiles()
Constructor.
FontFiles
public FontFiles(Atom atom)
Constructor with name.- Parameters:
atom
- The atom name.
Method Detail
isStandardFontFamily
public static boolean isStandardFontFamily(java.lang.String fontFamily)
Verifies of the font name is a standard font.- Parameters:
fontFamily
- The font family name.- Returns:
- true if standard, false otherwise.
isPropPrivateAtCreation
protected boolean isPropPrivateAtCreation()
The font files container is private and not transported to the client.- Overrides:
isPropPrivateAtCreation
in classGProp<GProp<?>[]>
- Returns:
- true if the property should be set to private at creation, false for default.
usesPropIndex
public boolean usesPropIndex()
Font files container uses property index because it's priority based.- Specified by:
usesPropIndex
in interfaceIPropCnr
- Overrides:
usesPropIndex
in classPropCnr
- Returns:
- true if index is used, false for non-index based container.
onEventSelf
public void onEventSelf(GEvent event)
Overridden to check for cache clearing...- Specified by:
onEventSelf
in interfaceIGProp<GProp<?>[]>
- Overrides:
onEventSelf
in classGProp<GProp<?>[]>
- Parameters:
event
- The property event.
getFontFiles
public FontFile[] getFontFiles()
Gets the font files.
getFontFile
public FontFile getFontFile(EnvProps env)
Returns the font file that is used for the client session in question.- Parameters:
env
- The environment for the client.- Returns:
- The font file to use, or null if not found.
getFontFile
public FontFile getFontFile(BrowserFontFormat browserFontFormat)
Returns the font file that is used for the client session in question.- Parameters:
browserFontFormat
- The browser font format instance.- Returns:
- The font file to use, or null if not found.
getCacheOperation
public int getCacheOperation()
Gets the cache value.- Returns:
- The cache value: 0=no cache, 1=on-first-use (default), 2=preload.
isCachedOnClient
public boolean isCachedOnClient()
Returns if the resource (font, image, etc) is to be cached on the client side or not.- Specified by:
isCachedOnClient
in interfaceIClientCacheResource
- Returns:
- true to cache font (default), or false for client session use only.
isCachePreloaded
public boolean isCachePreloaded()
Returns if the resource (font, image, etc) is to be cached on the client side when the application starts or not.- Specified by:
isCachePreloaded
in interfaceIClientCacheResource
getPreloadClientCacheResources
public PreloadClientCacheResource[] getPreloadClientCacheResources(IClientSessionGyro clientGyro)
Returns the list of resources that are required on the client side in the preload-to-cache mechanism.- Specified by:
getPreloadClientCacheResources
in interfaceIClientCachePreload
- Parameters:
clientGyro
- The client gyro engine.- Returns:
- An array with the resources required.
getFontFamily
public java.lang.String getFontFamily()
Gets the font family name to use.
getFontIdentification
public java.lang.String getFontIdentification()
Gets the font identification much like the "Font Variation Description" (FVD).- Returns:
- The font identification in form of "font-family:font-style[index]:font-weight[index]" (where "font-*[index]" is the index value).
getLocalNames
public java.lang.String getLocalNames()
Gets the local name(s) specified.- Returns:
- A potentially comma separated string with names, null for none.
getFontFaceBaseDeclaration
public java.lang.String getFontFaceBaseDeclaration()
Gets the font-face base declaration without the 'src' and 'font-family' definitions. These declarations are font-family, font-stretch, font-style, font-weight and unicode-range plus the additional styles.- Returns:
- String formatted as e.g. "font-style: normal; font-weight: normal;", defaults to empty string meaning "font-style: normal; font-weight: normal; font-stretch: normal; unicode-range: U+0-10FFFF;".
getFontStyle
public java.lang.String getFontStyle()
Gets the font-style.- Returns:
- The font-style declaration.
getFontStyleIndex
public int getFontStyleIndex()
Gets the font-style index value.- Returns:
- The font-style declaration index value.
getFontWeight
public java.lang.String getFontWeight()
Gets the font-weight.- Returns:
- The font-weight declaration.
getDescriptiveFontWeight
public java.lang.String getDescriptiveFontWeight()
Gets the descriptive font-weight as e.g. "100 - thin (hairline)".- Returns:
- The descriptive font-weight declaration.
getFontWeightIndex
public int getFontWeightIndex()
Gets the font-weight index value.- Returns:
- The font-weight declaration index value.