Class AWTHelper

java.lang.Object
io.sf.carte.doc.style.css.awt.AWTHelper

public class AWTHelper extends Object
AWT helper methods.
  • Constructor Details

    • AWTHelper

      public AWTHelper()
  • Method Details

    • createFont

      public static Font createFont(CSSComputedProperties computedStyle)
      Create an AWT Font object from a computed style.
      Parameters:
      computedStyle - the computed style.
      Returns:
      the font.
    • getAWTColor

      public static Color getAWTColor(CSSTypedValue cssColor) throws CSSPropertyValueException
      Gets the AWT color as obtained from the given CSS primitive value.
      Parameters:
      cssColor - the primitive color value, which can contain an RGB color, a number or an identifier.
      Returns:
      the AWT color object, or null if the color was specified as an unknown identifier.
      Throws:
      CSSPropertyValueException - if a color cannot be derived from the CSS value.