1. Steve Losh
  2. lanterna

Commits

mabe02  committed df6e6d8

1.4.2 compatibility

  • Participants
  • Parent commits 7755655
  • Branches jre142-branch

Comments (0)

Files changed (4)

File src/org/lantern/BuildInformation.java

View file
 public class BuildInformation
 {
     public static final String VERSION = "jre142-4";
-    public static final int BUILD = 46;
+    public static final int BUILD = 13;
 }
 
         

File src/org/lantern/input/InputDecoder.java

View file
     public Key getNextCharacter() throws LanternException
     {
         if(leftOverQueue.size() > 0) {
-            Character first = (Character)leftOverQueue.poll();
+            Character first = (Character)leftOverQueue.removeFirst();
             //HACK!!!
             if(first.charValue() == 0x1b)
                 return new Key(Key.Kind.Escape);
 
         while(true) {
             //Check all patterns
-            Character nextChar = (Character)inputBuffer.poll();
+            Character nextChar = null;
+            if(!inputBuffer.isEmpty())
+                nextChar = (Character)inputBuffer.removeFirst();
             boolean canMatchWithOneMoreChar = false;
 
             if(nextChar != null) {
                 for(int i = 0; i < currentMatching.size(); i++)
                     leftOverQueue.add(currentMatching.get(i));
                 currentMatching.clear();
-                Character first = (Character)leftOverQueue.poll();
+                Character first = (Character)leftOverQueue.removeFirst();
                 
                 //HACK!!!
                 if(first.charValue() == 0x1b)

File src/org/lantern/terminal/SwingTerminal.java

View file
     {
         this.resizeListeners = new ArrayList();
         this.terminalSize = terminalSize;
-        this.terminalFont = new Font("Courier New", Font.PLAIN, 14);
+        this.terminalFont = new Font("Monospaced", Font.PLAIN, 14);
         this.terminalRenderer = new TerminalRenderer();
         this.textPosition = new TerminalPosition(0, 0);
         this.characterMap = new TerminalCharacter[terminalSize.getRows()][terminalSize.getColumns()];
         terminalFrame.addKeyListener(new KeyCapturer());
         terminalFrame.pack();
         terminalFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
-        terminalFrame.setLocationByPlatform(true);
         terminalFrame.setVisible(true);
         terminalFrame.setFocusTraversalKeysEnabled(false);
         //terminalEmulator.setSize(terminalEmulator.getPreferredSize());
     public Key readInput() throws LanternException
     {
         synchronized(keyQueue) {
-            return (Key)keyQueue.poll();
+            if(keyQueue.isEmpty())
+                return null;
+            return (Key)keyQueue.removeFirst();
         }
     }
 

File src/org/lantern/test/TerminalInputTest.java

View file
             }
         }
 
-        final Terminal rawTerminal = new TerminalFactory.Common().createTerminal(System.in, System.out, Charset.defaultCharset());
+        final Terminal rawTerminal = new TerminalFactory.Common().createTerminal(System.in, System.out, Charset.forName("UTF-8"));
         if(rawTerminal == null) {
             System.err.println("Couldn't allocate a terminal!");
             return;