Package ch.rabanti.picoxlsx4j.style
Class CellXf
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.style.AbstractStyle
-
- ch.rabanti.picoxlsx4j.style.CellXf
-
- All Implemented Interfaces:
Comparable<AbstractStyle>
public class CellXf extends AbstractStyle
Class representing an XF entry. The XF entry is used to make reference to other style instances like Border or Fill and for the positioning of the cell content- Author:
- Raphael Stoeckli
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCellXf.HorizontalAlignValueEnum for the horizontal alignment of a cellstatic classCellXf.TextBreakValueEnum for text break optionsstatic classCellXf.TextDirectionValueEnum for the general text alignment directionstatic classCellXf.VerticalAlignValueEnum for the vertical alignment of a cell
-
Constructor Summary
Constructors Constructor Description CellXf()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalculateInternalRotation()Method to calculate the internal text rotation.CellXfcopy()Method to copy the current object to a new oneCellXf.TextBreakValuegetAlignment()Gets the text break options of the styleCellXf.HorizontalAlignValuegetHorizontalAlign()Gets the horizontal alignment of the styleCellXf.TextDirectionValuegetTextDirection()Gets the direction of the text within the cellintgetTextRotation()Gets the text rotation in degrees (from +90 to -90)CellXf.VerticalAlignValuegetVerticalAlign()Gets the vertical alignment of the styleinthashCode()Override method to calculate the hash of this componentbooleanisForceApplyAlignment()Gets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style.booleanisHidden()Gets whether the hidden property (used for protection or hiding of cells) will be defined in the XF entry of the style.booleanisLocked()Gets whether the locked property (used for locking / protection of cells or worksheets) will be defined in the XF entry of the style.voidsetAlignment(CellXf.TextBreakValue alignment)Sets the text break options of the stylevoidsetForceApplyAlignment(boolean forceApplyAlignment)Sets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style.voidsetHidden(boolean hidden)Sets whether the hidden property (used for protection or hiding of cells) will be defined in the XF entry of the style.voidsetHorizontalAlign(CellXf.HorizontalAlignValue horizontalAlign)Sets the horizontal alignment of the stylevoidsetLocked(boolean locked)Sets whether the locked property (used for locking / protection of cells or worksheets) will be defined in the XF entry of the style.voidsetTextDirection(CellXf.TextDirectionValue textDirection)Sets the direction of the text within the cellvoidsetTextRotation(int textRotation)Sets the text rotation in degrees (from +90 to -90)voidsetVerticalAlign(CellXf.VerticalAlignValue verticalAlign)Sets the vertical alignment of the styleStringtoString()Override toString method-
Methods inherited from class ch.rabanti.picoxlsx4j.style.AbstractStyle
compareTo, equals, getInternalID, setInternalID
-
-
-
-
Method Detail
-
getTextRotation
public int getTextRotation()
Gets the text rotation in degrees (from +90 to -90)- Returns:
- Text rotation in degrees (from +90 to -90)
-
setTextRotation
public void setTextRotation(int textRotation)
Sets the text rotation in degrees (from +90 to -90)- Parameters:
textRotation- Text rotation in degrees (from +90 to -90)- Throws:
RangeException- Thrown if the rotation angle is out of range
-
getTextDirection
public CellXf.TextDirectionValue getTextDirection()
Gets the direction of the text within the cell- Returns:
- Direction of the text within the cell
-
setTextDirection
public void setTextDirection(CellXf.TextDirectionValue textDirection)
Sets the direction of the text within the cell- Parameters:
textDirection- Direction of the text within the cell- Throws:
RangeException- Thrown if the text rotation and direction causes a conflict
-
getHorizontalAlign
public CellXf.HorizontalAlignValue getHorizontalAlign()
Gets the horizontal alignment of the style- Returns:
- Horizontal alignment of the style
-
setHorizontalAlign
public void setHorizontalAlign(CellXf.HorizontalAlignValue horizontalAlign)
Sets the horizontal alignment of the style- Parameters:
horizontalAlign- Horizontal alignment of the style
-
getVerticalAlign
public CellXf.VerticalAlignValue getVerticalAlign()
Gets the vertical alignment of the style- Returns:
- Vertical alignment of the style
-
setVerticalAlign
public void setVerticalAlign(CellXf.VerticalAlignValue verticalAlign)
Sets the vertical alignment of the style- Parameters:
verticalAlign- Vertical alignment of the style
-
getAlignment
public CellXf.TextBreakValue getAlignment()
Gets the text break options of the style- Returns:
- Text break options of the style
-
setAlignment
public void setAlignment(CellXf.TextBreakValue alignment)
Sets the text break options of the style- Parameters:
alignment- Text break options of the style
-
isLocked
public boolean isLocked()
Gets whether the locked property (used for locking / protection of cells or worksheets) will be defined in the XF entry of the style. If true, locked will be defined- Returns:
- If true, the style is used for locking / protection of cells or worksheets
-
setLocked
public void setLocked(boolean locked)
Sets whether the locked property (used for locking / protection of cells or worksheets) will be defined in the XF entry of the style. If true, locked will be defined- Parameters:
locked- If true, the style is used for locking / protection of cells or worksheets
-
isHidden
public boolean isHidden()
Gets whether the hidden property (used for protection or hiding of cells) will be defined in the XF entry of the style. If true, hidden will be defined- Returns:
- If true, the style is used for hiding cell values / protection of cells
-
setHidden
public void setHidden(boolean hidden)
Sets whether the hidden property (used for protection or hiding of cells) will be defined in the XF entry of the style. If true, hidden will be defined- Parameters:
hidden- If true, the style is used for hiding cell values / protection of cells
-
isForceApplyAlignment
public boolean isForceApplyAlignment()
Gets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style. If true, applyAlignment will be defined- Returns:
- If true, the applyAlignment value of the style will be set to true (used to merge cells)
-
setForceApplyAlignment
public void setForceApplyAlignment(boolean forceApplyAlignment)
Sets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style. If true, applyAlignment will be defined- Parameters:
forceApplyAlignment- If true, the applyAlignment value of the style will be set to true (used to merge cells)
-
calculateInternalRotation
public int calculateInternalRotation()
Method to calculate the internal text rotation. The text direction and rotation are handled internally by the text rotation value- Returns:
- Returns the valid rotation in degrees for internal uses (LowLevel)
- Throws:
RangeException- Thrown if the rotation is out of range
-
toString
public String toString()
Override toString method
-
copy
public CellXf 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
-
-