AWT minimally working
[nikiroo-utils.git] / src / jexer / io / Screen.java
index eab9650d14aac19735f732b78036e3fcf7d28d2d..29c8485f95b837d41fece27f6b9c02af6c90cd7a 100644 (file)
@@ -216,7 +216,9 @@ public abstract class Screen {
      */
     public final CellAttributes getAttrXY(final int x, final int y) {
         CellAttributes attr = new CellAttributes();
-        attr.setTo(logical[x][y]);
+        if ((x >= 0) && (x < width) && (y >= 0) && (y < height)) {
+            attr.setTo(logical[x][y]);
+        }
         return attr;
     }
 
@@ -727,7 +729,7 @@ public abstract class Screen {
      * Subclasses must provide an implementation to push the logical screen
      * to the physical device.
      */
-    abstract public void flushPhysical();
+    public abstract void flushPhysical();
 
     /**
      * Put the cursor at (x,y).
@@ -736,8 +738,7 @@ public abstract class Screen {
      * @param x column coordinate to put the cursor on
      * @param y row coordinate to put the cursor on
      */
-    public final void putCursor(final boolean visible,
-        final int x, final int y) {
+    public void putCursor(final boolean visible, final int x, final int y) {
 
         cursorVisible = visible;
         cursorX = x;