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 class
CellXf.HorizontalAlignValue
Enum for the horizontal alignment of a cellstatic class
CellXf.TextBreakValue
Enum for text break optionsstatic class
CellXf.TextDirectionValue
Enum for the general text alignment directionstatic class
CellXf.VerticalAlignValue
Enum 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 int
calculateInternalRotation()
Method to calculate the internal text rotation.CellXf
copy()
Method to copy the current object to a new oneCellXf.TextBreakValue
getAlignment()
Gets the text break options of the styleCellXf.HorizontalAlignValue
getHorizontalAlign()
Gets the horizontal alignment of the styleCellXf.TextDirectionValue
getTextDirection()
Gets the direction of the text within the cellint
getTextRotation()
Gets the text rotation in degrees (from +90 to -90)CellXf.VerticalAlignValue
getVerticalAlign()
Gets the vertical alignment of the styleint
hashCode()
Override method to calculate the hash of this componentboolean
isForceApplyAlignment()
Gets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style.boolean
isHidden()
Gets whether the hidden property (used for protection or hiding of cells) will be defined in the XF entry of the style.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.void
setAlignment(CellXf.TextBreakValue alignment)
Sets the text break options of the stylevoid
setForceApplyAlignment(boolean forceApplyAlignment)
Sets whether the applyAlignment property (used to merge cells) will be defined in the XF entry of the style.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.void
setHorizontalAlign(CellXf.HorizontalAlignValue horizontalAlign)
Sets the horizontal alignment of the stylevoid
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.void
setTextDirection(CellXf.TextDirectionValue textDirection)
Sets the direction of the text within the cellvoid
setTextRotation(int textRotation)
Sets the text rotation in degrees (from +90 to -90)void
setVerticalAlign(CellXf.VerticalAlignValue verticalAlign)
Sets the vertical alignment of the styleString
toString()
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:
copy
in classAbstractStyle
- Returns:
- Copy of the current object without the internal ID
-
-