Record Class SvgDocument
java.lang.Object
java.lang.Record
io.leandev.appfuse.report.internal.svg.SvgDocument
- Record Components:
viewX- viewBox 左上 xviewY- viewBox 左上 yviewWidth- viewBox 寬viewHeight- viewBox 高align-preserveAspectRatio的對齊;null表示noneslice-slice(否則為meet)items- 繪圖項目
public record SvgDocument(double viewX, double viewY, double viewWidth, double viewHeight, SvgDocument.Align align, boolean slice, List<SvgDocument.Item> items)
extends Record
解析並通過政策檢查的 SVG:viewBox 與依文件順序排列的繪圖項目(使用者座標)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumpreserveAspectRatio的九種對齊;數值為水平、垂直的比例位置static interface繪圖項目;transform為祖先與自身 transform 的累積(不含 viewBox 映射)static final record一段同樣式的文字;x/y為null表示接續前一段的位置static final recordstatic final record一個text元素;runs為其文字與tspan依序展開 -
Constructor Summary
ConstructorsConstructorDescriptionSvgDocument(double viewX, double viewY, double viewWidth, double viewHeight, SvgDocument.Align align, boolean slice, List<SvgDocument.Item> items) Creates an instance of aSvgDocumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionalign()Returns the value of thealignrecord component.voidcheckRanges(double width, double height) 以 Figure 的寬高檢查衍生數值範圍(REP-04 契約「衍生數值範圍」)final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.items()Returns the value of theitemsrecord component.booleanslice()Returns the value of theslicerecord component.final StringtoString()Returns a string representation of this record class.view(double width, double height) viewBox 到 Figure 座標(pt,原點左上、y 向下)的映射doubleReturns the value of theviewHeightrecord component.doubleReturns the value of theviewWidthrecord component.doubleviewX()Returns the value of theviewXrecord component.doubleviewY()Returns the value of theviewYrecord component.
-
Constructor Details
-
SvgDocument
public SvgDocument(double viewX, double viewY, double viewWidth, double viewHeight, SvgDocument.Align align, boolean slice, List<SvgDocument.Item> items) Creates an instance of aSvgDocumentrecord class.- Parameters:
viewX- the value for theviewXrecord componentviewY- the value for theviewYrecord componentviewWidth- the value for theviewWidthrecord componentviewHeight- the value for theviewHeightrecord componentalign- the value for thealignrecord componentslice- the value for theslicerecord componentitems- the value for theitemsrecord component
-
-
Method Details
-
view
viewBox 到 Figure 座標(pt,原點左上、y 向下)的映射 -
checkRanges
public void checkRanges(double width, double height) 以 Figure 的寬高檢查衍生數值範圍(REP-04 契約「衍生數值範圍」)- Throws:
SvgException-OUT_OF_RANGE
-
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. -
viewX
-
viewY
-
viewWidth
-
viewHeight
public double viewHeight()Returns the value of theviewHeightrecord component.- Returns:
- the value of the
viewHeightrecord component
-
align
-
slice
-
items
-