APIdia Launch Partner
Top Description Fields Constructors Methods
jfx.incubator.scene.control.richtext.model

public abstract Class ContentChange

extends Object
Class Inheritance
Imports
jfx.incubator.scene.control.richtext.TextPos

Contains information about 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:

The following diagram illustrates the inserted content relative to the start position (S) and the end position (E):
.......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.
Since
24

Field Summary

Modifier and TypeField and Description
private final TextPos
private final TextPos

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of characters
getCharsAddedBottom
()

The number of characters added at the beginning of the existing paragraph which contains the end position.

public int

Returns:

the number of characters inserted
getCharsAddedTop
()

The number of characters added at the end of the paragraph which contains the start position.

public TextPos

Returns:

the end position
getEnd
()

Returns the end position.

public int

Returns:

the number of paragraphs
getLinesAdded
()

The number of whole paragraphs inserted.

public TextPos

Returns:

the start position
getStart
()

Returns the start position.

public boolean

Returns:

true if change is an edit
isEdit
()

Determines whether the change is an edit (true) or affects styling only (false).

public static ContentChange

Returns:

the change instance
ofEdit
(TextPos
the 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 instance
ofStyleChange
(TextPos
the start position
start
,
TextPos
the end position
end
)

Creates the content change event which represents a styling update.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

endback to summary
private final TextPos end
startback to summary
private final TextPos start

Constructor Detail

ContentChangeback to summary
private ContentChange(TextPos start, TextPos end)

Method Detail

getCharsAddedBottomback to summary
public int getCharsAddedBottom()

The number of characters added at the beginning of the existing paragraph which contains the end position.

Returns:int

the number of characters

getCharsAddedTopback to summary
public int getCharsAddedTop()

The number of characters added at the end of the paragraph which contains the start position.

Returns:int

the number of characters inserted

getEndback to summary
public TextPos getEnd()

Returns the end position.

Returns:TextPos

the end position

getLinesAddedback to summary
public int getLinesAdded()

The number of whole paragraphs inserted.

Returns:int

the number of paragraphs

getStartback to summary
public TextPos getStart()

Returns the start position.

Returns:TextPos

the start position

isEditback to summary
public boolean isEdit()

Determines whether the change is an edit (true) or affects styling only (false).

Returns:boolean

true if change is an edit

ofEditback 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.

Parameters
start:TextPos

the start position

end:TextPos

the end position

charsAddedTop:int

the number of characters appended to the paragraph containing the start position

linesAdded:int

the number of full paragraphs inserted

charsAddedBottom:int

the number of characters inserted at the beginning of the paragraph containing the end position

Returns:ContentChange

the change instance

ofStyleChangeback to summary
public static ContentChange ofStyleChange(TextPos start, TextPos end)

Creates the content change event which represents a styling update.

Parameters
start:TextPos

the start position

end:TextPos

the end position

Returns:ContentChange

the change instance