From 1e550d99c11b1711a3a7aa93587eb3d7addddcd2 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Thu, 26 Oct 2017 19:06:11 -0700 Subject: [PATCH] Rename navigator to clarify usage; remove middle-man method --- .../java/org/fxmisc/richtext/GenericStyledArea.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java index d4f9c24af..d29686b2b 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java @@ -551,7 +551,7 @@ public Optional, Codec>>> getStyleCodecs( // used for two-level navigation, where on the higher level are // paragraphs and on the lower level are lines within a paragraph - private final TwoLevelNavigator navigator; + private final TwoLevelNavigator paragraphLineNavigator; private boolean followCaretRequested = false; @@ -724,7 +724,7 @@ public GenericStyledArea( // initialize navigator IntSupplier cellCount = () -> getParagraphs().size(); IntUnaryOperator cellLength = i -> virtualFlow.getCell(i).getNode().getLineCount(); - navigator = new TwoLevelNavigator(cellCount, cellLength); + paragraphLineNavigator = new TwoLevelNavigator(cellCount, cellLength); viewportDirty = merge( // no need to check for width & height invalidations as scroll values update when these do @@ -891,7 +891,7 @@ TwoDimensional.Position currentLine() { int parIdx = getCurrentParagraph(); Cell, ParagraphBox> cell = virtualFlow.getCell(parIdx); int lineIdx = cell.getNode().getCurrentLineIndex(); - return _position(parIdx, lineIdx); + return paragraphLineNavigator.position(parIdx, lineIdx); } @Override @@ -900,10 +900,6 @@ public final int lineIndex(int paragraphIndex, int columnPosition) { return cell.getNode().getCurrentLineIndex(columnPosition); } - TwoDimensional.Position _position(int par, int line) { - return navigator.position(par, line); - } - @Override public int getParagraphLinesCount(int paragraphIndex) { return virtualFlow.getCell(paragraphIndex).getNode().getLineCount();