RED-9139: move document to its own module, add TableOfContents and TableOfContentsItem

* update LayoutEngine package
This commit is contained in:
Kilian Schuettler 2024-11-13 12:26:10 +01:00
parent 6de802b5a4
commit 3671d96c26

View File

@ -29,6 +29,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull;
import lombok.experimental.FieldDefaults; import lombok.experimental.FieldDefaults;
@Data @Data
@ -37,25 +38,36 @@ import lombok.experimental.FieldDefaults;
@FieldDefaults(level = AccessLevel.PRIVATE) @FieldDefaults(level = AccessLevel.PRIVATE)
public class AtomicTextBlock implements TextBlock { public class AtomicTextBlock implements TextBlock {
@NonNull
Long id; Long id;
@NonNull
Integer numberOnPage; Integer numberOnPage;
@NonNull
Page page; Page page;
//string coordinates //string coordinates
@NonNull
TextRange textRange; TextRange textRange;
@NonNull
String searchText; String searchText;
@NonNull
List<Integer> lineBreaks; List<Integer> lineBreaks;
@NonNull
List<TextRange> italicTextRanges; List<TextRange> italicTextRanges;
@NonNull
List<TextRange> boldTextRanges; List<TextRange> boldTextRanges;
SoftReference<String> searchTextLowerCaseCache; SoftReference<String> searchTextLowerCaseCache;
SoftReference<List<String>> wordsCache; SoftReference<List<String>> wordsCache;
//position coordinates //position coordinates
@NonNull
List<Integer> stringIdxToPositionIdx; List<Integer> stringIdxToPositionIdx;
@Getter @Getter
@NonNull
List<Rectangle2D> positions; List<Rectangle2D> positions;
@NonNull
@EqualsAndHashCode.Exclude @EqualsAndHashCode.Exclude
SemanticNode parent; SemanticNode parent;
@ -79,6 +91,8 @@ public class AtomicTextBlock implements TextBlock {
.stringIdxToPositionIdx(Collections.emptyList()) .stringIdxToPositionIdx(Collections.emptyList())
.positions(Collections.emptyList()) .positions(Collections.emptyList())
.parent(parent) .parent(parent)
.boldTextRanges(Collections.emptyList())
.italicTextRanges(Collections.emptyList())
.build(); .build();
} }