X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingTerminal.java;h=4cd6d07624010ae8facb31969042f118d59ce44b;hb=9588c7134280341ab6e92e37d1c1d00b3756cee5;hp=43afc1615a848141e1937abacc4884d46386a71e;hpb=63bb94784f03cd743b18ca9a98d460708f69994d;p=fanfix.git diff --git a/src/jexer/backend/SwingTerminal.java b/src/jexer/backend/SwingTerminal.java index 43afc16..4cd6d07 100644 --- a/src/jexer/backend/SwingTerminal.java +++ b/src/jexer/backend/SwingTerminal.java @@ -98,7 +98,7 @@ public class SwingTerminal extends LogicalScreen /** * The terminus font resource filename. */ - private static final String FONTFILE = "terminus-ttf-4.39/TerminusTTF-Bold-4.39.ttf"; + public static final String FONTFILE = "terminus-ttf-4.39/TerminusTTF-Bold-4.39.ttf"; /** * Cursor style to draw. @@ -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 { @@ -715,6 +720,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. * @@ -882,7 +896,7 @@ public class SwingTerminal extends LogicalScreen * @param attr the text attributes * @return the Swing Color */ - private Color attrToForegroundColor(final CellAttributes attr) { + public static Color attrToForegroundColor(final CellAttributes attr) { int rgb = attr.getForeColorRGB(); if (rgb >= 0) { int red = (rgb >> 16) & 0xFF; @@ -939,7 +953,7 @@ public class SwingTerminal extends LogicalScreen * @param attr the text attributes * @return the Swing Color */ - private Color attrToBackgroundColor(final CellAttributes attr) { + public static Color attrToBackgroundColor(final CellAttributes attr) { int rgb = attr.getBackColorRGB(); if (rgb >= 0) { int red = (rgb >> 16) & 0xFF; @@ -1935,6 +1949,12 @@ public class SwingTerminal extends LogicalScreen return; } + if (sessionInfo == null) { + // This is the initial component resize in construction, bail + // out. + return; + } + // Drop a new TResizeEvent into the queue sessionInfo.queryWindowSize(); synchronized (eventQueue) {