X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FtextEditorComponent%2FTextEditComponent.java;h=0cd379cdd9ad2032985c2bec02100037502c8b81;hb=HEAD;hp=93c05359c3e1086eeed6fcf483aa53034bc59807;hpb=d571801d69962883e194a306ee2b7110d6adc270;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java index 93c0535..0cd379c 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java @@ -1,5 +1,5 @@ /* - * 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; @@ -28,14 +28,25 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { */ private final Set 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, @@ -484,7 +495,6 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { if (keyCode == KeyboardHelper.PGUP) { cursorLocation.row -= textCanvas.getSize().row; repaintPage = true; - return; } } @@ -589,13 +599,6 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { 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. */