StyledTextModel content change.
This class represents two kinds of changes made to the model: one that modifies the textual content and embedded Nodes, and one that only changes styling of the content.
A content change can be though of as a replacement of content between the two positions
start and end with a different styled content (or no content).
The change object does not include the actual content, but only the information about inserted symbols:
.......STTTTTTT AAAAAAAAAAAAAAA AAAAAAAAAAAAAAA BBBE...........Where T are the characters inserted following the start position, A are the inserted complete paragraphs, and B are the characters inserted at the beginning of the paragraph that contains the end position.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of charactersThe number of characters added at the beginning of the existing paragraph which contains the end position. |
| public int | Returns: the number of characters insertedThe number of characters added at the end of the paragraph which contains the start position. |
| public TextPos | |
| public int | |
| public TextPos | |
| public boolean | Returns: true if change is an editDetermines whether the change is an edit ( |
| public static ContentChange | Returns: the change instancethe start position start, TextPos the end position end, int the number of characters appended to the paragraph containing the start position charsAddedTop, int the number of full paragraphs inserted linesAdded, int the number of characters inserted at the beginning of the paragraph containing the end position charsAddedBottom)Creates the content change event which represents an edit. |
| public static ContentChange | Returns: the change instancethe start position start, TextPos the end position end)Creates the content change event which represents a styling update. |
| end | back to summary |
|---|---|
| private final TextPos end | |
| start | back to summary |
|---|---|
| private final TextPos start | |
| ContentChange | back to summary |
|---|---|
| private ContentChange(TextPos start, TextPos end) | |
| getCharsAddedBottom | back to summary |
|---|---|
| public int getCharsAddedBottom() The number of characters added at the beginning of the existing paragraph which contains the end position.
| |
| getCharsAddedTop | back to summary |
|---|---|
| public int getCharsAddedTop() The number of characters added at the end of the paragraph which contains the start position.
| |
| getEnd | back to summary |
|---|---|
| public TextPos getEnd() Returns the end position.
| |
| getLinesAdded | back to summary |
|---|---|
| public int getLinesAdded() The number of whole paragraphs inserted.
| |
| getStart | back to summary |
|---|---|
| public TextPos getStart() Returns the start position.
| |
| isEdit | back to summary |
|---|---|
| public boolean isEdit() Determines whether the change is an edit (
| |
| ofEdit | back to summary |
|---|---|
| public static ContentChange ofEdit(TextPos start, TextPos end, int charsAddedTop, int linesAdded, int charsAddedBottom) Creates the content change event which represents an edit.
| |
| ofStyleChange | back to summary |
|---|---|
| public static ContentChange ofStyleChange(TextPos start, TextPos end) Creates the content change event which represents a styling update.
| |