/*
- * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
* This project is released under Creative Commons Zero (CC0) license.
*/
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
*/
private final Set<Integer> dirtyRows = new HashSet<>();
+
private final TextCanvas textCanvas;
public int scrolledCharacters = 0, scrolledLines = 0;
public boolean selecting = false;
+
+ /**
+ * Selection start and end pointers.
+ */
public TextPointer selectionStart = new TextPointer(0, 0);
public TextPointer selectionEnd = new TextPointer(0, 0);
+
+
public TextPointer cursorLocation = new TextPointer(0, 0);
Page page = new Page();
LookAndFeel lookAndFeel;
+
+ /**
+ * If true, the page will be repainted on the next update.
+ */
boolean repaintPage = false;
public TextEditComponent(final Transform transform,
if (keyCode == KeyboardHelper.PGUP) {
cursorLocation.row -= textCanvas.getSize().row;
repaintPage = true;
- return;
}
}
dirtyRows.clear();
}
- // public void setCaret(final int x, final int y) {
- // selecting = false;
- // cursorLocation.column = (x / characterWidth) + scrolledCharacters;
- // cursorLocation.row = (y / characterHeight) + scrolledLines;
- // repaintPage();
- // }
-
/**
* Scroll full page to given amount of lines or charancters.
*/