Class XSSFCellAlignment
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignment
-
public class XSSFCellAlignment extends java.lang.Object
Cell settings available in the Format/Alignment tab
-
-
Constructor Summary
Constructors Constructor Description XSSFCellAlignment(CTCellAlignment cellAlignment)
Creates a Cell Alignment from the supplied XML definition
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CTCellAlignment
getCTCellAlignment()
Access to low-level dataHorizontalAlignment
getHorizontal()
Get the type of horizontal alignment for the celllong
getIndent()
Get the number of spaces to indent the text in the cellReadingOrder
getReadingOrder()
Get the reading order for the cellboolean
getShrinkToFit()
long
getTextRotation()
Get the degree of rotation for the text in the cellVerticalAlignment
getVertical()
Get the type of vertical alignment for the cellboolean
getWrapText()
Whether the text should be wrappedvoid
setHorizontal(HorizontalAlignment align)
Set the type of horizontal alignment for the cellvoid
setIndent(long indent)
Set the number of spaces to indent the text in the cellvoid
setReadingOrder(ReadingOrder order)
Set the type of reading order for the cellvoid
setShrinkToFit(boolean shrink)
void
setTextRotation(long rotation)
Set the degree of rotation for the text in the cellvoid
setVertical(VerticalAlignment align)
Set the type of vertical alignment for the cellvoid
setWrapText(boolean wrapped)
Set whether the text should be wrapped
-
-
-
Constructor Detail
-
XSSFCellAlignment
public XSSFCellAlignment(CTCellAlignment cellAlignment)
Creates a Cell Alignment from the supplied XML definition- Parameters:
cellAlignment
-
-
-
Method Detail
-
getVertical
public VerticalAlignment getVertical()
Get the type of vertical alignment for the cell- Returns:
- the type of aligment
- See Also:
VerticalAlignment
-
setVertical
public void setVertical(VerticalAlignment align)
Set the type of vertical alignment for the cell- Parameters:
align
- - the type of alignment- See Also:
VerticalAlignment
-
getHorizontal
public HorizontalAlignment getHorizontal()
Get the type of horizontal alignment for the cell- Returns:
- the type of aligment
- See Also:
HorizontalAlignment
-
setHorizontal
public void setHorizontal(HorizontalAlignment align)
Set the type of horizontal alignment for the cell- Parameters:
align
- - the type of alignment- See Also:
HorizontalAlignment
-
setReadingOrder
public void setReadingOrder(ReadingOrder order)
Set the type of reading order for the cell- Parameters:
order
- - the type of reading order- See Also:
ReadingOrder
-
getReadingOrder
public ReadingOrder getReadingOrder()
Get the reading order for the cell- Returns:
- the value of reading order
- See Also:
ReadingOrder
-
getIndent
public long getIndent()
Get the number of spaces to indent the text in the cell- Returns:
- indent - number of spaces
-
setIndent
public void setIndent(long indent)
Set the number of spaces to indent the text in the cell- Parameters:
indent
- - number of spaces
-
getTextRotation
public long getTextRotation()
Get the degree of rotation for the text in the cellExpressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
- Returns:
- rotation degrees (between 0 and 180 degrees)
-
setTextRotation
public void setTextRotation(long rotation)
Set the degree of rotation for the text in the cellExpressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges accordingly, however the corresponding getter is returning values in the range mandated by the current type of Excel file-format that this CellStyle is applied to.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
- Parameters:
rotation
- - the rotation degrees (between 0 and 180 degrees)
-
getWrapText
public boolean getWrapText()
Whether the text should be wrapped- Returns:
- a boolean value indicating if the text in a cell should be line-wrapped within the cell.
-
setWrapText
public void setWrapText(boolean wrapped)
Set whether the text should be wrapped- Parameters:
wrapped
- a boolean value indicating if the text in a cell should be line-wrapped within the cell.
-
getShrinkToFit
public boolean getShrinkToFit()
-
setShrinkToFit
public void setShrinkToFit(boolean shrink)
-
getCTCellAlignment
@Internal public CTCellAlignment getCTCellAlignment()
Access to low-level data
-
-