Commits

mabe02 committed 71e0d50

Creating jre142-branch for Java 1.4.2 support

  • Participants
  • Parent commits 309ca83
  • Branches jre142-branch

Comments (0)

Files changed (68)

src/org/lantern/LanternException.java

         this.cause = cause;
     }
 
-    @Override
     public Throwable getCause()
     {
         return cause;
     }
 
-    @Override
     public String getLocalizedMessage()
     {
         return cause.getLocalizedMessage();
     }
 
-    @Override
     public String getMessage()
     {
         return cause.getMessage();
     }
 
-    @Override
     public StackTraceElement[] getStackTrace()
     {
         return cause.getStackTrace();
     }
 
-    @Override
     public void printStackTrace()
     {
         cause.printStackTrace();
     }
 
-    @Override
     public void printStackTrace(PrintStream s)
     {
         cause.printStackTrace(s);
     }
 
-    @Override
     public void printStackTrace(PrintWriter s)
     {
         cause.printStackTrace(s);
     }
 
-    @Override
     public String toString()
     {
         return cause.toString();

src/org/lantern/TerminalFactory.java

      */
     public static class Default extends TerminalFactory
     {
-        @Override
         public Terminal createTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset)
         {
             if(GraphicsEnvironment.isHeadless())
      */
     public static class Common extends TerminalFactory
     {
-        @Override
         public Terminal createTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset)
         {
             return new CommonUnixTerminal(terminalInput, terminalOutput, terminalCharset);
      */
     public static class Swing extends TerminalFactory
     {
-        @Override
         public Terminal createTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset)
         {
             return new SwingTerminal();

src/org/lantern/gui/AbstractComponent.java

 
 package org.lantern.gui;
 
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import org.lantern.gui.listener.ComponentListener;
  */
 public abstract class AbstractComponent implements Component
 {
-    private final List<ComponentListener> componentListeners;
+    private final List componentListeners;
     private Container parent;
     private boolean visible;
 
     public AbstractComponent()
     {
-        componentListeners = new LinkedList<ComponentListener>();
+        componentListeners = new LinkedList();
         parent = null;
         visible = true;
     }
 
     protected void invalidate()
     {
-        for(ComponentListener cl: componentListeners)
-            cl.onComponentInvalidated(this);
+        Iterator iter = componentListeners.iterator();
+        while(iter.hasNext())
+            ((ComponentListener)iter.next()).onComponentInvalidated(this);
         
         if(parent != null && parent instanceof AbstractContainer) {
             ((AbstractContainer)parent).invalidate();

src/org/lantern/gui/AbstractContainer.java

 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import org.lantern.gui.listener.ContainerListener;
  */
 public abstract class AbstractContainer extends AbstractComponent implements InteractableContainer, Container
 {
-    private final List<ContainerListener> containerListeners;
-    private final List<Component> components;
+    private final List containerListeners;
+    private final List components;
 
     protected AbstractContainer()
     {
-        components = new ArrayList<Component>();
-        containerListeners = new LinkedList<ContainerListener>();
+        components = new ArrayList();
+        containerListeners = new LinkedList();
     }
 
     public void addComponent(Component component)
     public Component getComponentAt(int index)
     {
         synchronized(components) {
-            return components.get(index);
+            return (Component)components.get(index);
         }
     }
 
         }
     }
 
-    protected Iterable<Component> components()
+    protected Iterator components()
     {
-        return components;
+        return components.iterator();
     }
 
     public void addContainerListener(ContainerListener cl)
 
     public boolean hasInteractable(Interactable interactable)
     {
-        for(Component component: components())
+        Iterator iter = components();
+        while(iter.hasNext())
         {
+            Component component = (Component)iter.next();
             if(component instanceof InteractableContainer)
                 if(((InteractableContainer)(component)).hasInteractable(interactable))
                     return true;
     {
         boolean chooseNext = (previous == null);
 
-        for(Component component: components())
+        Iterator iter = components();
+        while(iter.hasNext())
         {
+            Component component = (Component)iter.next();
             if(chooseNext) {
                 if(component instanceof Interactable)
                     return (Interactable)component;
     {
         boolean chooseNext = (fromThis == null);
 
-        List<Component> revComponents = new ArrayList<Component>(components);
+        List revComponents = new ArrayList(components);
         Collections.reverse(revComponents);
 
-        for(Component component: revComponents)
+        Iterator iter = revComponents.iterator();
+        while(iter.hasNext())
         {
+            Component component = (Component)iter.next();
             if(chooseNext) {
                 if(component instanceof Interactable)
                     return (Interactable)component;

src/org/lantern/gui/ActionListBox.java

 import org.lantern.LanternException;
 import org.lantern.gui.theme.Theme.Category;
 import org.lantern.input.Key;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
  */
 public class ActionListBox extends AbstractInteractableComponent
 {
-    private final List<Item> itemList;
+    private final List itemList;
     private final int forceWidth;
     private int selectedIndex;
 
 
     public ActionListBox(int forceWidth)
     {
-        this.itemList = new ArrayList<Item>();
+        this.itemList = new ArrayList();
         this.forceWidth = forceWidth;
         this.selectedIndex = -1;
     }
 
     public Item getItem(int index)
     {
-        return itemList.get(index);
+        return (Item)itemList.get(index);
     }
 
     public int getNrOfItems()
             else
                 graphics.applyThemeItem(Category.Item);
 
-            String title = itemList.get(i).getTitle();
+            String title = ((Item)itemList.get(i)).getTitle();
             if(title.length() > graphics.getWidth() && graphics.getWidth() > 3)
                 title = title.substring(0, graphics.getWidth() - 3) + "...";
 
-            graphics.drawString(0, i, title);
+            graphics.drawString(0, i, title, new Terminal.Style[]{});
         }
         if(selectedIndex == -1)
             setHotspot(new TerminalPosition(0, 0));
             return new TerminalSize(forceWidth, itemList.size());
 
         int maxLength = 0;
-        for(Item item: itemList) {
+        for(int i = 0; i < itemList.size(); i++) {
+            Item item = (Item)itemList.get(i);
             if(item.getTitle().length() > maxLength)
                 maxLength = item.getTitle().length();
         }
         return new TerminalSize(maxLength, itemList.size());
     }
     
-    @Override
     protected void afterEnteredFocus(FocusChangeDirection direction)
     {
         if(direction == FocusChangeDirection.DOWN_OR_RIGHT)
 
     public void keyboardInteraction(Key key, InteractableResult result) throws LanternException
     {
-        switch(key.getKind()) {
-            case Tab:
-            case ArrowRight:
+        switch(key.getKind().getIndex()) {
+            case Key.Kind.Tab_ID:
+            case Key.Kind.ArrowRight_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ReverseTab:
-            case ArrowLeft:
+            case Key.Kind.ReverseTab_ID:
+            case Key.Kind.ArrowLeft_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
 
-            case ArrowDown:
+            case Key.Kind.ArrowDown_ID:
                 if(selectedIndex == itemList.size() - 1)
                     result.type = Result.NEXT_INTERACTABLE;
                 else
                     selectedIndex++;
                 break;
 
-            case ArrowUp:
+            case Key.Kind.ArrowUp_ID:
                 if(selectedIndex == 0)
                     result.type = Result.PREVIOUS_INTERACTABLE;
                 else
                     selectedIndex--;
                 break;
 
-            case Enter:
+            case Key.Kind.Enter_ID:
                 if(selectedIndex != -1)
-                    itemList.get(selectedIndex).doAction();
+                    ((Item)itemList.get(selectedIndex)).doAction();
                 break;
 
-            case PageDown:
+            case Key.Kind.PageDown_ID:
                 selectedIndex = itemList.size() - 1;
                 break;
 
-            case PageUp:
+            case Key.Kind.PageUp_ID:
                 selectedIndex = 0;
                 break;
         }

src/org/lantern/gui/Border.java

 
 import org.lantern.gui.theme.Theme;
 import org.lantern.terminal.ACS;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.Terminal.Color;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
             this.bold = bold;
         }
 
-        @Override
         public void drawBorder(TextGraphics graphics, TerminalSize actualSize)
         {
             graphics.setForegroundColor(foreground);
             final int height = actualSize.getRows();
 
             //Top
-            graphics.drawString(0, 0, ACS.ULCORNER + "");            
+            graphics.drawString(0, 0, ACS.ULCORNER + "", new Terminal.Style[]{});            
             for(int x = 0; x < width - 2; x++)
-                graphics.drawString(x, 0, ACS.HLINE + "");
-            graphics.drawString(width - 1, 0, ACS.URCORNER + "");
+                graphics.drawString(x, 0, ACS.HLINE + "", new Terminal.Style[]{});
+            graphics.drawString(width - 1, 0, ACS.URCORNER + "", new Terminal.Style[]{});
 
             //Each row
             for(int i = 0; i < height - 2; i++) {
-                graphics.drawString(0, i + 1, ACS.VLINE + "");
-                graphics.drawString(0 + width - 1, i + 1, ACS.VLINE + "");
+                graphics.drawString(0, i + 1, ACS.VLINE + "", new Terminal.Style[]{});
+                graphics.drawString(0 + width - 1, i + 1, ACS.VLINE + "", new Terminal.Style[]{});
             }
 
             //Bottom
-            graphics.drawString(0, height - 1, ACS.LLCORNER + "");
+            graphics.drawString(0, height - 1, ACS.LLCORNER + "", new Terminal.Style[]{});
             for(int x = 0; x < width - 2; x++)
-                graphics.drawString(x + 1, height - 1, ACS.HLINE + "");
-            graphics.drawString(width - 1, height - 1, ACS.LRCORNER + "");
+                graphics.drawString(x + 1, height - 1, ACS.HLINE + "", new Terminal.Style[]{});
+            graphics.drawString(width - 1, height - 1, ACS.LRCORNER + "", new Terminal.Style[]{});
         }
 
-        @Override
         public TerminalPosition getInnerAreaLocation(int width, int height)
         {
             if(width > 2 && height > 2)
                 return new TerminalPosition(0,0);
         }
 
-        @Override
         public TerminalSize getInnerAreaSize(int width, int height)
         {
             if(width > 2 && height > 2)
                 return new TerminalSize(width, height);
         }
 
-        @Override
         public TerminalSize surroundAreaSize(TerminalSize TerminalSize)
         {
             return new TerminalSize(TerminalSize.getColumns() == Integer.MAX_VALUE ? Integer.MAX_VALUE : TerminalSize.getColumns() + 4,
             this.raised = raised;
         }
 
-        @Override
         public void drawBorder(TextGraphics graphics, TerminalSize actualSize)
         {
             final int width = actualSize.getColumns();
 
             //Top
             graphics.applyThemeItem(upperLeft);
-            graphics.drawString(0, 0, ACS.ULCORNER + "");
+            graphics.drawString(0, 0, ACS.ULCORNER + "", new Terminal.Style[]{});
             for(int i = 0; i < width - 2; i++)
-                graphics.drawString(1 + i, 0, ACS.HLINE + "");
+                graphics.drawString(1 + i, 0, ACS.HLINE + "", new Terminal.Style[]{});
             graphics.applyThemeItem(lowerRight);
-            graphics.drawString(width - 1, 0, ACS.URCORNER + "");
+            graphics.drawString(width - 1, 0, ACS.URCORNER + "", new Terminal.Style[]{});
 
             //Each row
             for(int i = 0; i < height - 2; i++) {
                 graphics.applyThemeItem(upperLeft);
-                graphics.drawString(0, i + 1, ACS.VLINE + "");
+                graphics.drawString(0, i + 1, ACS.VLINE + "", new Terminal.Style[]{});
                 graphics.applyThemeItem(lowerRight);
-                graphics.drawString(width - 1, i + 1, ACS.VLINE + "");
+                graphics.drawString(width - 1, i + 1, ACS.VLINE + "", new Terminal.Style[]{});
             }
 
             //Bottom
             graphics.applyThemeItem(upperLeft);
-            graphics.drawString(0, height - 1, ACS.LLCORNER + "");
+            graphics.drawString(0, height - 1, ACS.LLCORNER + "", new Terminal.Style[]{});
             graphics.applyThemeItem(lowerRight);
             for(int i = 0; i < width - 2; i++)
-                graphics.drawString(1 + i, height - 1, ACS.HLINE + "");
-            graphics.drawString(width - 1, height - 1, ACS.LRCORNER + "");
+                graphics.drawString(1 + i, height - 1, ACS.HLINE + "", new Terminal.Style[]{});
+            graphics.drawString(width - 1, height - 1, ACS.LRCORNER + "", new Terminal.Style[]{});
         }
 
-        @Override
         public TerminalPosition getInnerAreaLocation(int width, int height)
         {
             if(width > 2 && height > 2)
                 return new TerminalPosition(0,0);
         }
 
-        @Override
         public TerminalSize getInnerAreaSize(int width, int height)
         {
             if(width > 2 && height > 2)
                 return new TerminalSize(width, height);
         }
 
-        @Override
         public TerminalSize surroundAreaSize(TerminalSize TerminalSize)
         {
             return new TerminalSize(TerminalSize.getColumns() == Integer.MAX_VALUE ? Integer.MAX_VALUE : TerminalSize.getColumns() + 4,
 
     public static class Invisible extends Border
     {
-        @Override
         public void drawBorder(TextGraphics graphics, TerminalSize actualSize)
         {
         }
 
-        @Override
         public TerminalPosition getInnerAreaLocation(int width, int height)
         {
             return new TerminalPosition(0,0);
         }
 
-        @Override
         public TerminalSize getInnerAreaSize(int width, int height)
         {
             return new TerminalSize(width, height);
         }
 
-        @Override
         public TerminalSize surroundAreaSize(TerminalSize TerminalSize)
         {
             return TerminalSize;

src/org/lantern/gui/Button.java

 import org.lantern.LanternException;
 import org.lantern.gui.theme.Theme;
 import org.lantern.input.Key;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
 
         if(graphics.getWidth() < preferredSize.getColumns()) {
             int allowedSize = graphics.getWidth() - 4;
-            graphics.drawString(0, 0, "< ");
-            graphics.drawString(graphics.getWidth() - 2, 0, " >");
+            graphics.drawString(0, 0, "< ", new Terminal.Style[]{});
+            graphics.drawString(graphics.getWidth() - 2, 0, " >", new Terminal.Style[]{});
             TextGraphics subGraphics = graphics.subAreaGraphics(new TerminalPosition(2, 0),
                     new TerminalSize(allowedSize, buttonLabel.getPreferredSize().getRows()));
             buttonLabel.repaint(subGraphics);
         }
         else {
             int leftPosition = (graphics.getWidth() - preferredSize.getColumns()) / 2;
-            graphics.drawString(leftPosition, 0, "< ");
+            graphics.drawString(leftPosition, 0, "< ", new Terminal.Style[]{});
             final TerminalSize labelPrefSize = buttonLabel.getPreferredSize();
             TextGraphics subGraphics = graphics.subAreaGraphics(
                     new TerminalPosition(leftPosition + 2, 0),
                     new TerminalSize(labelPrefSize.getColumns(), labelPrefSize.getRows()));
             buttonLabel.repaint(subGraphics);
-            graphics.drawString(leftPosition + 2 + labelPrefSize.getColumns(), 0, " >");
+            graphics.drawString(leftPosition + 2 + labelPrefSize.getColumns(), 0, " >", new Terminal.Style[]{});
 
             setHotspot(graphics.translateToGlobalCoordinates(new TerminalPosition(leftPosition + 2, 0)));
         }
         return new TerminalSize(labelSize.getColumns() + 2 + 2, labelSize.getRows());
     }
 
-    @Override
     public void afterEnteredFocus(FocusChangeDirection direction) {
         buttonLabel.setStyle(Theme.Category.ButtonLabelActive);
     }
 
-    @Override
     public void afterLeftFocus(FocusChangeDirection direction) {
         buttonLabel.setStyle(Theme.Category.ButtonLabelInactive);
     }
 
     public void keyboardInteraction(Key key, InteractableResult result) throws LanternException
     {
-        switch(key.getKind()) {
-            case Enter:
+        switch(key.getKind().getIndex()) {
+            case Key.Kind.Enter_ID:
                 onPressEvent.doAction();
                 break;
 
-            case ArrowRight:
-            case ArrowDown:
-            case Tab:
+            case Key.Kind.ArrowRight_ID:
+            case Key.Kind.ArrowDown_ID:
+            case Key.Kind.Tab_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ArrowLeft:
-            case ArrowUp:
-            case ReverseTab:
+            case Key.Kind.ArrowLeft_ID:
+            case Key.Kind.ArrowUp_ID:
+            case Key.Kind.ReverseTab_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
         }

src/org/lantern/gui/CheckBox.java

         this.selected = initiallyChecked;
     }
 
-    @Override
     protected char getSelectionCharacter()
     {
         return 'x';
     }
 
-    @Override
     public boolean isSelected()
     {
         return selected;
     }
 
-    @Override
     protected void onActivated()
     {
         selected = !selected;
     }
 
-    @Override
     protected String surroundCharacter(char character)
     {
         return "[" + character + "]";

src/org/lantern/gui/CheckBoxList.java

 import java.util.List;
 import org.lantern.gui.theme.Theme.Category;
 import org.lantern.input.Key;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
  */
 public class CheckBoxList extends AbstractInteractableComponent
 {
-    private final List<Object> items;
-    private final List<Boolean> itemStatus;
+    private final List items;
+    private final List itemStatus;
     private final int forceWidth;
     private int selectedIndex;
 
     public CheckBoxList(int forceWidth)
     {
         this.forceWidth = forceWidth;
-        this.items = new ArrayList<Object>();
-        this.itemStatus = new ArrayList<Boolean>();
+        this.items = new ArrayList();
+        this.itemStatus = new ArrayList();
         this.selectedIndex = -1;
     }
 
     {
         if(items.indexOf(object) == -1)
             return null;
-        return itemStatus.get(items.indexOf(object));
+        return (Boolean)itemStatus.get(items.indexOf(object));
     }
     
     public Boolean isChecked(int index)
     {
         if(index < 0 || index >= itemStatus.size())
             return null;
-        return itemStatus.get(index);
+        return (Boolean)itemStatus.get(index);
     }
 
     public void setChecked(Object object, boolean checked)
         if(items.indexOf(object) == -1)
             return;
         
-        itemStatus.set(items.indexOf(object), checked);
+        itemStatus.set(items.indexOf(object), new Boolean(checked));
     }
     
     public int getItemCount()
 
     public void keyboardInteraction(Key key, InteractableResult result)
     {
-        switch(key.getKind())
+        switch(key.getKind().getIndex())
         {
-            case Enter:
-            case Tab:
-            case ArrowRight:
+            case Key.Kind.Enter_ID:
+            case Key.Kind.Tab_ID:
+            case Key.Kind.ArrowRight_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ReverseTab:
-            case ArrowLeft:
+            case Key.Kind.ReverseTab_ID:
+            case Key.Kind.ArrowLeft_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
 
-            case ArrowDown:
+            case Key.Kind.ArrowDown_ID:
                 if(selectedIndex == items.size() - 1)
                     result.type = Result.NEXT_INTERACTABLE;
                 else
                     selectedIndex++;
                 break;
 
-            case ArrowUp:
+            case Key.Kind.ArrowUp_ID:
                 if(selectedIndex == 0)
                     result.type = Result.PREVIOUS_INTERACTABLE;
                 else
 
             default:
                 if(key.getCharacter() == ' ') {
-                    if(itemStatus.get(selectedIndex) == true)
+                    if(((Boolean)itemStatus.get(selectedIndex)).booleanValue() == true)
                         itemStatus.set(selectedIndex, Boolean.FALSE);
                     else
                         itemStatus.set(selectedIndex, Boolean.TRUE);
 
             
             String check = " ";
-            if(itemStatus.get(i))
+            if(((Boolean)itemStatus.get(i)).booleanValue())
                 check = "x";
             String text = items.get(i).toString();
             if(text.length() + 4 > graphics.getWidth())
                 text = text.substring(0, graphics.getWidth() - 4);
 
-            graphics.drawString(0, i, "[" + check + "] " + text);
+            graphics.drawString(0, i, "[" + check + "] " + text, new Terminal.Style[]{});
         }
         if(selectedIndex == -1)
             setHotspot(new TerminalPosition(0, 0));
                 return new TerminalSize(1, 1);
             else {
                 int maxWidth = 1;
-                for(Object object: items) {
+                for(int i = 0; i < items.size(); i++) {
+                    Object object = items.get(i);
                     if(maxWidth < object.toString().length() + 4)
                         maxWidth = object.toString().length() + 4;
                 }

src/org/lantern/gui/CommonCheckBox.java

 import org.lantern.LanternException;
 import org.lantern.gui.theme.Theme.Category;
 import org.lantern.input.Key;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
         if(isSelected())
             check = getSelectionCharacter();
 
-        graphics.drawString(0, 0, surroundCharacter(check));
+        graphics.drawString(0, 0, surroundCharacter(check), new Terminal.Style[]{});
         graphics.applyThemeItem(Category.CheckBox);
-        graphics.drawString(3, 0, " ");
+        graphics.drawString(3, 0, " ", new Terminal.Style[]{});
         TextGraphics subArea = graphics.subAreaGraphics(new TerminalPosition(4, 0));
         label.repaint(subArea);
 
 
     public void keyboardInteraction(Key key, InteractableResult result) throws LanternException
     {
-        switch(key.getKind())
+        switch(key.getKind().getIndex())
         {
-            case Tab:
-            case ArrowDown:
-            case ArrowRight:
+            case Key.Kind.Tab_ID:
+            case Key.Kind.ArrowDown_ID:
+            case Key.Kind.ArrowRight_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ArrowUp:
-            case ReverseTab:
-            case ArrowLeft:
+            case Key.Kind.ArrowUp_ID:
+            case Key.Kind.ReverseTab_ID:
+            case Key.Kind.ArrowLeft_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
 
-            case Enter:
+            case Key.Kind.Enter_ID:
                 onActivated();
                 break;
                 

src/org/lantern/gui/GUIScreen.java

 package org.lantern.gui;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import org.lantern.gui.theme.Theme;
 import java.util.LinkedList;
 import java.util.List;
 import org.lantern.gui.listener.WindowAdapter;
 import org.lantern.input.Key;
 import org.lantern.screen.Screen;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
 public class GUIScreen
 {
     private final Screen screen;
-    private final LinkedList<WindowPlacement> windowStack;
-    private final Queue<Action> actionToRunInEventThread;
+    private final LinkedList windowStack;
+    private final Queue actionToRunInEventThread;
     private String title;
     private boolean showMemoryUsage;
     private Theme guiTheme;
         this.showMemoryUsage = false;
         this.screen = screen;
         this.guiTheme = Theme.getDefaultTheme();
-        this.windowStack = new LinkedList<WindowPlacement>();
-        this.actionToRunInEventThread = new LinkedList<Action>();
+        this.windowStack = new LinkedList();
+        this.actionToRunInEventThread = new LinkedList();
         this.needsRefresh = false;
         this.eventThread = Thread.currentThread();  //We'll be expecting the thread who created us is the same as will be the event thread later
     }
         textGraphics.fillRectangle(' ', new TerminalPosition(0, 0), new TerminalSize(screen.getTerminalSize()));
 
         //Write the title
-        textGraphics.drawString(3, 0, title);
+        textGraphics.drawString(3, 0, title, new Terminal.Style[0]);
 
         //Write memory usage
         if(showMemoryUsage)
             drawMemoryUsage(textGraphics);
 
         //Go through the windows
-        for(WindowPlacement windowPlacement: windowStack) {
+        Iterator iter = windowStack.iterator();
+        while(iter.hasNext()) {
+            WindowPlacement windowPlacement = (WindowPlacement)iter.next();
             if(hasSoloWindowAbove(windowPlacement))
                 continue;
             
             windowPlacement.getWindow().repaint(subGraphics);
         }
 
-        if(windowStack.size() > 0 && windowStack.getLast().getWindow().getWindowHotspotPosition() != null)
-            screen.setCursorPosition(windowStack.getLast().getWindow().getWindowHotspotPosition());
+        if(windowStack.size() > 0 && ((WindowPlacement)windowStack.getLast()).getWindow().getWindowHotspotPosition() != null)
+            screen.setCursorPosition(((WindowPlacement)windowStack.getLast()).getWindow().getWindowHotspotPosition());
         else
             screen.setCursorPosition(new TerminalPosition(screen.getWidth() - 1, screen.getHeight() - 1));
         screen.refresh();
 
     boolean isWindowTopLevel(Window window)
     {
-        if(windowStack.size() > 0 && windowStack.getLast().getWindow() == window)
+        if(windowStack.size() > 0 && ((WindowPlacement)windowStack.getLast()).getWindow() == window)
             return true;
         else
             return false;
             }
 
             synchronized(actionToRunInEventThread) {
-                List<Action> actions = new ArrayList<Action>(actionToRunInEventThread);
+                List actions = new ArrayList(actionToRunInEventThread);
                 actionToRunInEventThread.clear();
-                for(Action nextAction: actions)
-                    nextAction.doAction();
+                for(int i = 0; i < actions.size(); i++)
+                    ((Action)actions.get(i)).doAction();
             }
 
             update();
 
             Key nextKey = screen.readInput();
             if(nextKey != null) {
-                windowStack.getLast().window.onKeyPressed(nextKey);
+                ((WindowPlacement)windowStack.getLast()).window.onKeyPressed(nextKey);
                 invalidate();
             }
             else {
 
         if(position == Position.OVERLAPPING &&
                 windowStack.size() > 0) {
-            WindowPlacement lastWindow = windowStack.getLast();
+            WindowPlacement lastWindow = ((WindowPlacement)windowStack.getLast());
             if(lastWindow.getPositionPolicy() != Position.CENTER) {
                 newWindowX = lastWindow.getTopLeft().getColumn() + 2;
                 newWindowY = lastWindow.getTopLeft().getRow() + 1;
         }
 
         window.addWindowListener(new WindowAdapter() {
-            @Override
             public void onWindowInvalidated(Window window)
             {
                 needsRefresh = true;
     {
         if(windowStack.size() == 0)
             return;
-        if(windowStack.getLast().window != window)
+        if(((WindowPlacement)windowStack.getLast()).window != window)
             return;
 
-        WindowPlacement windowPlacement = windowStack.removeLast();
+        WindowPlacement windowPlacement = (WindowPlacement)windowStack.removeLast();
         windowPlacement.getWindow().onClosed();
     }
 
         return showMemoryUsage;
     }
 
-    public enum Position
+    public static class Position
     {
-        OVERLAPPING,
-        NEW_CORNER_WINDOW,
-        CENTER
+        public static final int OVERLAPPING_ID = 1;
+        public static final int NEW_CORNER_WINDOW_ID = 2;
+        public static final int CENTER_ID = 3;
+        
+        public static final Position OVERLAPPING = new Position(OVERLAPPING_ID);
+        public static final Position NEW_CORNER_WINDOW = new Position(NEW_CORNER_WINDOW_ID);
+        public static final Position CENTER = new Position(CENTER_ID);
+        
+        private final int index;
+
+        public Position(int index) {
+            this.index = index;
+        }
+
+        public int getIndex() {
+            return index;
+        }
     }
 
     private boolean hasSoloWindowAbove(WindowPlacement windowPlacement)
     {
         int index = windowStack.indexOf(windowPlacement);
         for(int i = index + 1; i < windowStack.size(); i++) {
-            if(windowStack.get(i).window.isSoloWindow())
+            if(((WindowPlacement)windowStack.get(i)).window.isSoloWindow())
                 return true;
         }
         return false;
 
         String memUsageString = "Memory usage: " + usedMemory + " MB of " + totalMemory + " MB";
         textGraphics.drawString(screen.getTerminalSize().getColumns() - memUsageString.length() - 1,
-                screen.getTerminalSize().getRows() - 1, memUsageString);
+                screen.getTerminalSize().getRows() - 1, memUsageString, new Terminal.Style[0]);
     }
 
     private class WindowPlacement

src/org/lantern/gui/Interactable.java

     public void onLeaveFocus(FocusChangeDirection direction);
     public TerminalPosition getHotspot();
 
-    public enum Result
+    public static class Result
     {
-        DO_NOTHING,
-        NEXT_INTERACTABLE,
-        PREVIOUS_INTERACTABLE
+        public static final int DO_NOTHING_ID = 1;
+        public static final int NEXT_INTERACTABLE_ID = 2;
+        public static final int PREVIOUS_INTERACTABLE_ID = 3;
+        
+        public static final Result DO_NOTHING = new Result(DO_NOTHING_ID);
+        public static final Result NEXT_INTERACTABLE = new Result(NEXT_INTERACTABLE_ID);
+        public static final Result PREVIOUS_INTERACTABLE = new Result(PREVIOUS_INTERACTABLE_ID);
+        
+        private final int index;
+
+        private Result(int index) {
+            this.index = index;
+        }
+
+        public int getIndex() {
+            return index;
+        }
     }
 
-    public enum FocusChangeDirection
+    public static class FocusChangeDirection
     {
-        DOWN_OR_RIGHT,
-        UP_OR_LEFT
+        public static final int DOWN_OR_RIGHT_ID = 1;
+        public static final int UP_OR_LEFT_ID = 2;
+        
+        public static final FocusChangeDirection DOWN_OR_RIGHT = new FocusChangeDirection(DOWN_OR_RIGHT_ID);
+        public static final FocusChangeDirection UP_OR_LEFT = new FocusChangeDirection(UP_OR_LEFT_ID);
+        
+        private final int index;
+
+        private FocusChangeDirection(int index) {
+            this.index = index;
+        }
+
+        public int getIndex() {
+            return index;
+        }
     }
 }

src/org/lantern/gui/Label.java

         if(textColor != null)
             graphics.setForegroundColor(textColor);
         if(textBold != null) {
-            if(textBold)
+            if(textBold.booleanValue())
                 graphics.setBoldMask(true);
             else
                 graphics.setBoldMask(false);
         int leftPosition = 0;
         if(textAlignment == Alignment.MIDDLE || textAlignment == Alignment.END) {
             int longestLine = 0;
-            for(String line: text)
+            for(int i = 0; i < text.length; i++) {
+                String line = text[i];
                 longestLine = Math.max(longestLine, line.length());
+            }
             if(longestLine < graphics.getWidth()) {
                 if(textAlignment == Alignment.MIDDLE)
                     leftPosition = (graphics.getWidth() - longestLine) / 2;
         for(int i = 0; i < text.length; i++) {
             if(forceWidth > -1) {
                 if(text[i].length() > forceWidth)
-                    graphics.drawString(leftPosition, i, text[i].substring(0, forceWidth - 3) + "...");
+                    graphics.drawString(leftPosition, i, text[i].substring(0, forceWidth - 3) + "...", new Terminal.Style[0]);
                 else
-                    graphics.drawString(leftPosition, i, text[i]);
+                    graphics.drawString(leftPosition, i, text[i], new Terminal.Style[0]);
             }
             else
-                graphics.drawString(leftPosition, i, text[i]);
+                graphics.drawString(leftPosition, i, text[i], new Terminal.Style[0]);
         }
     }
 
 
     public String getText() {
         StringBuilder sb = new StringBuilder();
-        for(String line: text)
+        for(int i = 0; i < text.length; i++) {    
+            String line = text[i];
             sb.append(line).append("\n");
+        }
         sb.delete(sb.length() - 1, sb.length());
         return sb.toString();
     }
 
     public String[] getLines()
     {
-        return Arrays.copyOf(text, text.length);
+        return (String[])Arrays.copyOf(text, text.length);
     }
 
     public void setStyle(Category style)
             height = 1;
 
         width = 0;
-        for(String line: text) {
+        for(int i = 0; i < text.length; i++) {
+            String line = text[i];
             if(line.length() > width)
                 width = line.length();
         }
     }
 
-    public static enum Alignment
+    public static class Alignment
     {
-        START,
-        MIDDLE,
-        END;
+        public static final int START_ID = 1;
+        public static final int MIDDLE_ID = 2;
+        public static final int END_ID = 3;
+        
+        public static final Alignment START = new Alignment(START_ID);
+        public static final Alignment MIDDLE = new Alignment(MIDDLE_ID);
+        public static final Alignment END = new Alignment(END_ID);
+        
+        private final int index;
+
+        private Alignment(int index) {
+            this.index = index;
+        }
+
+        public int getIndex() {
+            return index;
+        }
     }
 }

src/org/lantern/gui/ListBox.java

 import org.lantern.gui.theme.Theme.Category;
 import org.lantern.input.Key;
 import org.lantern.terminal.ACS;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
  */
 public class ListBox extends AbstractInteractableComponent
 {
-    private final List<Object> items;
+    private final List items;
     private final TerminalSize preferredSize;
     private int selectedIndex;
     private int scrollTopIndex;
 
     public ListBox(final TerminalSize preferredSize)
     {
-        this.items = new ArrayList<Object>();
+        this.items = new ArrayList();
         this.preferredSize = new TerminalSize(preferredSize);
         this.selectedIndex = -1;
         this.scrollTopIndex = 0;
 
         if(items.size() > graphics.getHeight()) {
             graphics.applyThemeItem(Category.DefaultDialog);
-            graphics.drawString(graphics.getWidth() - 1, 0, ACS.ARROW_UP + "");
+            graphics.drawString(graphics.getWidth() - 1, 0, ACS.ARROW_UP + "", new Terminal.Style[0]);
 
             graphics.applyThemeItem(Category.DefaultDialog);
             for(int i = 1; i < graphics.getHeight() - 1; i++)
-                graphics.drawString(graphics.getWidth() - 1, i, ACS.BLOCK_MIDDLE + "");
+                graphics.drawString(graphics.getWidth() - 1, i, ACS.BLOCK_MIDDLE + "", new Terminal.Style[0]);
 
             graphics.applyThemeItem(Category.DefaultDialog);
-            graphics.drawString(graphics.getWidth() - 1, graphics.getHeight() - 1, ACS.ARROW_DOWN + "");
+            graphics.drawString(graphics.getWidth() - 1, graphics.getHeight() - 1, ACS.ARROW_DOWN + "", new Terminal.Style[0]);
             
             //Finally print the 'tick'
             int scrollableSize = items.size() - graphics.getHeight();
             int tickPosition = (int)(((double)graphics.getHeight() - 3.0) * position);
 
             graphics.applyThemeItem(Category.Shadow);
-            graphics.drawString(graphics.getWidth() - 1, 1 + tickPosition, " ");
+            graphics.drawString(graphics.getWidth() - 1, 1 + tickPosition, " ", new Terminal.Style[0]);
         }
         if(selectedIndex == -1 || items.isEmpty())
             setHotspot(new TerminalPosition(0, 0));
 
     public void keyboardInteraction(Key key, InteractableResult result) throws LanternException
     {
-        switch(key.getKind()) {
-            case Tab:
-            case ArrowRight:
-            case Enter:
+        switch(key.getKind().getIndex()) {
+            case Key.Kind.Tab_ID:
+            case Key.Kind.ArrowRight_ID:
+            case Key.Kind.Enter_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ReverseTab:
-            case ArrowLeft:
+            case Key.Kind.ReverseTab_ID:
+            case Key.Kind.ArrowLeft_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
 
-            case ArrowDown:
+            case Key.Kind.ArrowDown_ID:
                 if(items.isEmpty() || selectedIndex == items.size() - 1)
                     return;
 
                 selectedIndex++;
                 break;
 
-            case ArrowUp:
+            case Key.Kind.ArrowUp_ID:
                 if(items.isEmpty() || selectedIndex == 0)
                     return;
 
     {
         if(text.length() > graphics.getWidth())
             text = text.substring(0, graphics.getWidth());
-        graphics.drawString(x, y, text);
+        graphics.drawString(x, y, text, new Terminal.Style[0]);
     }
 
 }

src/org/lantern/gui/Panel.java

 import org.lantern.gui.layout.SizePolicy;
 import org.lantern.gui.layout.VerticalLayout;
 import org.lantern.gui.theme.Theme.Category;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
         TerminalSize contentPaneSize = border.getInnerAreaSize(graphics.getWidth(), graphics.getHeight());
         TextGraphics subGraphics = graphics.subAreaGraphics(contentPaneTopLeft, contentPaneSize);
 
-        List<LanternLayout.LaidOutComponent> laidOutComponents = layoutManager.layout(contentPaneSize);
-        for(LanternLayout.LaidOutComponent laidOutComponent: laidOutComponents) {
+        List laidOutComponents = layoutManager.layout(contentPaneSize);
+        for(int i = 0; i < laidOutComponents.size(); i++) {
+            LanternLayout.LaidOutComponent laidOutComponent = (LanternLayout.LaidOutComponent)laidOutComponents.get(i);
             TextGraphics subSubGraphics = subGraphics.subAreaGraphics(
                     laidOutComponent.getTopLeftPosition(), laidOutComponent.getSize());
             
 
         graphics.applyThemeItem(graphics.getTheme().getItem(Category.DefaultDialog));
         graphics.setBoldMask(true);
-        graphics.drawString(2, 0, title);
+        graphics.drawString(2, 0, title, new Terminal.Style[] {});
     }
 
     public TerminalSize getPreferredSize()
         return border.surroundAreaSize(layoutManager.getPreferredSize());
     }
 
-    @Override
     public void addComponent(Component component)
     {
         addComponent(component, SizePolicy.CONSTANT);
         layoutManager.addComponent(component, sizePolicy);
     }
 
-    @Override
     public void removeComponent(Component component)
     {
         super.removeComponent(component);
         layoutManager.removeComponent(component);
     }
     
-    public enum Orientation
+    public static class Orientation
     {
-        HORISONTAL,
-        VERTICAL
+        public static final int HORISONTAL_ID = 1;
+        public static final int VERTICAL_ID = 2;
+        
+        public static final Orientation HORISONTAL = new Orientation(HORISONTAL_ID);
+        public static final Orientation VERTICAL = new Orientation(VERTICAL_ID);
+        
+        private final int index;
+
+        public Orientation(int index) {
+            this.index = index;
+        }
+
+        public int getIndex() {
+            return index;
+        }
     }
 
-    @Override
     public String toString()
     {
         return "Panel with " + getComponentCount() + " components";

src/org/lantern/gui/PasswordBox.java

         super(width, initialContent);
     }
 
-    @Override
     protected String prerenderTransformation(String textboxString)
     {
         String newString = "";

src/org/lantern/gui/RadioCheckBox.java

         group.addRadioBox(this);
     }
 
-    @Override
     protected char getSelectionCharacter()
     {
         return 'o';
     }
 
-    @Override
     protected String surroundCharacter(char character)
     {
         return "(" + character + ")";
     }
 
 
-    @Override
     public boolean isSelected()
     {
         return group.isSelected(this);
     }
 
-    @Override
     protected void onActivated()
     {
         group.setSelected(this);

src/org/lantern/gui/RadioCheckBoxGroup.java

  */
 public class RadioCheckBoxGroup
 {
-    private final List<RadioCheckBox> radioBoxes;
+    private final List radioBoxes;
     private int selectedIndex;
 
     public RadioCheckBoxGroup()
     {
-        this.radioBoxes = new ArrayList<RadioCheckBox>();
+        this.radioBoxes = new ArrayList();
         this.selectedIndex = 0;
     }
 

src/org/lantern/gui/Table.java

 public class Table extends AbstractComponent implements InteractableContainer
 {
     private final Panel mainPanel;
-    private final List<Component[]> rows;
+    private final List rows;
     private Panel[] columns;
 
     public Table()
             mainPanel = new Panel(title, Panel.Orientation.HORISONTAL);
         mainPanel.setBetweenComponentsPadding(0);
 
-        rows = new ArrayList<Component[]>();
+        rows = new ArrayList();
 
         //Initialize to something to avoid null pointer exceptions
         columns = new Panel[0];
         mainPanel.setBetweenComponentsPadding(size);
     }
 
-    public void addRow(Component ...components)
+    public void addRow(Component[] components)
     {
         Component[] newRow = new Component[columns.length];
         for(int i = 0; i < columns.length; i++) {
 
     public Component[] getRow(int index)
     {
-        return Arrays.copyOf(rows.get(index), columns.length);
+        return (Component[])Arrays.copyOf((Component[])rows.get(index), columns.length);
     }
 
     public void removeRow(int index)
         mainPanel.repaint(graphics);
     }
 
-    @Override
     void setParent(Container container)
     {
         super.setParent(container);

src/org/lantern/gui/TextBox.java

 
 import org.lantern.gui.theme.Theme.Category;
 import org.lantern.input.Key;
+import org.lantern.terminal.Terminal;
 import org.lantern.terminal.TerminalPosition;
 import org.lantern.terminal.TerminalSize;
 
         String displayString = prerenderTransformation(backend).substring(visibleLeftPosition);
         if(displayString.length() > graphics.getWidth())
             displayString = displayString.substring(0, graphics.getWidth()-1);
-        graphics.drawString(0, 0, displayString);
+        graphics.drawString(0, 0, displayString, new Terminal.Style[0]);
         setHotspot(graphics.translateToGlobalCoordinates(new TerminalPosition(editPosition - visibleLeftPosition, 0)));
         lastKnownWidth = graphics.getWidth();
     }
 
     public void keyboardInteraction(Key key, InteractableResult result)
     {
-        switch(key.getKind()) {
-            case Tab:
-            case ArrowDown:
-            case Enter:
+        switch(key.getKind().getIndex()) {
+            case Key.Kind.Tab_ID:
+            case Key.Kind.ArrowDown_ID:
+            case Key.Kind.Enter_ID:
                 result.type = Result.NEXT_INTERACTABLE;
                 break;
 
-            case ReverseTab:
-            case ArrowUp:
+            case Key.Kind.ReverseTab_ID:
+            case Key.Kind.ArrowUp_ID:
                 result.type = Result.PREVIOUS_INTERACTABLE;
                 break;
 
-            case ArrowRight:
+            case Key.Kind.ArrowRight_ID:
                 if(editPosition == backend.length())
                     break;
                 editPosition++;
                     visibleLeftPosition++;
                 break;
 
-            case ArrowLeft:
+            case Key.Kind.ArrowLeft_ID:
                 if(editPosition == 0)
                     break;
                 editPosition--;
                     visibleLeftPosition--;
                 break;
 
-            case End:
+            case Key.Kind.End_ID:
                 editPosition = backend.length();
                 if(editPosition - visibleLeftPosition >= lastKnownWidth)
                     visibleLeftPosition = editPosition - lastKnownWidth + 1;
                 break;
 
-            case Home:
+            case Key.Kind.Home_ID:
                 editPosition = 0;
                 visibleLeftPosition = 0;
                 break;
 
-            case Delete:
+            case Key.Kind.Delete_ID:
                 if(editPosition == backend.length())
                     break;
                 backend = backend.substring(0, editPosition) + backend.substring(editPosition + 1);
                 break;
 
-            case Backspace:
+            case Key.Kind.Backspace_ID:
                 if(editPosition == 0)
                     break;
                 editPosition--;
                 backend = backend.substring(0, editPosition) + backend.substring(editPosition + 1);
                 break;
 
-            case NormalKey:
+            case Key.Kind.NormalKey_ID:
                 //Add character
                 if(Character.isISOControl(key.getCharacter()) || key.getCharacter() > 127)
                     break;

src/org/lantern/gui/TextGraphics.java

 import java.util.Arrays;
 import java.util.EnumSet;
 
+import java.util.HashSet;
+import java.util.Set;
 import org.lantern.gui.theme.Theme;
 import org.lantern.screen.Screen;
 import org.lantern.terminal.Terminal;
         return new TextGraphics(this, topLeft, subAreaSize);
     }
 
-    public void drawString(int column, int row, String string, Terminal.Style... styles)
+    public void drawString(int column, int row, String string, Terminal.Style[] styles)
     {
         if(column >= areaSize.getColumns() || row >= areaSize.getRows() || string == null)
             return;
         if(string.length() + column > areaSize.getColumns())
             string = string.substring(0, areaSize.getColumns() - column);
 
-        EnumSet<Terminal.Style> stylesSet = EnumSet.noneOf(Terminal.Style.class);
-        stylesSet.addAll(Arrays.asList(styles));
+        Set stylesSet = new HashSet(Arrays.asList(styles));
+        
         if(currentlyBold)
             stylesSet.add(Terminal.Style.Bold);
 
-        screen.putString(column + topLeft.getColumn(), row + topLeft.getRow(), string,
-                foregroundColor, backgroundColor, stylesSet);
+        screen.putString(
+                column + topLeft.getColumn(), 
+                row + topLeft.getRow(), 
+                string,
+                foregroundColor, 
+                backgroundColor, 
+                stylesSet.contains(Terminal.Style.Bold), 
+                stylesSet.contains(Terminal.Style.Underline), 
+                stylesSet.contains(Terminal.Style.Reverse), 
+                stylesSet.contains(Terminal.Style.Blinking));
     }
 
     public Color getBackgroundColor()
             emptyLineBuilder.append(character);
         String emptyLine = emptyLineBuilder.toString();
         for(int i = 0; i < rectangleSize.getRows(); i++)
-            drawString(topLeft.getColumn(), topLeft.getRow() + i, emptyLine);
+            drawString(topLeft.getColumn(), topLeft.getRow() + i, emptyLine, new Terminal.Style[0]);
     }
 
-    @Override
     public String toString()
     {
         return "TextGraphics {topLeft: " + topLeft.toString() + ", size: " + areaSize.toString() + "}";

src/org/lantern/gui/Window.java

 package org.lantern.gui;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import org.lantern.LanternException;
 import org.lantern.gui.layout.SizePolicy;
  */
 public class Window implements Container
 {
-    private final List<WindowListener> windowListeners;
-    private final List<ComponentInvalidatorAlert> invalidatorAlerts;
+    private final List windowListeners;
+    private final List invalidatorAlerts;
     private GUIScreen owner;
     private final Panel contentPane;
     private Interactable currentlyInFocus;
 
     public Window(String title)
     {
-        this.windowListeners = new ArrayList<WindowListener>();
-        this.invalidatorAlerts = new ArrayList<ComponentInvalidatorAlert>();
+        this.windowListeners = new ArrayList();
+        this.invalidatorAlerts = new ArrayList();
         this.owner = null;
         this.contentPane = new Panel(title);
         this.contentPane.setParent(this);
 
     public void invalidate()
     {
-        for(WindowListener listener: windowListeners)
-            listener.onWindowInvalidated(this);
+        Iterator iter = windowListeners.iterator();
+        while(iter.hasNext())
+            ((WindowListener)iter.next()).onWindowInvalidated(this);
     }
 
     public void addEmptyLine()
         
         contentPane.removeComponent(component);
 
-        for(ComponentInvalidatorAlert invalidatorAlert: invalidatorAlerts) {
+        for(int i = 0; i < invalidatorAlerts.size(); i++) {
+            ComponentInvalidatorAlert invalidatorAlert = (ComponentInvalidatorAlert)invalidatorAlerts.get(i);
             if(component == invalidatorAlert.component) {
                 component.removeComponentListener(invalidatorAlert);
                 invalidatorAlerts.remove(invalidatorAlert);
 
     protected void onVisible()
     {
-        for(WindowListener listener: windowListeners)
-            listener.onWindowShown(this);
+        Iterator iter = windowListeners.iterator();
+        while(iter.hasNext())
+            ((WindowListener)iter.next()).onWindowShown(this);
     }
 
     protected void onClosed()
     {
-        for(WindowListener listener: windowListeners)
-            listener.onWindowClosed(this);
+        Iterator iter = windowListeners.iterator();
+        while(iter.hasNext())
+            ((WindowListener)iter.next()).onWindowClosed(this);
     }
 
     private class ComponentInvalidatorAlert extends ComponentAdapter
             return component;
         }
 
-        @Override
         public void onComponentInvalidated(Component component)
         {
             invalidate();

src/org/lantern/gui/dialog/ActionListDialog.java

         });
     }
 
-    public static void showActionListDialog(GUIScreen owner, String title, String description, ActionListBox.Item... items) throws LanternException
+    public static void showActionListDialog(GUIScreen owner, String title, String description, ActionListBox.Item[] items) throws LanternException
     {
         int maxLength = 0;
-        for(ActionListBox.Item item: items)
+        for(int i = 0; i < items.length; i++) {
+            ActionListBox.Item item = items[i];
             if(item.getTitle().length() > maxLength)
                 maxLength = item.getTitle().length();
+        }
         
         showActionListDialog(owner, title, description, maxLength, items);
     }
 
-    public static void showActionListDialog(GUIScreen owner, String title, String description, int itemWidth, ActionListBox.Item... items) throws LanternException
+    public static void showActionListDialog(GUIScreen owner, String title, String description, int itemWidth, ActionListBox.Item[] items) throws LanternException
     {
         ActionListDialog actionListDialog = new ActionListDialog(title, description, itemWidth);
-        for(ActionListBox.Item item: items)
+        for(int i = 0; i < items.length; i++) {
+            ActionListBox.Item item = items[i];
             actionListDialog.addItem(item);
+        }
         owner.showWindow(actionListDialog, GUIScreen.Position.CENTER);
     }
 }

src/org/lantern/gui/dialog/DialogButtons.java

  *
  * @author mabe02
  */
-public enum DialogButtons {
-    OK,
-    OK_CANCEL,
-    YES_NO,
-    YES_NO_CANCEL
+public class DialogButtons {
+    public static final int OK_ID = 1;
+    public static final int OK_CANCEL_ID = 2;
+    public static final int YES_NO_ID = 3;
+    public static final int YES_NO_CANCEL_ID = 4;
+    
+    public static final DialogButtons OK = new DialogButtons(OK_ID);
+    public static final DialogButtons OK_CANCEL = new DialogButtons(OK_CANCEL_ID);
+    public static final DialogButtons YES_NO = new DialogButtons(YES_NO_ID);
+    public static final DialogButtons YES_NO_CANCEL = new DialogButtons(YES_NO_CANCEL_ID);
+    
+    private final int index;
+
+    private DialogButtons(int index) {
+        this.index = index;
+    }
+
+    public int getIndex() {
+        return index;
+    }
 }

src/org/lantern/gui/dialog/DialogResult.java

  *
  * @author mabe02
  */
-public enum DialogResult
+public class DialogResult
 {
-    OK,
-    CANCEL,
-    YES,
-    NO
+    public static final int OK_ID = 1;
+    public static final int CANCEL_ID = 2;
+    public static final int YES_ID = 3;
+    public static final int NO_ID = 4;
+    
+    public static final DialogResult OK = new DialogResult(OK_ID);
+    public static final DialogResult CANCEL = new DialogResult(CANCEL_ID);
+    public static final DialogResult YES = new DialogResult(YES_ID);
+    public static final DialogResult NO = new DialogResult(NO_ID);
+    
+    private final int index;
+
+    private DialogResult(int index) {
+        this.index = index;
+    }
+
+    public int getIndex() {
+        return index;
+    }
 }

src/org/lantern/gui/dialog/ListSelectDialog.java

 public class ListSelectDialog
 {
     public static Object showDialog(final GUIScreen owner, final String title,
-            final String description, final Object... items) throws LanternException
+            final String description, final Object[] items) throws LanternException
     {
         return showDialog(owner, title, description, -1, items);
     }
 
     public static Object showDialog(final GUIScreen owner, final String title,
-            final String description, final int listWidth, final Object... items) throws LanternException
+            final String description, final int listWidth, final Object[] items) throws LanternException
     {
-        final List<Object> result = new ArrayList<Object>();
+        final List result = new ArrayList();
         ActionListBox.Item []actionItems = new ActionListBox.Item[items.length];
         for(int i = 0; i < items.length; i++) {
             final Object item = items[i];

src/org/lantern/gui/dialog/WaitingDialog.java

         spinThread = new Thread(new SpinCode());
     }
 
-    @Override
     protected void onVisible()
     {
         super.onVisible();
         spinThread.start();
     }
     
-    @Override
     public void close()
     {
         isClosed = true;

src/org/lantern/gui/layout/AxisLayout.java

  */
 public abstract class AxisLayout implements LanternLayout
 {
-    private final List<AxisLayoutComponent> componentList;
+    private final List componentList;
     private int padding;
     
     AxisLayout()
     {
-        this.componentList = new ArrayList<AxisLayoutComponent>();
+        this.componentList = new ArrayList();
         this.padding = 0;
     }
 
-    @Override
     public void addComponent(Component component, Object modifiers)
     {
         if(modifiers instanceof SizePolicy == false)
         componentList.add(new AxisLayoutComponent(component, (SizePolicy)modifiers));
     }
 
-    @Override
     public void removeComponent(Component component)
     {
-        Iterator<AxisLayoutComponent> iterator = componentList.iterator();
+        Iterator iterator = componentList.iterator();
         while(iterator.hasNext()) {
-            if(iterator.next().component == component) {
+            if(((AxisLayoutComponent)iterator.next()).component == component) {
                 iterator.remove();
                 return;
             }
 
     public boolean isMaximising()
     {
-        for(AxisLayoutComponent axisLayoutComponent: componentList)
+        for(int i = 0; i < componentList.size(); i++) {
+            AxisLayoutComponent axisLayoutComponent = (AxisLayoutComponent)componentList.get(i);
             if(axisLayoutComponent.sizePolicy == SizePolicy.MAXIMUM)
                 return true;
+        }
 
         return false;
     }
         this.padding = padding;
     }
 
-    @Override
     public TerminalSize getPreferredSize()
     {
         final TerminalSize preferredSize = new TerminalSize(0, 0);
-        for(AxisLayoutComponent axisLayoutComponent: componentList) {
+        for(int i = 0; i < componentList.size(); i++) {
+            AxisLayoutComponent axisLayoutComponent = (AxisLayoutComponent)componentList.get(i);
             final TerminalSize componentPreferredSize = axisLayoutComponent.component.getPreferredSize();
             setMajorAxis(preferredSize, getMajorAxis(preferredSize) + getMajorAxis(componentPreferredSize));
             setMinorAxis(preferredSize, Math.max(getMinorAxis(preferredSize), getMinorAxis(componentPreferredSize)));
         return preferredSize;
     }
 
-    @Override
-    public List<LaidOutComponent> layout(TerminalSize layoutArea)
+    public List layout(TerminalSize layoutArea)
     {
-        List<AxisLaidOutComponent> result = new ArrayList<AxisLaidOutComponent>();
-        List<AxisLaidOutComponent> growingComponents = new ArrayList<AxisLaidOutComponent>();
+        List result = new ArrayList();
+        List growingComponents = new ArrayList();
 
         final int availableMinorAxisSpace = getMinorAxis(layoutArea);
         int availableMajorAxisSpace = getMajorAxis(layoutArea);
 
-        for(AxisLayoutComponent axisLayoutComponent: componentList) {
+        for(int i = 0; i < componentList.size(); i++) {
+            AxisLayoutComponent axisLayoutComponent = (AxisLayoutComponent)componentList.get(i);
             TerminalSize componentPreferredSize = axisLayoutComponent.component.getPreferredSize();
             int componentPreferredMajorAxisSize = getMajorAxis(componentPreferredSize);
             
         }
 
         while(!growingComponents.isEmpty() && availableMajorAxisSpace > 0) {
-            for(AxisLaidOutComponent laidOutComponent: growingComponents) {
+            for(int i = 0; i < growingComponents.size(); i++) {
+                AxisLaidOutComponent laidOutComponent = (AxisLaidOutComponent)growingComponents.get(i);
                 setMajorAxis(laidOutComponent.size, getMajorAxis(laidOutComponent.size) + 1);
                 if(--availableMajorAxisSpace == 0)
                     break;
         }
 
         int nextMajorPosition = 0;
-        for(AxisLaidOutComponent laidOutComponent: result) {
+        for(int i = 0; i < result.size(); i++) {
+            AxisLaidOutComponent laidOutComponent = (AxisLaidOutComponent)result.get(i);
             setMajorAxis(laidOutComponent.topLeftPosition, nextMajorPosition);
             nextMajorPosition += getMajorAxis(laidOutComponent.size) + padding;
         }

src/org/lantern/gui/layout/HorisontalLayout.java

  */
 public class HorisontalLayout extends AxisLayout
 {
-    @Override
     protected int getMajorAxis(TerminalSize terminalSize)
     {
         return terminalSize.getColumns();
     }
 
-    @Override
     protected int getMinorAxis(TerminalSize terminalSize)
     {
         return terminalSize.getRows();
     }
 
-    @Override
     protected void setMajorAxis(TerminalSize terminalSize, int majorAxisValue)
     {
         terminalSize.setColumns(majorAxisValue);
     }
 
-    @Override
     protected void setMajorAxis(TerminalPosition terminalPosition, int majorAxisValue)
     {
         terminalPosition.setColumn(majorAxisValue);
     }
 
-    @Override
     protected void setMinorAxis(TerminalSize terminalSize, int minorAxisValue)
     {
         terminalSize.setRows(minorAxisValue);

src/org/lantern/gui/layout/LanternLayout.java