Class SwingAnnotationProfileBasicFontFactory
- java.lang.Object
-
- com.levigo.jadice.demo.font.annotation.SwingAnnotationProfileBasicFontFactory
-
- All Implemented Interfaces:
AnnotationFontFactory,FontFactory,SwingAnnotationFontFactory
public class SwingAnnotationProfileBasicFontFactory extends Object implements SwingAnnotationFontFactory
FallbackSwingAnnotationFontFactoryimplementation for unknown font names. This class is a demo implementation and not used in any class / annotation profile of the distribution.
-
-
Field Summary
Fields Modifier and Type Field Description protected SwingAnnotationFontFactoryfontFactory
-
Constructor Summary
Constructors Constructor Description SwingAnnotationProfileBasicFontFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Fontcreate(FontAttributeSet fontAttributeSet, Map<String,Object> scope)Supply aFontwhich fits well for the requested parameters.FontcreateAWTFont(FontAttributeSet fontAttributeSet)ReturnsFontinstance for givenFontAttributeSetdefinition.Collection<FontAttributeSet>getAvailableFontAttributeSets()Returns available fonts provided by this implementation described viaFontAttributeSetclass.protected FontManagerFuturegetFontManagerFuture()
-
-
-
Field Detail
-
fontFactory
protected final SwingAnnotationFontFactory fontFactory
-
-
Method Detail
-
getAvailableFontAttributeSets
public Collection<FontAttributeSet> getAvailableFontAttributeSets()
Description copied from interface:AnnotationFontFactoryReturns available fonts provided by this implementation described viaFontAttributeSetclass. This method is currently used by annotation based font face editors. Current implementations provide a simpleFontAttributeSetdefinition containingFamilyNameattribute only.- Specified by:
getAvailableFontAttributeSetsin interfaceAnnotationFontFactory- Returns:
FontAttributeSetdefinition
-
create
public Font create(FontAttributeSet fontAttributeSet, Map<String,Object> scope)
Description copied from interface:FontFactorySupply aFontwhich 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:
createin interfaceFontFactory- Parameters:
fontAttributeSet- TheAttributes 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
Fontdeemed appropriate, ornullif no suchFontis available. Some implementations might be able to return aFontwhich fits all requested characteristics. Others might have several to choose from or none at all. TheFontwhich 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
-
createAWTFont
public Font createAWTFont(FontAttributeSet fontAttributeSet)
Description copied from interface:SwingAnnotationFontFactoryReturnsFontinstance for givenFontAttributeSetdefinition.- Specified by:
createAWTFontin interfaceSwingAnnotationFontFactory- Parameters:
fontAttributeSet-FontAttributeSetinstance- Returns:
Fontinstance corresponding to the givenFontAttributeSetdefinition, ornullif no suchFontis available.
-
getFontManagerFuture
protected FontManagerFuture getFontManagerFuture()
-
-