Package ch.rabanti.picoxlsx4j.style
Class Font
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.style.AbstractStyle
-
- ch.rabanti.picoxlsx4j.style.Font
-
- All Implemented Interfaces:
Comparable<AbstractStyle>
public class Font extends AbstractStyle
Class representing a Font entry. The Font entry is used to define text formatting- Author:
- Raphael Stoeckli
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Font.SchemeValue
Enum for the font schemestatic class
Font.VerticalAlignValue
Enum for the vertical alignment of the text from base line
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULTFONT
Default font family as constant
-
Constructor Summary
Constructors Constructor Description Font()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Font
copy()
Method to copy the current object to a new oneString
getCharset()
Gets the charset of the Font (Default is empty)int
getColorTheme()
Gets the font color theme (Default is 1)String
getColorValue()
Gets the Font color (default is empty)String
getFamily()
Gets the font family (Default is 2)String
getName()
Gets the font name (Default is Calibri)Font.SchemeValue
getScheme()
Gets the font scheme (Default is minor)int
getSize()
Gets the font size.Font.VerticalAlignValue
getVerticalAlign()
Gets the alignment of the font (Default is none)int
hashCode()
Override method to calculate the hash of this componentboolean
isBold()
Gets the bold parameter of the fontboolean
isDefaultFont()
Gets whether this object is the default fontboolean
isDoubleUnderline()
Gets the double-underline parameter of the fontboolean
isItalic()
Gets the italic parameter of the fontboolean
isStrike()
Gets whether the font is struck throughboolean
isUnderline()
Gets the underline parameter of the fontvoid
setBold(boolean bold)
Sets the bold parameter of the fontvoid
setCharset(String charset)
Sets the charset of the Font (Default is empty)void
setColorTheme(int colorTheme)
Sets the font color theme (Default is 1)void
setColorValue(String colorValue)
Sets the font color (default is empty)void
setDoubleUnderline(boolean doubleUnderline)
Sets the double-underline parameter of the fontvoid
setFamily(String family)
Sets the font family (Default is 2)void
setItalic(boolean italic)
Sets the italic parameter of the fontvoid
setName(String name)
Sets the font name (Default is Calibri)void
setScheme(Font.SchemeValue scheme)
Sets the Font scheme (Default is minor)void
setSize(int size)
Sets the Font size.void
setStrike(boolean strike)
Sets whether the font is struck throughvoid
setUnderline(boolean underline)
Sets the underline parameter of the fontvoid
setVerticalAlign(Font.VerticalAlignValue verticalAlign)
Sets the Alignment of the font (Default is none)String
toString()
Override toString method-
Methods inherited from class ch.rabanti.picoxlsx4j.style.AbstractStyle
compareTo, equals, getInternalID, setInternalID
-
-
-
-
Field Detail
-
DEFAULTFONT
public static final String DEFAULTFONT
Default font family as constant- See Also:
- Constant Field Values
-
-
Method Detail
-
getSize
public int getSize()
Gets the font size. Valid range is from 8 to 75- Returns:
- Font size
-
setSize
public void setSize(int size)
Sets the Font size. Valid range is from 8 to 75- Parameters:
size
- Font size
-
getName
public String getName()
Gets the font name (Default is Calibri)- Returns:
- Font name
-
setName
public void setName(String name)
Sets the font name (Default is Calibri)- Parameters:
name
- Font name
-
getFamily
public String getFamily()
Gets the font family (Default is 2)- Returns:
- Font family
-
setFamily
public void setFamily(String family)
Sets the font family (Default is 2)- Parameters:
family
- Font family
-
getColorTheme
public int getColorTheme()
Gets the font color theme (Default is 1)- Returns:
- Font color theme
-
setColorTheme
public void setColorTheme(int colorTheme)
Sets the font color theme (Default is 1)- Parameters:
colorTheme
- Font color theme
-
getColorValue
public String getColorValue()
Gets the Font color (default is empty)- Returns:
- Font color
-
setColorValue
public void setColorValue(String colorValue)
Sets the font color (default is empty)- Parameters:
colorValue
- Font color
-
getScheme
public Font.SchemeValue getScheme()
Gets the font scheme (Default is minor)- Returns:
- Font scheme
-
setScheme
public void setScheme(Font.SchemeValue scheme)
Sets the Font scheme (Default is minor)- Parameters:
scheme
- Font scheme
-
getVerticalAlign
public Font.VerticalAlignValue getVerticalAlign()
Gets the alignment of the font (Default is none)- Returns:
- Alignment of the font
-
setVerticalAlign
public void setVerticalAlign(Font.VerticalAlignValue verticalAlign)
Sets the Alignment of the font (Default is none)- Parameters:
verticalAlign
- Alignment of the font
-
isBold
public boolean isBold()
Gets the bold parameter of the font- Returns:
- If true, the font is bold
-
setBold
public void setBold(boolean bold)
Sets the bold parameter of the font- Parameters:
bold
- If true, the font is bold
-
isItalic
public boolean isItalic()
Gets the italic parameter of the font- Returns:
- If true, the font is italic
-
setItalic
public void setItalic(boolean italic)
Sets the italic parameter of the font- Parameters:
italic
- If true, the font is italic
-
isUnderline
public boolean isUnderline()
Gets the underline parameter of the font- Returns:
- If true, the font as one underline
-
setUnderline
public void setUnderline(boolean underline)
Sets the underline parameter of the font- Parameters:
underline
- If true, the font as one underline
-
isDoubleUnderline
public boolean isDoubleUnderline()
Gets the double-underline parameter of the font- Returns:
- If true, the font ha a double underline
-
setDoubleUnderline
public void setDoubleUnderline(boolean doubleUnderline)
Sets the double-underline parameter of the font- Parameters:
doubleUnderline
- If true, the font ha a double underline
-
isStrike
public boolean isStrike()
Gets whether the font is struck through- Returns:
- If true, the font is declared as strike-through
-
setStrike
public void setStrike(boolean strike)
Sets whether the font is struck through- Parameters:
strike
- If true, the font is declared as strike-through
-
getCharset
public String getCharset()
Gets the charset of the Font (Default is empty)- Returns:
- Charset of the Font
-
setCharset
public void setCharset(String charset)
Sets the charset of the Font (Default is empty)- Parameters:
charset
- Charset of the Font
-
isDefaultFont
public boolean isDefaultFont()
Gets whether this object is the default font- Returns:
- In true the font is equals the default font
-
toString
public String toString()
Override toString method
-
copy
public Font copy()
Method to copy the current object to a new one- Specified by:
copy
in classAbstractStyle
- Returns:
- Copy of the current object without the internal ID
-
-