X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FMultiScreen.java;h=77688734fa9179aca6414829a5bc29cdcc91ecf7;hb=615a0d99fd0aa4437116dd083147f9150d5e6527;hp=f7b61ddfc276b12befba88eca7c4aa88454c24bf;hpb=88a99379dca67603ee80819cb31716e52aa72362;p=fanfix.git diff --git a/src/jexer/backend/MultiScreen.java b/src/jexer/backend/MultiScreen.java index f7b61dd..7768873 100644 --- a/src/jexer/backend/MultiScreen.java +++ b/src/jexer/backend/MultiScreen.java @@ -39,11 +39,19 @@ import jexer.bits.CellAttributes; */ public class MultiScreen implements Screen { + // ------------------------------------------------------------------------ + // Variables -------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * The list of screens to use. */ private List screens = new LinkedList(); + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * Public constructor requires one screen. * @@ -53,25 +61,9 @@ public class MultiScreen implements Screen { screens.add(screen); } - /** - * Add a screen to the list. - * - * @param screen the screen to add - */ - public void addScreen(final Screen screen) { - screens.add(screen); - } - - /** - * Remove a screen from the list. - * - * @param screen the screen to remove - */ - public void removeScreen(final Screen screen) { - if (screens.size() > 1) { - screens.remove(screen); - } - } + // ------------------------------------------------------------------------ + // Screen ----------------------------------------------------------------- + // ------------------------------------------------------------------------ /** * Set drawing offset for x. @@ -182,7 +174,12 @@ public class MultiScreen implements Screen { * screen */ public boolean isDirty() { - return screens.get(0).isDirty(); + for (Screen screen: screens) { + if (screen.isDirty()) { + return true; + } + } + return false; } /** @@ -196,6 +193,17 @@ public class MultiScreen implements Screen { return screens.get(0).getAttrXY(x, y); } + /** + * Get the cell at one location. + * + * @param x column coordinate. 0 is the left-most column. + * @param y row coordinate. 0 is the top-most row. + * @return the character + attributes + */ + public Cell getCharXY(final int x, final int y) { + return screens.get(0).getCharXY(x, y); + } + /** * Set the attributes at one location. * @@ -520,6 +528,33 @@ public class MultiScreen implements Screen { } } + /** + * Get the cursor visibility. + * + * @return true if the cursor is visible + */ + public boolean isCursorVisible() { + return screens.get(0).isCursorVisible(); + } + + /** + * Get the cursor X position. + * + * @return the cursor x column position + */ + public int getCursorX() { + return screens.get(0).getCursorX(); + } + + /** + * Get the cursor Y position. + * + * @return the cursor y row position + */ + public int getCursorY() { + return screens.get(0).getCursorY(); + } + /** * Set the window title. * @@ -531,4 +566,28 @@ public class MultiScreen implements Screen { } } + // ------------------------------------------------------------------------ + // MultiScreen ------------------------------------------------------------ + // ------------------------------------------------------------------------ + + /** + * Add a screen to the list. + * + * @param screen the screen to add + */ + public void addScreen(final Screen screen) { + screens.add(screen); + } + + /** + * Remove a screen from the list. + * + * @param screen the screen to remove + */ + public void removeScreen(final Screen screen) { + if (screens.size() > 1) { + screens.remove(screen); + } + } + }