- * Get the number of graphical cells represented by this text. Note that
- * a Unicode grapheme cluster can take any number of pixels, but this
- * editor is intended to be used with a fixed-width font. So this count
- * returns the number of fixed-width cells, NOT the number of grapheme
- * clusters.
- *
- * @return the number of fixed-width cells this fragment's text will
- * render to
- */
- public int getCellCount() {
- return cells.size();
- }
-
- /**
- * Get the text to render for a specific fixed-width cell.
- *
- * @param index a cell number, between 0 and getCellCount()
- * @return the codepoints to render for this fixed-width cell
- * @throws IndexOutOfBoundsException if index is negative or not less
- * than getCellCount()
- */
- public Cell getCell(final int index) {
- return cells.get(index);
- }
-
- /**
- * Get the text to render for several fixed-width cells.
- *
- * @param start a cell number, between 0 and getCellCount()
- * @param length the number of cells to return
- * @return the codepoints to render for this fixed-width cell
- * @throws IndexOutOfBoundsException if start or (start + length) is
- * negative or not less than getCellCount()
- */
- public String getCells(final int start, final int length) {
- char [] text = new char[length];
- for (int i = 0; i < length; i++) {
- text[i] = cells.get(i + start).getChar();
- }
- return new String(text);
- }
-
- /**
- * Sets (replaces) the text to render for a specific fixed-width cell.