Record Class TextFlow
java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.TextFlow
- Record Components:
whiteSpace- 空白與原始換行處理overflowWrap- 正常斷點不足時的換行方式tabSize- 每個 Tab stop 的半形空格數;0 不移動tabStop- 選填固定 Tab stop 間距;非 null 時優先於 tabSizeavoidLineStart- 是否避免關閉括號及句讀出現在行首avoidLineEnd- 是否避免開啟括號出現在行尾hangingPunctuation- 是否允許一個行尾避頭標點懸掛;有界頁首仍禁止超出欄寬trailingEmptyLine- 是否在末尾換行後再保留一行;false 為 CSS pre-wrap 的末尾換行行高
public record TextFlow(TextFlow.WhiteSpace whiteSpace, TextFlow.OverflowWrap overflowWrap, int tabSize, Length tabStop, boolean avoidLineStart, boolean avoidLineEnd, boolean hangingPunctuation, boolean trailingEmptyLine)
extends Record
明確啟用的文字流配置;未在 ParagraphStyle 設定時,原有排版及 bytes 不變。
策略以整個段落為單位,包含不同字型的 Inline;儲存格與分節 Block 頁首使用相同策略。 Tab stop 由段落的字型與字級計算,不以空格取代原文。
- Since:
- 4.0.0-alpha.30
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionTextFlow(TextFlow.WhiteSpace whiteSpace, TextFlow.OverflowWrap overflowWrap, int tabSize, Length tabStop, boolean avoidLineStart, boolean avoidLineEnd, boolean hangingPunctuation, boolean trailingEmptyLine) Creates an instance of aTextFlowrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theavoidLineEndrecord component.booleanReturns the value of theavoidLineStartrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thehangingPunctuationrecord component.final inthashCode()Returns a hash code value for this object.static TextFlownormal()CSS normal 空白折疊、overflow-wrap:anywhere、無標點懸掛。Returns the value of theoverflowWraprecord component.static TextFlowpreWrap()CSS pre-wrap、overflow-wrap:anywhere、tab-size:4;單一末尾換行只結束目前行。inttabSize()Returns the value of thetabSizerecord component.tabStop()Returns the value of thetabStoprecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetrailingEmptyLinerecord component.Returns the value of thewhiteSpacerecord component.withAvoidLineEnd(boolean value) withAvoidLineStart(boolean value) withHangingPunctuation(boolean value) withTabSize(int value) withTabStop(Length value) withTrailingEmptyLine(boolean value)
-
Constructor Details
-
TextFlow
public TextFlow(TextFlow.WhiteSpace whiteSpace, TextFlow.OverflowWrap overflowWrap, int tabSize, Length tabStop, boolean avoidLineStart, boolean avoidLineEnd, boolean hangingPunctuation, boolean trailingEmptyLine) Creates an instance of aTextFlowrecord class.- Parameters:
whiteSpace- the value for thewhiteSpacerecord componentoverflowWrap- the value for theoverflowWraprecord componenttabSize- the value for thetabSizerecord componenttabStop- the value for thetabStoprecord componentavoidLineStart- the value for theavoidLineStartrecord componentavoidLineEnd- the value for theavoidLineEndrecord componenthangingPunctuation- the value for thehangingPunctuationrecord componenttrailingEmptyLine- the value for thetrailingEmptyLinerecord component
-
-
Method Details
-
normal
CSS normal 空白折疊、overflow-wrap:anywhere、無標點懸掛。 -
preWrap
CSS pre-wrap、overflow-wrap:anywhere、tab-size:4;單一末尾換行只結束目前行。 -
withWhiteSpace
-
withOverflowWrap
-
withTabSize
-
withTabStop
-
withAvoidLineStart
-
withAvoidLineEnd
-
withHangingPunctuation
-
withTrailingEmptyLine
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
whiteSpace
Returns the value of thewhiteSpacerecord component.- Returns:
- the value of the
whiteSpacerecord component
-
overflowWrap
Returns the value of theoverflowWraprecord component.- Returns:
- the value of the
overflowWraprecord component
-
tabSize
-
tabStop
-
avoidLineStart
public boolean avoidLineStart()Returns the value of theavoidLineStartrecord component.- Returns:
- the value of the
avoidLineStartrecord component
-
avoidLineEnd
public boolean avoidLineEnd()Returns the value of theavoidLineEndrecord component.- Returns:
- the value of the
avoidLineEndrecord component
-
hangingPunctuation
public boolean hangingPunctuation()Returns the value of thehangingPunctuationrecord component.- Returns:
- the value of the
hangingPunctuationrecord component
-
trailingEmptyLine
public boolean trailingEmptyLine()Returns the value of thetrailingEmptyLinerecord component.- Returns:
- the value of the
trailingEmptyLinerecord component
-