X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingTerminal.java;h=58b8f799cf7f1e1153f2ef60f2af486ba96d03da;hb=0c28ec38449a59cf34cf5b3c13ea02add1ee57c5;hp=314e6f5a89e6854dc354e0cd70afac6531cbafc6;hpb=d11152032d9342cc178ba20adab40083a9f37081;p=nikiroo-utils.git diff --git a/src/jexer/backend/SwingTerminal.java b/src/jexer/backend/SwingTerminal.java index 314e6f5..58b8f79 100644 --- a/src/jexer/backend/SwingTerminal.java +++ b/src/jexer/backend/SwingTerminal.java @@ -301,6 +301,13 @@ public class SwingTerminal extends LogicalScreen // Constructors ----------------------------------------------------------- // ------------------------------------------------------------------------ + /** + * Static constructor. + */ + static { + setDOSColors(); + } + /** * Public constructor creates a new JFrame to render to. * @@ -316,7 +323,6 @@ public class SwingTerminal extends LogicalScreen this.fontSize = fontSize; - setDOSColors(); reloadOptions(); try { @@ -438,7 +444,6 @@ public class SwingTerminal extends LogicalScreen this.fontSize = fontSize; - setDOSColors(); reloadOptions(); try { @@ -567,7 +572,6 @@ public class SwingTerminal extends LogicalScreen && (swing.getBufferStrategy() != null) ) { do { - clearPhysical(); do { drawToSwing(); } while (swing.getBufferStrategy().contentsRestored()); @@ -715,6 +719,15 @@ public class SwingTerminal extends LogicalScreen return blinkMillis; } + /** + * Get the current status of the blink flag. + * + * @return true if the cursor and blinking text should be visible + */ + public boolean getCursorBlinkVisible() { + return cursorBlinkVisible; + } + /** * Get the font size in points. * @@ -1187,8 +1200,7 @@ public class SwingTerminal extends LogicalScreen gr2 = (Graphics2D) gr; } - Cell cellColor = new Cell(); - cellColor.setTo(cell); + Cell cellColor = new Cell(cell); // Check for reverse if (cell.isReverse()) { @@ -1220,8 +1232,7 @@ public class SwingTerminal extends LogicalScreen // We need a new key that will not be mutated by // invertCell(). - Cell key = new Cell(); - key.setTo(cell); + Cell key = new Cell(cell); if (cell.isBlink() && !cursorBlinkVisible) { glyphCacheBlink.put(key, image); } else {