Class DefaultFontCollectionsFactory

java.lang.Object
org.jhotdraw8.fxcontrols.fontchooser.DefaultFontCollectionsFactory
All Implemented Interfaces:
FontCollectionsFactory
Direct Known Subclasses:
MacOSFontCollectionsFactory

public class DefaultFontCollectionsFactory extends Object implements FontCollectionsFactory
DefaultFontCollectionsFactory.
Author:
Werner Randelshofer
  • Constructor Details

    • DefaultFontCollectionsFactory

      public DefaultFontCollectionsFactory()
  • Method Details

    • create

      public @NonNull List<FontCollection> create()
      Creates a FontChooserModel.

      This is an IO intensive operation and should therefore not be called on the JavaFX Application Thread.

      Specified by:
      create in interface FontCollectionsFactory
      Returns:
      a FontChooserModel.
    • loadFonts

      protected @NonNull List<FontFamily> loadFonts()
      Loads all Fonts that are available to JavaFX.
      Returns:
      the list of fonts
    • generateCollections

      protected @NonNull javafx.collections.ObservableList<FontCollection> generateCollections(@NonNull List<FontFamily> families)
      Groups a list of font families into collections.

      This implementation uses a hardcoded set of collections.

      Parameters:
      families - a list of font families
      Returns:
      a collection of font families
    • collectFamiliesNamed

      public static @NonNull ArrayList<FontFamily> collectFamiliesNamed(@NonNull List<FontFamily> allFamilies, String... names)