private void insertPuncAfterNonPunc(TextBlock tb, char c) { TextBlock bnx = tb.nextTextBlock(); if (bnx instanceof PunctuationBlock) { insertPuncInPunc(bnx, c, 0); } else { addNewPuncBlockAfter(tb, c); } }
private void newline() { if (caretPos == 0) { TextBlock tbp = caretBlock.previousTextBlock(); if (tbp != null) { tbp.newlineAfter(); } } else if (caretPos == caretBlock.textLength()) { caretBlock.newlineAfter(); caretBlock = caretBlock.nextTextBlock(); caretPos = 1; } else { caretBlock.insertNewline(caretPos); caretBlock = caretBlock.nextTextBlock(); caretPos = 1; } }
private void insertLetterAfterNonWord(TextBlock tb, char c) { TextBlock bnx = tb.nextTextBlock(); if (bnx instanceof WordBlock) { insertLetterInWord(bnx, c, 0); } else { addNewWordBlockAfter(tb, c); } }
public void caretRight() { if (caretBlock == null) { return; } if (caretPos < caretBlock.textLength()) { caretPos += 1; } else { TextBlock tb = caretBlock.nextTextBlock(); if (tb == null) { } else { caretBlock = tb; caretPos = 1; } } textBoard.repaint(); }