Class StyleFontFactory
- java.lang.Object
-
- com.levigo.jadice.appbase.font.factory.StyleFontFactory
-
- All Implemented Interfaces:
FontFactory
- Direct Known Subclasses:
FuzzyStyleFontFactory
public class StyleFontFactory extends Object implements FontFactory
Finds a font based solely on Style information, disregarding the name.
-
-
Constructor Summary
Constructors Constructor Description StyleFontFactory(FontManagerFuture fontManagerFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Font
create(FontAttributeSet fontAttributeSet, Map<String,Object> scope)
Supply aFont
which fits well for the requested parameters.protected FontSource
findMonospaced(Collection<? extends FontStyleAttribute> styleAttributes)
protected FontSource
findSansSerif(Collection<? extends FontStyleAttribute> styleAttributes)
protected FontSource
findSerif(Collection<? extends FontStyleAttribute> styleAttributes)
protected boolean
isMonospaced(FontAttributeSet fontAttributeSet)
protected boolean
isSerif(FontAttributeSet fontAttributeSet)
-
-
-
Constructor Detail
-
StyleFontFactory
public StyleFontFactory(FontManagerFuture fontManagerFuture)
-
-
Method Detail
-
create
public Font create(FontAttributeSet fontAttributeSet, Map<String,Object> scope)
Description copied from interface:FontFactory
Supply aFont
which fits well for the requested parameters. Care should be taken to provide a fast implementation. This method might be called frequently and from various Threads at the same time. Blocking should be avoided.- Specified by:
create
in interfaceFontFactory
- Parameters:
fontAttributeSet
- TheAttribute
s the requested font should have. Characteristics like its name or styles.scope
- Information about this request's scope. This could encompass things like its intent, target, purpose or source.- Returns:
- a
Font
deemed appropriate, ornull
if no suchFont
is available. Some implementations might be able to return aFont
which fits all requested characteristics. Others might have several to choose from or none at all. TheFont
which is returned doesn't have to fit all of the requested characteristics, or even any at all. It must only be appropriate in the given situation. - See Also:
Scopes
-
isMonospaced
protected boolean isMonospaced(FontAttributeSet fontAttributeSet)
-
isSerif
protected boolean isSerif(FontAttributeSet fontAttributeSet)
-
findMonospaced
protected FontSource findMonospaced(Collection<? extends FontStyleAttribute> styleAttributes)
-
findSerif
protected FontSource findSerif(Collection<? extends FontStyleAttribute> styleAttributes)
-
findSansSerif
protected FontSource findSansSerif(Collection<? extends FontStyleAttribute> styleAttributes)
-
-