X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FMultiScreen.java;h=0c3a2894bbe29c9bc0af7067cd9b79f8d9b060bc;hb=03ae544a1639c127ebec9a46635f2ad465713908;hp=b77872bba5f6eb617c70dace855efe9c9501bb2c;hpb=a52cb9df56f75f02b4509000ac63952a48c30f0b;p=fanfix.git diff --git a/src/jexer/backend/MultiScreen.java b/src/jexer/backend/MultiScreen.java index b77872b..0c3a289 100644 --- a/src/jexer/backend/MultiScreen.java +++ b/src/jexer/backend/MultiScreen.java @@ -646,14 +646,7 @@ public class MultiScreen implements Screen { public int getTextWidth() { int textWidth = 16; for (Screen screen: screens) { - int newTextWidth = textWidth; - if (screen instanceof MultiScreen) { - newTextWidth = ((MultiScreen) screen).getTextWidth(); - } else if (screen instanceof ECMA48Terminal) { - newTextWidth = ((ECMA48Terminal) screen).getTextWidth(); - } else if (screen instanceof SwingTerminal) { - newTextWidth = ((SwingTerminal) screen).getTextWidth(); - } + int newTextWidth = screen.getTextWidth(); if (newTextWidth < textWidth) { textWidth = newTextWidth; } @@ -669,14 +662,7 @@ public class MultiScreen implements Screen { public int getTextHeight() { int textHeight = 20; for (Screen screen: screens) { - int newTextHeight = textHeight; - if (screen instanceof MultiScreen) { - newTextHeight = ((MultiScreen) screen).getTextHeight(); - } else if (screen instanceof ECMA48Terminal) { - newTextHeight = ((ECMA48Terminal) screen).getTextHeight(); - } else if (screen instanceof SwingTerminal) { - newTextHeight = ((SwingTerminal) screen).getTextHeight(); - } + int newTextHeight = screen.getTextHeight(); if (newTextHeight < textHeight) { textHeight = newTextHeight; }