TTerminalWindow working
[nikiroo-utils.git] / src / jexer / TWindow.java
index 8634b2a9227c2e1bb17ab0ae01b08fcbd5268fff..2fc4aa5d578288da8cf9daf18cecee088eacdccf 100644 (file)
@@ -46,7 +46,7 @@ import static jexer.TKeypress.*;
 /**
  * TWindow is the top-level container and drawing surface for other widgets.
  */
-public class TWindow extends TWidget implements Comparable<TWindow> {
+public class TWindow extends TWidget {
 
     /**
      * Window's parent TApplication.
@@ -187,6 +187,15 @@ public class TWindow extends TWidget implements Comparable<TWindow> {
     private int restoreWindowX;
     private int restoreWindowY;
 
+    /**
+     * Set the maximum width for this window.
+     *
+     * @param maximumWindowWidth new maximum width
+     */
+    public final void setMaximumWindowWidth(final int maximumWindowWidth) {
+        this.maximumWindowWidth = maximumWindowWidth;
+    }
+
     /**
      * Public constructor.  Window will be located at (0, 0).
      *
@@ -305,17 +314,6 @@ public class TWindow extends TWidget implements Comparable<TWindow> {
         return true;
     }
 
-    /**
-     * Comparison operator sorts on z.
-     *
-     * @param that another TWindow instance
-     * @return difference between this.z and that.z
-     */
-    @Override
-    public final int compareTo(final TWindow that) {
-        return (this.z - that.z);
-    }
-
     /**
      * Returns true if the mouse is currently on the close button.
      *
@@ -372,7 +370,7 @@ public class TWindow extends TWidget implements Comparable<TWindow> {
      *
      * @return the background color
      */
-    private CellAttributes getBackground() {
+    public final CellAttributes getBackground() {
         if (!isModal()
             && (inWindowMove || inWindowResize || inKeyboardResize)
         ) {