Class FlatHTML

java.lang.Object
com.formdev.flatlaf.ui.FlatHTML

public class FlatHTML extends Object
Since:
3.5
  • Field Details

    • absoluteSizeKeywordsSet

      private static final Set<String> absoluteSizeKeywordsSet
  • Constructor Details

    • FlatHTML

      private FlatHTML()
  • Method Details

    • updateRendererCSSFontBaseSize

      public static void updateRendererCSSFontBaseSize(JComponent c)
      Adds CSS rule BASE_SIZE to the style sheet of the HTML view, which re-calculates font sizes based on current component font size. This is necessary for "absolute-size" keywords (e.g. "x-large") for "font-size" attributes in default style sheet (see javax/swing/text/html/default.css). See also CSS font-size.

      This method should be invoked after BasicHTML.updateRenderer(JComponent, String).

    • usesAbsoluteSizeKeywordForFontSize

      private static boolean usesAbsoluteSizeKeywordForFontSize(View view)
      Checks whether view uses "absolute-size" keywords (e.g. "x-large") for font-size (see javax/swing/text/html/default.css).
    • updateRendererCSSForeground

      public static void updateRendererCSSForeground(View view, Color foreground)
      Updates foreground in style sheet of the HTML view. Adds "body { color: #<foreground-hex>; }"
    • clearViewCaches

      private static void clearViewCaches(View view)
      Clears cached values in view so that CSS changes take effect.
    • createPropertyChangeListener

      public static PropertyChangeListener createPropertyChangeListener(PropertyChangeListener superListener)
    • propertyChange

      public static void propertyChange(PropertyChangeEvent e)
      Invokes updateRendererCSSFontBaseSize(JComponent) for BasicHTML.propertyKey property change events, which are fired when BasicHTML.updateRenderer(JComponent, String) updates the HTML view.