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 classFont.SchemeValueEnum for the font schemestatic classFont.VerticalAlignValueEnum for the vertical alignment of the text from base line
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULTFONTDefault 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 Fontcopy()Method to copy the current object to a new oneStringgetCharset()Gets the charset of the Font (Default is empty)intgetColorTheme()Gets the font color theme (Default is 1)StringgetColorValue()Gets the Font color (default is empty)StringgetFamily()Gets the font family (Default is 2)StringgetName()Gets the font name (Default is Calibri)Font.SchemeValuegetScheme()Gets the font scheme (Default is minor)intgetSize()Gets the font size.Font.VerticalAlignValuegetVerticalAlign()Gets the alignment of the font (Default is none)inthashCode()Override method to calculate the hash of this componentbooleanisBold()Gets the bold parameter of the fontbooleanisDefaultFont()Gets whether this object is the default fontbooleanisDoubleUnderline()Gets the double-underline parameter of the fontbooleanisItalic()Gets the italic parameter of the fontbooleanisStrike()Gets whether the font is struck throughbooleanisUnderline()Gets the underline parameter of the fontvoidsetBold(boolean bold)Sets the bold parameter of the fontvoidsetCharset(String charset)Sets the charset of the Font (Default is empty)voidsetColorTheme(int colorTheme)Sets the font color theme (Default is 1)voidsetColorValue(String colorValue)Sets the font color (default is empty)voidsetDoubleUnderline(boolean doubleUnderline)Sets the double-underline parameter of the fontvoidsetFamily(String family)Sets the font family (Default is 2)voidsetItalic(boolean italic)Sets the italic parameter of the fontvoidsetName(String name)Sets the font name (Default is Calibri)voidsetScheme(Font.SchemeValue scheme)Sets the Font scheme (Default is minor)voidsetSize(int size)Sets the Font size.voidsetStrike(boolean strike)Sets whether the font is struck throughvoidsetUnderline(boolean underline)Sets the underline parameter of the fontvoidsetVerticalAlign(Font.VerticalAlignValue verticalAlign)Sets the Alignment of the font (Default is none)StringtoString()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:
copyin classAbstractStyle- Returns:
- Copy of the current object without the internal ID
-
-