Package io.keikai.axyra.sheets.style
Class CellStyle
java.lang.Object
io.keikai.axyra.sheets.style.CellStyle
An immutable cell style — font, fill, borders, alignment, number format, and
protection. Build one with
builder() and apply it via
Range.setStyle(...); read one back via Range.style() and
edit an existing style via toBuilder().
Crosses the JNI boundary as a single flat JSON object (the engine dedups
identical styles into one id). Colors are fully typed: theme / indexed /
automatic colors read back as the corresponding Color form (see
Color.isTheme() etc.), not as opaque strings.
Rich per-run text is not represented here (see RichText).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent builder; only the attributes you set are sent (engine fills the rest). -
Method Summary
Modifier and TypeMethodDescriptionbooleanbold()The given border edge: line style plus color.The bottom border edge.The diagonal border edge (direction:diagonalDown()/diagonalUp()).The left border edge.The right border edge.The top border edge.static CellStyle.Builderbuilder()booleanWhether the diagonal border runs top-left → bottom-right.booleanWhether the diagonal border runs bottom-left → top-right.The fill background (pattern) color, ornull.The fill (foreground) color, ornull.The fill pattern type (solid / none / gray125 / …).intFont character set (0 = ANSI, 1 = DEFAULT, …).The font color (RGB, theme, indexed, or automatic), ornull.intFont-family class: 0 = n/a, 1 = Roman, 2 = Swiss, 3 = Modern, 4 = Script, 5 = Decorative.fontName()Font theme scheme ("major","minor", or empty).doublefontSize()Font vertical alignment (baseline / superscript / subscript).static CellStylePackage-private: rebuild from the engine's resolved-style JSON.intThe gradient rotation in whole degrees (ECMA-376 Part 1 §18.8.24gradientFill/@degree), or-1when the fill is not a gradient.The gradient color stops in position order (§18.8.38); empty when the fill is not a gradient.The gradient kind:"linear"(rotated bygradientDegree()) or"path"(shape-bounded, fromCellStyle.Builder.pathGradientFill(io.keikai.axyra.sheets.style.Color...)), ornullwhen the fill is not a gradient.booleanWhether this style carries a gradient fill.booleanhidden()intindent()booleanitalic()booleanlocked()booleanWhether the cell's text was entered with a leading apostrophe (ECMA-376 §18.8.45xf@quotePrefix), which keeps a number-looking value as text.booleanWhether text shrinks to fit the cell rather than wrapping or overflowing (ECMA-376 §18.8.1alignment@shrinkToFit).booleanintA builder pre-loaded with this style's attributes — the edit-existing workflow:cell.style().toBuilder().bold().build().toJson()Package-private: the flat JSON crossed to the engine.booleanwrapText()
-
Method Details
-
builder
-
toBuilder
A builder pre-loaded with this style's attributes — the edit-existing workflow:cell.style().toBuilder().bold().build(). -
toJson
Package-private: the flat JSON crossed to the engine. -
fromJson
Package-private: rebuild from the engine's resolved-style JSON. -
fontName
-
fontSize
public double fontSize() -
bold
public boolean bold() -
italic
public boolean italic() -
strikethrough
public boolean strikethrough() -
underline
-
fontColor
The font color (RGB, theme, indexed, or automatic), ornull. -
fillColor
The fill (foreground) color, ornull. -
fillBackgroundColor
The fill background (pattern) color, ornull. -
fillPattern
The fill pattern type (solid / none / gray125 / …). -
fontVertical
Font vertical alignment (baseline / superscript / subscript). -
fontCharset
public int fontCharset()Font character set (0 = ANSI, 1 = DEFAULT, …). -
fontFamily
public int fontFamily()Font-family class: 0 = n/a, 1 = Roman, 2 = Swiss, 3 = Modern, 4 = Script, 5 = Decorative. -
fontScheme
Font theme scheme ("major","minor", or empty). -
horizontalAlign
-
verticalAlign
-
shrinkToFit
public boolean shrinkToFit()Whether text shrinks to fit the cell rather than wrapping or overflowing (ECMA-376 §18.8.1alignment@shrinkToFit). -
quotePrefix
public boolean quotePrefix()Whether the cell's text was entered with a leading apostrophe (ECMA-376 §18.8.45xf@quotePrefix), which keeps a number-looking value as text. Excel hides the apostrophe but records the flag.Read-only: it records how a value was typed, so applying a style must not stamp one onto a cell that was never entered that way. There is deliberately no builder method.
-
wrapText
public boolean wrapText() -
textRotation
public int textRotation() -
indent
public int indent() -
numberFormat
-
hasGradientFill
public boolean hasGradientFill()Whether this style carries a gradient fill. -
gradientType
The gradient kind:"linear"(rotated bygradientDegree()) or"path"(shape-bounded, fromCellStyle.Builder.pathGradientFill(io.keikai.axyra.sheets.style.Color...)), ornullwhen the fill is not a gradient. -
gradientDegree
public int gradientDegree()The gradient rotation in whole degrees (ECMA-376 Part 1 §18.8.24gradientFill/@degree), or-1when the fill is not a gradient. -
gradientStops
The gradient color stops in position order (§18.8.38); empty when the fill is not a gradient. The read-back counterpart ofCellStyle.Builder.gradientFill(int, Color...). -
border
The given border edge: line style plus color. Nevernull— an absent edge reads back asBorderStyle.NONEwith anullcolor (seeBorderEdge.isPresent()). -
borderTop
The top border edge. -
borderBottom
The bottom border edge. -
borderLeft
The left border edge. -
borderRight
The right border edge. -
borderDiagonal
The diagonal border edge (direction:diagonalDown()/diagonalUp()). -
diagonalDown
public boolean diagonalDown()Whether the diagonal border runs top-left → bottom-right. -
diagonalUp
public boolean diagonalUp()Whether the diagonal border runs bottom-left → top-right. -
locked
public boolean locked()
-