Record Class ParagraphStyle
java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.ParagraphStyle
- Record Components:
text- 文字樣式覆寫align- 水平對齊lineHeight- 行高(字級的倍數)spaceBefore- 段前間距spaceAfter- 段後間距firstLineIndent- 首行縮排keepWithNext- 是否與下一個區塊保持同頁orphans- 段落在頁尾至少保留的行數widows- 段落在頁首至少保留的行數textFlow- 選填的空白、Tab 與換行策略;null 沿用原有排版repeatSpaceBefore- 是否在頁頂與每個續頁片段重複段前距;null 繼承,預設 falserepeatSpaceAfter- 是否在每頁片段(含最後片段)的容量計算及末端預留 spaceAfter;null 繼承,預設 false
public record ParagraphStyle(TextStyle text, Align align, Double lineHeight, Length spaceBefore, Length spaceAfter, Length firstLineIndent, Boolean keepWithNext, Integer orphans, Integer widows, TextFlow textFlow, Boolean repeatSpaceBefore, Boolean repeatSpaceAfter)
extends Record
段落樣式覆寫值
每個欄位為 null 時繼承上一層;Boolean.FALSE 等是明確覆寫。巢狀的 text() 逐欄位合併。
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionParagraphStyle(TextStyle text, Align align, Double lineHeight, Length spaceBefore, Length spaceAfter, Length firstLineIndent, Boolean keepWithNext, Integer orphans, Integer widows) 保留既有九參數建構器;未指定新策略時使用原有排版。ParagraphStyle(TextStyle text, Align align, Double lineHeight, Length spaceBefore, Length spaceAfter, Length firstLineIndent, Boolean keepWithNext, Integer orphans, Integer widows, TextFlow textFlow, Boolean repeatSpaceBefore) 保留 alpha.31 的十一參數建構器;未設定時沿用原有段後距行為。ParagraphStyle(TextStyle text, Align align, Double lineHeight, Length spaceBefore, Length spaceAfter, Length firstLineIndent, Boolean keepWithNext, Integer orphans, Integer widows, TextFlow textFlow, Boolean repeatSpaceBefore, Boolean repeatSpaceAfter) Creates an instance of aParagraphStylerecord class. -
Method Summary
Modifier and TypeMethodDescriptionalign()Returns the value of thealignrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstLineIndentrecord component.final inthashCode()Returns a hash code value for this object.static ParagraphStyleinherit()全部欄位繼承的空覆寫Returns the value of thekeepWithNextrecord component.Returns the value of thelineHeightrecord component.orphans()Returns the value of theorphansrecord component.overlay(ParagraphStyle override) 以override的非null欄位覆寫本樣式;文字樣式逐欄位合併Returns the value of therepeatSpaceAfterrecord component.Returns the value of therepeatSpaceBeforerecord component.Returns the value of thespaceAfterrecord component.Returns the value of thespaceBeforerecord component.text()Returns the value of thetextrecord component.textFlow()Returns the value of thetextFlowrecord component.final StringtoString()Returns a string representation of this record class.widows()Returns the value of thewidowsrecord component.withFirstLineIndent(Length firstLineIndent) withKeepWithNext(Boolean keepWithNext) withLineHeight(Double lineHeight) withOrphans(Integer orphans) withRepeatSpaceAfter(Boolean repeat) 在每頁內文段落片段預留 spaceAfter,再計算可容納行數;包含單頁段落與最後片段。 續頁前保留該段後距,最後片段只套用一次;不改變文字、空白與原始換行策略。 不套用於表格儲存格或固定頁首頁尾區域;那些區域由外層容器決定分頁與容量。withRepeatSpaceBefore(Boolean repeatSpaceBefore) 在段落的頁頂與所有續頁片段重複 spaceBefore;未設定時保持既有行為。withSpaceAfter(Length spaceAfter) withSpaceBefore(Length spaceBefore) withTextFlow(TextFlow textFlow) 明確啟用新的文字流策略;null 表示繼承。withWidows(Integer widows)
-
Constructor Details
-
ParagraphStyle
-
ParagraphStyle
-
ParagraphStyle
public ParagraphStyle(TextStyle text, Align align, Double lineHeight, Length spaceBefore, Length spaceAfter, Length firstLineIndent, Boolean keepWithNext, Integer orphans, Integer widows, TextFlow textFlow, Boolean repeatSpaceBefore, Boolean repeatSpaceAfter) Creates an instance of aParagraphStylerecord class.- Parameters:
text- the value for thetextrecord componentalign- the value for thealignrecord componentlineHeight- the value for thelineHeightrecord componentspaceBefore- the value for thespaceBeforerecord componentspaceAfter- the value for thespaceAfterrecord componentfirstLineIndent- the value for thefirstLineIndentrecord componentkeepWithNext- the value for thekeepWithNextrecord componentorphans- the value for theorphansrecord componentwidows- the value for thewidowsrecord componenttextFlow- the value for thetextFlowrecord componentrepeatSpaceBefore- the value for therepeatSpaceBeforerecord componentrepeatSpaceAfter- the value for therepeatSpaceAfterrecord component
-
-
Method Details
-
inherit
-
withText
-
withAlign
-
withLineHeight
-
withSpaceBefore
-
withSpaceAfter
-
withFirstLineIndent
-
withKeepWithNext
-
withOrphans
-
withWidows
-
withTextFlow
明確啟用新的文字流策略;null 表示繼承。 -
withRepeatSpaceBefore
在段落的頁頂與所有續頁片段重複 spaceBefore;未設定時保持既有行為。 -
withRepeatSpaceAfter
在每頁內文段落片段預留 spaceAfter,再計算可容納行數;包含單頁段落與最後片段。 續頁前保留該段後距,最後片段只套用一次;不改變文字、空白與原始換行策略。 不套用於表格儲存格或固定頁首頁尾區域;那些區域由外層容器決定分頁與容量。- Parameters:
repeat- null 繼承;true 啟用,false(預設)沿用原有行為- Returns:
- 新樣式
-
overlay
以override的非null欄位覆寫本樣式;文字樣式逐欄位合併- Parameters:
override- 覆寫值;null視同空覆寫- Returns:
- 合併後的新樣式
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
text
-
align
-
lineHeight
Returns the value of thelineHeightrecord component.- Returns:
- the value of the
lineHeightrecord component
-
spaceBefore
Returns the value of thespaceBeforerecord component.- Returns:
- the value of the
spaceBeforerecord component
-
spaceAfter
Returns the value of thespaceAfterrecord component.- Returns:
- the value of the
spaceAfterrecord component
-
firstLineIndent
Returns the value of thefirstLineIndentrecord component.- Returns:
- the value of the
firstLineIndentrecord component
-
keepWithNext
Returns the value of thekeepWithNextrecord component.- Returns:
- the value of the
keepWithNextrecord component
-
orphans
-
widows
-
textFlow
-
repeatSpaceBefore
Returns the value of therepeatSpaceBeforerecord component.- Returns:
- the value of the
repeatSpaceBeforerecord component
-
repeatSpaceAfter
Returns the value of therepeatSpaceAfterrecord component.- Returns:
- the value of the
repeatSpaceAfterrecord component
-