Class BasicStyles

java.lang.Object
ch.rabanti.nanoxlsx4j.styles.BasicStyles

public final class BasicStyles extends Object
Factory class with the most important predefined styles
Author:
Raphael stoeckli
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Style
    Gets the bold style
    static Style
    Gets the bold and italic style
    static Style
    Gets the border frame style
    static Style
    Gets the border style for header cells
    static Style
    Gets a style to colorize the background of a cell
    static Style
    Gets a style to colorize the text of a cell
    static Style
    Gets the date format style
    static Style
    Gets the special pattern fill style (for compatibility)
    static Style
    Gets the double underline style
    static Style
    font(String fontName)
    Gets a style with a user defined Font (Font size 11)
    Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.
    static Style
    font(String fontName, float fontSize)
    Gets a style with a user defined Font
    Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.
    static Style
    font(String fontName, float fontSize, boolean isBold)
    Gets a style with a user defined Font
    Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.
    static Style
    font(String fontName, float fontSize, boolean isBold, boolean isItalic)
    Gets a style with a user defined Font
    Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.
    static Style
    Gets the italic style
    static Style
    Gets the style used when merging cells
    static Style
    Gets the round format style
    static Style
    Gets the strike style
    static Style
    Gets the time format style
    static Style
    Gets the underline style

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BasicStyles

      public BasicStyles()
  • Method Details

    • Bold

      public static Style Bold()
      Gets the bold style
      Returns:
      Style object
    • Italic

      public static Style Italic()
      Gets the italic style
      Returns:
      Style object
    • BoldItalic

      public static Style BoldItalic()
      Gets the bold and italic style
      Returns:
      Style object
    • Underline

      public static Style Underline()
      Gets the underline style
      Returns:
      Style object
    • DoubleUnderline

      public static Style DoubleUnderline()
      Gets the double underline style
      Returns:
      Style object
    • Strike

      public static Style Strike()
      Gets the strike style
      Returns:
      Style object
    • DateFormat

      public static Style DateFormat()
      Gets the date format style
      Returns:
      Style object
    • TimeFormat

      public static Style TimeFormat()
      Gets the time format style
      Returns:
      Style object
    • RoundFormat

      public static Style RoundFormat()
      Gets the round format style
      Returns:
      Style object
    • BorderFrame

      public static Style BorderFrame()
      Gets the border frame style
      Returns:
      Style object
    • BorderFrameHeader

      public static Style BorderFrameHeader()
      Gets the border style for header cells
      Returns:
      Style object
    • DottedFill_0_125

      public static Style DottedFill_0_125()
      Gets the special pattern fill style (for compatibility)
      Returns:
      Style object
    • MergeCellStyle

      public static Style MergeCellStyle()
      Gets the style used when merging cells
      Returns:
      Style object
    • colorizedText

      public static Style colorizedText(String rgb)
      Gets a style to colorize the text of a cell
      Parameters:
      rgb - RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)
      Returns:
      Style with Font color definition
    • colorizedBackground

      public static Style colorizedBackground(String rgb)
      Gets a style to colorize the background of a cell
      Parameters:
      rgb - RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)
      Returns:
      Style with background color definition
    • font

      public static Style font(String fontName)
      Gets a style with a user defined Font (Font size 11)
      Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
      Parameters:
      fontName - Name of the Font
      Returns:
      Style with Font definition
    • font

      public static Style font(String fontName, float fontSize)
      Gets a style with a user defined Font
      Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
      Parameters:
      fontName - Name of the Font
      fontSize - Size of the Font in points
      Returns:
      Style with Font definition
    • font

      public static Style font(String fontName, float fontSize, boolean isBold)
      Gets a style with a user defined Font
      Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
      Parameters:
      fontName - Name of the Font
      fontSize - Size of the Font in points
      isBold - If true, the Font will be bold
      Returns:
      Style with Font definition
    • font

      public static Style font(String fontName, float fontSize, boolean isBold, boolean isItalic)
      Gets a style with a user defined Font
      Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
      Parameters:
      fontName - Name of the Font
      fontSize - Size of the Font in points
      isBold - If true, the Font will be bold
      isItalic - If true, the Font will be italic
      Returns:
      Style with Font definition