Class Page
java.lang.Object
eu.svjatoslav.sixth.e3d.gui.textEditorComponent.Page
A page in a text editor.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
ensureMaxTextLine
(int row) char
getChar
(int row, int column) Returns the character at the specified location.getLine
(int row) Returns the specified line.int
getLineLength
(int row) Returns the length of the specified line.int
Returns the number of lines in the page.getText()
Returns the text of the page.void
insertCharacter
(int row, int col, char value) void
insertLine
(int row, TextLine textLine) void
removeCharacter
(int row, int col) Removes the specified character from the page.void
removeLine
(int row) Removes the specified line from the page.
-
Field Details
-
rows
The text lines.
-
-
Constructor Details
-
Page
public Page()
-
-
Method Details
-
ensureMaxTextLine
public void ensureMaxTextLine(int row) -
getChar
public char getChar(int row, int column) Returns the character at the specified location. If the location is out of bounds, returns a space.- Returns:
- The character at the specified location.
-
getLine
Returns the specified line.- Parameters:
row
- The line number.- Returns:
- The line.
-
getLineLength
public int getLineLength(int row) Returns the length of the specified line.- Parameters:
row
- The line number.- Returns:
- The length of the line.
-
getLinesCount
public int getLinesCount()Returns the number of lines in the page.- Returns:
- The number of lines in the page.
-
getText
Returns the text of the page.- Returns:
- The text of the page.
-
insertCharacter
public void insertCharacter(int row, int col, char value) -
insertLine
-
removeCharacter
public void removeCharacter(int row, int col) Removes the specified character from the page.- Parameters:
row
- The line number.col
- The character number.
-
removeLine
public void removeLine(int row) Removes the specified line from the page.- Parameters:
row
- The line number.
-