X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FDisplayLine.java;h=87e6952fb515447b43500395d40cb8e80d0c919b;hb=505be508ae7d3fb48122be548b310a238cfb91eb;hp=a32da9b4d603b7dd96d26807f6745c89d2549624;hpb=027de5ae322ef58d3bc74051d3aa20847455361a;p=fanfix.git diff --git a/src/jexer/tterminal/DisplayLine.java b/src/jexer/tterminal/DisplayLine.java index a32da9b..87e6952 100644 --- a/src/jexer/tterminal/DisplayLine.java +++ b/src/jexer/tterminal/DisplayLine.java @@ -221,7 +221,7 @@ public class DisplayLine { * @param idx the character index * @param ch the new char */ - public void setChar(final int idx, final char ch) { + public void setChar(final int idx, final int ch) { chars[idx].setChar(ch); } @@ -248,4 +248,29 @@ public class DisplayLine { chars[chars.length - 1] = new Cell(newCell); } + /** + * Determine if line contains image data. + * + * @return true if the line has image data + */ + public boolean isImage() { + for (int i = 0; i < chars.length; i++) { + if (chars[i].isImage()) { + return true; + } + } + return false; + } + + /** + * Clear image data from line. + */ + public void clearImages() { + for (int i = 0; i < chars.length; i++) { + if (chars[i].isImage()) { + chars[i].reset(); + } + } + } + }